<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 12 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:"\@SimSun";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:SimSun;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:"Verdana","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Hi Ray,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">This is actually a bug &#8211; now fixed in SVN. &nbsp;Update to revision 316 and it should work. (you&#8217;ll also get the new distribution table UI which I have just written).<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">You might need to run<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">delete from text_metadata_fieldswhere corpus=&quot;test&quot;;<o:p></o:p></span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">before starting again to install the metadata.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Note also, your metadata input file should not contain header rows &#8211; just one row per text.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">best<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D">Andrew.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Verdana&quot;,&quot;sans-serif&quot;;color:#1F497D"><o:p>&nbsp;</o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;">From:</span></b><span lang="EN-US" style="font-size:10.0pt;font-family:&quot;Tahoma&quot;,&quot;sans-serif&quot;"> cwb-bounces@sslmit.unibo.it [mailto:cwb-bounces@sslmit.unibo.it]
<b>On Behalf Of </b>???<br>
<b>Sent:</b> 18 May 2012 13:51<br>
<b>To:</b> cwb@sslmit.unibo.it<br>
<b>Subject:</b> [CWB] corpus setup problem on CQPweb 3.0.5: cannot create metadata , Error # 1062<o:p></o:p></span></p>
</div>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black">Hi there,<br>
This is Ray Wu from China. This is my first time being here. My solution to you all on the list.<br>
<br>
I am a college ESL teacher and just a few days ago I started to learn CQPweb, both for teaching and research. Now I am fiddling with a toy corpus on CQPweb to get initiated.<br>
<br>
My toy corpus is as suggested in Andrew's paper: test.vrt&nbsp; (encoded in ISO-8859-1)<br>
&lt;text id=&quot;test&quot;&gt;<br>
&lt;s&gt;<br>
The AT0 the<br>
cat NN1 cat<br>
sat VVD sit<br>
on&nbsp; PRP on<br>
the AT0 the<br>
mat NN1 mat<br>
.&nbsp;&nbsp; PUN .<br>
&lt;/s&gt;<br>
&lt;s&gt;<br>
Many&nbsp;&nbsp;&nbsp; DT0 many<br>
cats&nbsp;&nbsp;&nbsp; NN2 cat<br>
sit VVB sit<br>
on&nbsp; PRP on<br>
mats&nbsp;&nbsp;&nbsp; NN2 mat<br>
.&nbsp;&nbsp; PUN .<br>
&lt;/s&gt;<br>
&lt;/text&gt;<br>
<br>
My metadata file: test_meta.dat (encoded in ISO-8859-1, tab separated)<br>
text_id genre&nbsp;&nbsp; sampled<br>
test&nbsp;&nbsp;&nbsp; press&nbsp;&amp;n bsp; all&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<br>
Presently, the corpus can be loaded into CQPweb without any fuss. But when I arrived at the &quot;Admin tools for managing corpus metadata&quot; page, I hit upon an error. Here are my then choices on that page:<br>
field 1&nbsp;&nbsp;&nbsp; genre&nbsp;&nbsp;&nbsp; classification<br>
field&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; sampled&nbsp;&nbsp;&nbsp; classification<br>
<br>
After clicking &quot;install metadata table using the settings above&quot;, I got an error message like this:<br>
A mySQL query did not run successfully!<br>
Error # 1062: Duplicate entry 'test-__HANDLE' for key 1 <br>
<br>
I then peeped into MySQL and found the following 4 tables concerning metadata:<br>
mysql&gt; show tables;<br>
...<br>
corpus_metadata_fixed (empty)<br>
corpus_metadata_variable (empty)<br>
...<br>
text_metadata_fields<br>
text_metadata_values&nbsp; (empty)<br>
...<br>
<br>
mysql&gt; select * from text_metadata_fields ;<br>
&#43;--------&#43;----------&#43;-------------&#43;-------------------&#43;<br>
| corpus | handle&nbsp;&nbsp; | description | is_classification |<br>
&#43;--------&#43;----------&#43;-------------&#43;-------------------&#43;<br>
| test&nbsp;&nbsp; | genre&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 | <br>
| test&nbsp;&nbsp; | sampled&nbsp; &nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1 | <br>
| test&nbsp;&nbsp; | __HANDLE &nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 | <br>
&#43;--------&#43;----------&#43;-------------&#43;-------------------&#43;<br>
<br>
But if I click &quot;create mini malist metadata table&quot;, a metadata table can be created successfully and I could start to query.<br>
mysql&gt; select * from text_metadata_for_test;<br>
&#43;---------&#43;-------&#43;-----------&#43;---------&#43;<br>
| text_id | words | cqp_begin | cqp_end |<br>
&#43;---------&#43;-------&#43;-----------&#43;---------&#43;<br>
| test&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 13 &nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 12&nbsp;&nbsp;&nbsp; | <br>
&#43;---------&#43;-------&#43;-----------&#43;---------&#43;<br>
<br>
This frustrates me as I know that without metadata, a corpus is of little value for search/research. Has anyone encountered similar messages before?<br>
<br>
I have browsed all the archived mailinglist but found no direct answer to this problem (but I haven't looked at the source code yet). I don't know whether this indicates I need to manually add a few columns to the text_metadata_for_test table or I have just
 missed something important to get it done. Thanks for any pointers.<br>
<br>
My thanks also goes to Andrew for a previous help regarding a CQPweb 3.0.5 file-write permission problem in a personal emai and pointing me at here. Thank you, Andrew.<br>
<br>
PS: my computer paratemers:<br>
System: Ubuntu 8.04<br>
Apache: 2.0.63<br>
MySQL: 5.0.88<br>
PHP: 5.2.12 (lower than expected 5.3.0)<br>
Perl: 5.8.8<br>
CWB: 3.0.0<br>
Linux utilites: awk, tar, gzip, iconv<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:gray">Wu Liangping<br>
School of International Studies<br>
Hunan University of Commerce<br>
PO Box&nbsp; 410000<br>
Changsha, China&nbsp;</span><span style="font-size:10.5pt;font-family:&quot;Arial&quot;,&quot;sans-serif&quot;;color:black"><o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>