summaryrefslogtreecommitdiff
path: root/htroot/Vocabulary_p.html
blob: ffd732d29f24b4f20a8c457315d5f324b53e9f78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>YaCy '#[clientname]#': Federated Index</title>
    #%env/templates/metas.template%#
  <script type="text/javascript">
//<![CDATA[
function xmlhttpPost() {
    var searchform = document.getElementById('searchform');
    search(searchform.discoverobjectspace.value);
}

function search(query) {
    var xmlHttpReq = false;
    var self = this;
    if (window.XMLHttpRequest) { // Mozilla/Safari
        self.xmlHttpReq = new XMLHttpRequest(); 
    }
    else if (window.ActiveXObject) { // IE
        self.xmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
    }
    self.xmlHttpReq.open('GET', "yacysearch.json?verify=false&resource=local&maximumRecords=100&nav=none&query=" + query + "+inurl:" + query, true);
    self.xmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    self.xmlHttpReq.onreadystatechange = function() {
        if (self.xmlHttpReq.readyState == 4) {
            updatepage(self.xmlHttpReq.responseText);
        }
    }
    self.xmlHttpReq.send(null);
}

function updatepage(str) {
  var raw = document.getElementById("raw");
  if (raw != null) raw.innerHTML = str;
  var rsp = eval("("+str+")");
  var firstChannel = rsp.channels[0];
  var totalResults = firstChannel.totalResults.replace(/[,.]/,"");
  var startIndex = firstChannel.startIndex;
  var itemsPerPage = firstChannel.itemsPerPage;
  var navigation = firstChannel.navigation;
  
  var html = "";
  
  if (totalResults > 0 && firstChannel.items.length > 0) {
    var item;
    html += "<table class=\"networkTable\" cellpadding=\"2\" cellspacing=\"1\" width=\"99%\">";
    html += "<thead><tr class=\"TableHeader\" style=\"vertical-align: bottom\">";
    html += "<th>URL from index (total results = " + totalResults + ")<\/th>";
    html += "</thead><tbody>";
    for (var i = 0; i < firstChannel.items.length; i++) {
        item = firstChannel.items[i];
        html += "<tr class=\"TableCellLight\"><td style=\"text-align: left\" onclick=\"document.getElementById('searchform').value='" + item.link + "';\">" + item.link + "<\/td>";
    }
    html += "</tbody><\/table>";
  }
  document.getElementById("searchresults").innerHTML = html;
}
//]]>
</script>
  </head>
  <body id="Vocabulary_p">

    #%env/templates/header.template%#
    #%env/templates/submenuSemantic.template%#
    
