<div dir="ltr"><div dir="ltr">On Sat, Jun 15, 2019 at 10:52 AM Hardie, Andrew &lt;<a href="mailto:a.hardie@lancaster.ac.uk">a.hardie@lancaster.ac.uk</a>&gt; wrote:<br></div><div dir="ltr"><br></div><div>Hi Andrew,</div><div><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black"><span style="font-size:11pt">CQPweb is built on the same assumption as CWB generally:that corpora don&#39;t change once created.</span></div></div></blockquote><div><br></div><div>That&#39;s what I imagined, and I realize mine is an edge case in the extreme. I just wanted to be sure.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black"><span style="font-size:11pt">Overwriting the indexes with an expanded version, while trying to keep the CQPweb extra bits intact ,  therefore implies undefined behaviour. </span><span style="font-size:11pt">Ie, you&#39;re not meant to do it; having done it, all kinds of things might break; the low number of things that have actually broken is pure good luck! </span><span style="font-size:11pt">In particular  I have no idea what kinds of inconsistencies might arise in things like user&#39;s  saved data. As I say, undefined : anything could happen.</span><br></div></blockquote><div><br></div><div>Thanks very much for the warning! I didn&#39;t realize the situation was that dangerous, and I certainly won&#39;t be repeating it!</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black"><span style="font-size:11pt">But to answer the question: the safe way to add new metadata category values is to nuke the whole metadata table and rebuild from scratch. You might find an unsafe way by poking around in metadata lib php and script a series of calls... but that would be a
 pretty precarious way to do it. </span><span style="font-size:11pt">And in future I am going to shift the underlying SQL datatype of category metadata from strings to enums for efficiency... at which point the above will be super-precarious.</span></div></div></blockquote><div><br></div><div>All clear!</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black"><b style="font-size:11pt">Is there any way to update a corpus so that it rescans metadata like p- and s-attributes and their values?</b><span style="font-size:11pt"> My goal is to avoid having to recreate the corpus from scratch over and over.</span><br></div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
-------<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Fair enough,  but note what you&#39;re already doing:<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Offline rebuild of the CWB data <br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Rebuild of all the freq tables <br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
Reinstallation of metadata table (As per above)<br>
<br>
</div>
<div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black">
.... which is nearly ALL the work of installing a corpus from scratch already.  <br></div></div></blockquote><div><br></div><div>Yes, but I have everything from tagging to local corpus creation to uploading via SSH scripted, so it takes me just a second or two :-) It&#39;s what comes next, which mostly involves MySQL, that I haven&#39;t figured out how to automate, and so it takes me a fair bit of time.</div><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div dir="auto" style="direction:ltr;margin:0px;padding:0px;font-family:sans-serif;font-size:11pt;color:black"><span style="font-size:11pt">My recommendation: set up highly specific templates, index the data offline, and use &quot;new corpus from existing cwb&quot; (can&#39;t remember the exact wording, sorry... That saves you specifying p/s atts as they are taken from
 the registry.  The rest is what you are doing anyway. </span><span style="font-size:11pt">This also has the benefit of making it possible to preserve the earlier versions -- your users might appreciate this if ever they need to do an analysis on the exact data as an analysis they did last year, for instance... on my server I do this by means of
 dates or version nos. on the end of corpus handles.</span></div></div></blockquote><div><br></div><div>That seems like an excellent strategy. I&#39;ll be doing just that from now on. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="color:rgb(0,0,0);font-family:sans-serif;font-size:14.6667px"> I&#39;m writing at a wedding with no laptop!).</span></blockquote><div><br></div><div>As always, Andrew, you&#39;ve gone above and beyond the call of duty. Thanks yet again!</div><div><br></div><div>Best,</div><div>Scott </div></div></div>