#(edit)#::
<div id="api">
<a href="Vocabulary_p.xml" id="apilink"><img src="env/grafics/api.png" width="60" height="40" alt="API"/></a>
<script type="text/javascript">
//<![CDATA[
document.getElementById('apilink').setAttribute('href', 'Vocabulary_p.xml?' + window.location.search.substring(1));
//]]>
</script>
<span>The information that is presented on this page can also be retrieved as XML
Click the API icon to see the RDF Ontology definition for this vocabulary.
To see a list of all APIs, please visit the <a href="https://wiki.yacy.net/index.php/Dev:API" target="_blank">API wiki page</a>.</span>
</div>
#(/edit)#
    
    <h2>Vocabulary Administration</h2>
    <p>
      Vocabularies can be used to produce a search navigation. A vocabulary must be created before content is indexed.
      The vocabulary is used to annotate the indexed content with a reference to the object that is denoted by the term of the vocabulary.
      The object can be denoted by a url stub that, combined with the term, becomes the url for the object.
    </p>
    
    <form action="Vocabulary_p.html" method="get" accept-charset="UTF-8" class="form-horizontal">
      <fieldset>
        <legend>Vocabulary Selection</legend>
        <div class="form-group">
        	<label for="vocabularyName" class="col-sm-4 col-lg-3 control-label">Vocabulary Name</label>
        	<div class="col-sm-5">
         		<select name="vocabulary" id="vocabularyName" onchange="this.form.submit()" class="form-control">
            		#{vocabularyset}#
            		<option value="#[name]#"#(selected)#:: selected="selected"#(/selected)#>#[name]#</option>
            		#{/vocabularyset}#
          		</select>
          	</div>
        </div>
        <div class="form-group">
        	<div class="col-sm-offset-4 col-lg-offset-3 col-sm-7">
        		<input type="submit" class="btn btn-primary" name="view" value="View" />
        	</div>
        </div>
    </fieldset>
    </form>
    
    #(create)#::
    <form action="Vocabulary_p.html" id="searchform" method="post" accept-charset="UTF-8" class="form-horizontal">
      <input type="hidden" name="transactionToken" value="#[transactionToken]#" />
      <fieldset>
        <legend>Vocabulary Production</legend>
      #(csvFileStatus)#
        ::<div class="alert alert-danger" role="alert">Please provide a CSV file path or <abbr title="Uniform Resource Locator">URL</abbr>.</div>
    	::<div class="alert alert-danger" role="alert">CSV file not found "#[csvPath]#".</div>
    	::<div class="alert alert-danger" role="alert">Can not read CSV file at "#[csvFile]#".</div>
    	::<div class="alert alert-danger" role="alert">CSV file error : you selected a directory ("#[csvPath]#").</div>
    	::<div class="alert alert-danger" role="alert">CSV file URL is malformed "#[csvUrl]#".</div>
      #(/csvFileStatus)#
      #(vocabWriteError)#
        ::<div class="alert alert-danger" role="alert">Could not write vocabulary file at "#[vocabPath]#".</div>
      #(/vocabWriteError)#
        <div class="form-group">
          <label for="discoverName" class="col-sm-4 col-lg-3 control-label">Vocabulary Name</label>
          <div class="col-sm-5">
          	<input type="text" id="discoverName" name="discovername" value="" maxlength="128" required="required" class="form-control"/>
          </div>
        </div>
        <div class="form-group">
        	<div class="radio col-sm-offset-4 col-lg-offset-3 col-sm-7">
          		<label>
          			<input type="radio" name="discovermethod" value="none" checked="checked"/> Empty Vocabulary
          		</label>
        	</div>
        </div>
    	<label class="col-sm-4 col-lg-3 control-label">Auto-Discover</label>
    	<div class="form-group">
          <div class="radio col-sm-offset-4 col-lg-offset-3 col-sm-7">
          	<label>
          		<input type="radio" name="discovermethod" value="path" onclick="document.getElementById('discoverobjectspace').disabled=''"/> from file name
          	</label>
          </div>
          <div class="radio col-sm-offset-4 col-lg-offset-3 col-sm-7">
          	<label>
          		<input type="radio" name="discovermethod" value="title" onclick="document.getElementById('discoverobjectspace').disabled=''"/> from page title
          	</label>
          </div>
          <div class="radio col-sm-offset-4 col-lg-offset-3 col-sm-7">
          	<label>
          		<input type="radio" name="discovermethod" value="titlesplitted" onclick="document.getElementById('discoverobjectspace').disabled=''"/> from page title (split)
          	</label>
          </div>
          <div class="radio col-sm-offset-4 col-lg-offset-3 col-sm-7">
          	<label>
          		<input type="radio" name="discovermethod" value="author" onclick="document.getElementById('discoverobjectspace').disabled=''"/> from page author
          	</label>
          </div>
        </div>
        <div class="form-group">
            <label for="discoverobjectspace" class="col-sm-4 col-lg-3 control-label">Objectspace</label>
            <div class="col-sm-5">
          		<input type="text" id="discoverobjectspace" name="discoverobjectspace" value="http://" size="78" maxlength="512" disabled="disabled" class="form-control" aria-describedby="helpDiscoverObjectSpace"/>
            </div>
        	<div id="helpDiscoverObjectSpace" class="col-sm-offset-1 col-sm-11 col-lg-offset-0 col-lg-4">It is possible to produce a vocabulary out of the existing search index. This is done using a given 'objectspace' which you can enter as a URL Stub.
                This stub is used to find all matching URLs. If the remaining path from the matching URLs then denotes a single file, the file name is used as vocabulary term.
                This works best with wikis. Try to use a wiki url as objectspace path.</div>
            <div id="searchresults"></div>
        </div>
        <div class="form-group">
          <div class="radio col-sm-offset-4 col-lg-offset-3 col-sm-7">
          	<label>
          		<input type="radio" name="discovermethod" value="csv" onclick="document.getElementById('discoverpath').disabled='';document.getElementById('discoverLineStart').disabled='';document.getElementById('discovercolumnliteral').disabled='';document.getElementById('discovercolumnsynonyms').disabled='';document.getElementById('discovercolumnobjectlink').disabled='';document.getElementById('discoverCharset').disabled='';document.getElementById('discoverColSeparator').disabled='';"/>
          		Import from a csv file
          	</label>
          </div>
        </div>
        <div class="form-group">
          <label for="discoverpath" class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>File Path or <abbr title="Uniform Resource Locator">URL</abbr></i></label>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-5">
          	<input type="text" id="discoverpath" name="discoverpath" value="" size="78" maxlength="256" disabled="disabled" class="form-control">
          </div>
        </div>
        <div class="form-group">
          <label for="discoverLineStart" class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>Start line</i></label>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-2">
          	<input type="number" id="discoverLineStart" name="discoverLineStart" min="0" max="99" step="1" size="2" value="0" disabled="disabled" class="form-control" aria-describedby="helpLineStart">
          </div>
          <span id="helpLineStart" class="col-xs-offset-2 col-sm-offset-0 help-block">(first has index 0)</span>
        </div>
        <div class="form-group">
          <label for="discovercolumnliteral" class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>Column for Literals</i></label>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-2">
          	<input type="number" id="discovercolumnliteral" name="discovercolumnliteral" min="0" max="99" step="1" size="2" value="0" disabled="disabled" class="form-control" aria-describedby="helpDiscoverColumnLiteral">
          </div>
          <span id="helpDiscoverColumnLiteral" class="col-xs-offset-2 col-sm-offset-0 help-block">(first has index 0)</span>
        </div>
    	<label class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>Synonyms</i></label>
    	<div class="form-group">
          <div class="radio col-xs-offset-1 col-sm-offset-5 col-lg-offset-4 col-sm-7">
          	<label>
          		<input type="radio" name="discoversynonymsmethod" id="discoverSynonymsMethodNo" value="none" checked="checked"/> <i>no Synonyms</i>
          	</label>
          </div>
          <div class="radio col-xs-offset-1 col-sm-offset-5 col-lg-offset-4 col-sm-7">
          	<label>
          		<input type="radio" name="discoversynonymsmethod" id="discoverSynonymsMethodAuto" value="enrichsynonyms"/> <i>Auto-Enrich with Synonyms from Stemming Library</i>
          	</label>
          </div>
          <div class="radio col-xs-offset-1 col-sm-offset-5 col-lg-offset-4 col-sm-2">
          	<label>
          		<input type="radio" name="discoversynonymsmethod" id="discoverSynonymsMethodReadCol" value="readcolumn" onclick="document.getElementById('discovercolumnsynonyms').value=parseInt(document.getElementById('discovercolumnliteral').value)+1;"/>
          		<i>Read Column</i>
          	</label>
          </div>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-5">
          	<div class="col-sm-6">
          		<input type="number" id="discovercolumnsynonyms" name="discovercolumnsynonyms" min="-1" max="99" step="1" size="2" value="-1" disabled="disabled" class="form-control" aria-describedby="helpDiscoverColumnSynonyms">
          	</div>
          	<span id="helpDiscoverColumnSynonyms" class="help-block col-sm-6">(first has index 0)</span>
          </div>
        </div>
        <div class="form-group">
          <label for="discovercolumnobjectlink" class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>Column for Object Link (optional)</i></label>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-2">
          	<input type="number" id="discovercolumnobjectlink" name="discovercolumnobjectlink" min="-1" max="99" step="1" size="2" value="-1" disabled="disabled" class="form-control" aria-describedby="helpDiscoverColumnObjectLink">
          </div>
          <span id="helpDiscoverColumnObjectLink" class="col-xs-offset-2 col-sm-offset-0 help-block">(first has index 0, if unused set -1)</span>
        </div>
        <div class="form-group">
          <label for="discoverCharset" class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>Charset of Import File</i></label>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-3">
          	<select name="charset" id="discoverCharset" disabled="disabled" class="form-control">
          	#{charset}#<option value="#[name]#" #(selected)#::selected="selected"#(/selected)#>#[name]#</option>#{/charset}#
          	</select>
          </div>
        </div>
        <div class="form-group">
          <label for="discoverColSeparator" class="col-xs-offset-1 col-sm-offset-0 col-sm-5 col-lg-4 control-label"><i>Column separator</i></label>
          <div class="col-xs-offset-1 col-sm-offset-0 col-sm-3">
          	<select name="columnSeparator" id="discoverColSeparator" disabled="disabled" class="form-control">
            	<option value="," title="Standard CSV field delimiter">Comma ','</option>
            	<option value=";">Semicolon ';'</option>
          	</select>
          </div>
        </div>
        <div class="form-group">
        	<div class="col-sm-offset-4 col-lg-offset-3 col-sm-7">
       	        <input type="submit" class="btn btn-primary" name="create" value="Create" />
        	</div>
        </div>

    </fieldset>
    </form>
    #(/create)#
    
    #(edit)#::
    <form action="Vocabulary_p.html" method="post" enctype="multipart/form-data" accept-charset="UTF-8" class="form-horizontal">
      <input type="hidden" name="transactionToken" value="#[transactionToken]#" />
      <fieldset><legend>Vocabulary Editor</legend>
      <dl>
        <dt>Vocabulary Name</dt><dd>#[name]#</dd>
        <dt>File</dt><dd>#(editable)#[automatically generated, not stored, cannot be edited]::#[file]##(/editable)#</dd>
        <dt>Size</dt><dd>#[size]# literals</dd>
        <dt>Namespace</dt><dd>#[namespace]#</dd>
        <dt>Predicate</dt><dd>#[predicate]#</dd>
        <dt>Prefix</dt><dd>#[prefix]#</dd>
      </dl>
        <div class="form-group">
            <label #(editable)#::for="editObjectSpace"#(/editable)# class="col-xs-12 col-sm-3 control-label">Objectspace</label>
            <div class="col-xs-5 col-sm-5">
            	#(editable)#<p class="form-control-static">#[objectspace]#</p>::
            	<input type="text" id="editObjectSpace" name="objectspace" value="#[objectspace]#" maxlength="128" class="form-control" aria-describedby="helpEditObjectSpace"/>
            	#(/editable)#
            </div>
        	#(editable)#::<div id="helpEditObjectSpace" class="col-xs-12 col-sm-offset-3 col-sm-7 help-block">
        	if set, uses the predicate <a href="#[objectspacepredicate]#" target="_blank">#[objectspacepredicate]#</a> for generated objects. Hint: use 'http://dbpedia.org/resource/' as default.
        	</div>
        	#(/editable)#
        </div>
        <div class="form-group">
        	<label for="editIsFacet" class="col-xs-1 col-sm-3 control-label">Is Facet?</label>
        	<div class="checkbox-inline">
          		<input type="checkbox" id="editIsFacet" name="isFacet"#(isFacet)#:: checked="checked"#(/isFacet)# aria-describedby="helpEditIsFacet"/>
				<span id="helpEditIsFacet" class="help-block">
        			(If checked, this vocabulary is used for search facets. Not feasible for large vocabularies!)
        		</span>
        	</div>
        </div>
    	<div class="form-group">
    	  <label class="col-xs-2 col-sm-3 control-label">Match terms from</label>
          <div class="radio-inline">
        	<label>
          		<input type="radio" name="vocabularies.matchLinkedData" value="false" #(vocabularies.matchLinkedData)#checked="checked"::#(/vocabularies.matchLinkedData)# #(editable)#disabled="disabled"::#(/editable)#/>Cleartext
          	</label>
          </div>
          <div class="radio-inline">
          	<label>
          		<input type="radio" name="vocabularies.matchLinkedData" value="true" #(vocabularies.matchLinkedData)#::checked="checked"#(/vocabularies.matchLinkedData)# #(editable)#disabled="disabled"::#(/editable)#/>Linked data/Semantic web annotations
          	</label>
          </div>
        </div>
      <table class="sortable">
      <thead>
      	<tr class="TableHeader">
        	<th>Modify</th>
        	<th>Delete</th>
        	<th>Literal</th>
        	<th>Synonyms</th>
        	<th>Object Link</th>
      	</tr>
      </thead>
      <tbody>
      	#{terms}#
      	<tr class="TableCell#(dark)#Light::Dark::Summary#(/dark)#">
        	<td class="text-center">#(editable)#&nbsp;::<input type="checkbox" name="modify_#[term]#" id="modify_#[term]#" value="checked" disabled="disabled"/>#(/editable)#</td>
        	<td class="text-center">#(editable)#&nbsp;::<input type="checkbox" name="delete_#[term]#" id="delete_#[term]#" value="checked" />#(/editable)#</td>
        	<td class="text-left">#[term]#</td>
        	<td class="text-left">#(editable)##[synonyms]#::<input type="text" name="synonyms_#[term]#" value="#[synonyms]#" size="40" maxlength="1024" onkeyup="document.getElementById('modify_#[term]#').checked='checked'; document.getElementById('modify_#[term]#').disabled=''; document.getElementById('delete_#[term]#').disabled='disabled';"/>#(/editable)#</td>
        	<td class="text-left">#(editable)##[objectlink]#::<input type="text" name="objectlink_#[term]#" value="#[objectlink]#" size="60" maxlength="1024" onkeyup="document.getElementById('modify_#[term]#').checked='checked'; document.getElementById('modify_#[term]#').disabled=''; document.getElementById('delete_#[term]#').disabled='disabled';"/>#(/editable)#</td>
      	</tr>
      	#{/terms}#
      </tbody>
      #(editable)#::
      <tfoot>
      	<tr class="TableCellDark">
        	<td class="text-center" colspan="2"><label><input type="checkbox" name="add_new" id="add_new" value="checked" disabled="disabled"/> <i>add</i></label></td>
        	<td class="text-left"><input type="text" name="newterm" id="newterm" value="" size="24" maxlength="128" onkeyup="document.getElementById('add_new').checked='checked'; document.getElementById('add_new').disabled=''"/></td>
        	<td class="text-left"><input type="text" name="newsynonyms" id="newsynonyms" value="" size="40" maxlength="1024"/></td>
        	<td class="text-left"><input type="text" name="newobjectlink" id="newobjectlink" value="" size="60" maxlength="1024"/></td>
      	</tr>
      	<tr class="TableCellDark">
        	<td colspan="3"></td>
        	<td colspan="2" class="TableCellSummary text-right"><label><input type="checkbox" name="clear_table" id="clear_table" value="checked" /> <i>clear table (remove all terms)</i></label></td>
      	</tr>
      	<tr class="TableCellDark">
        	<td colspan="3"></td>
        	<td colspan="2" class="TableCellSummary text-right"><label><input type="checkbox" name="delete_vocabulary" id="delete_vocabulary" value="checked" /> <i>delete vocabulary</i></label></td>
      	</tr>
      </tfoot>
      #(/editable)#
      </table>
      <input type="hidden" name="vocabulary" value="#[name]#" />
      <input type="submit" class="btn btn-primary" name="set" value="Submit" />
    </fieldset>
    </form>
    #(/edit)#
    
    #%env/templates/footer.template%#
  </body>
</html>