Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

The 'Locale' vocabulary, which is generated by geo data, has now the objectspace "http://dbpedia.org/resource/"

Michael Peter Christen79464189a4a3
diff --git a/htroot/Vocabulary_p.html b/htroot/Vocabulary_p.html
index ebce2e014..5febbdf29 100644
--- a/htroot/Vocabulary_p.html
+++ b/htroot/Vocabulary_p.html
@@ -40,9 +40,9 @@
<dt>Namespace</dt><dd>#[namespace]#</dd>
<dt>Predicate</dt><dd>#[predicate]#</dd>
<dt>Prefix</dt><dd>#[prefix]#</dd>
- <dt>Objectspace</dt><dd>#(editable)##[objectspacepredicate]#::<input type="text" name="objectspace" value="#[objectspace]#" size="78" maxlength="128" /><br/>if set, this uses the predicate <a href="#[objectspacepredicate]#">#[objectspacepredicate]#</a> for generated objects#(/editable)#</dd>
+ <dt>Objectspace</dt><dd>#(editable)##[objectspace]#::<input type="text" name="objectspace" value="#[objectspace]#" size="78" maxlength="128" /><br/>if set, uses the predicate <a href="#[objectspacepredicate]#">#[objectspacepredicate]#</a> for generated objects. Hint: use 'http://dbpedia.org/resource/' as default.#(/editable)#</dd>
</dl>
- <p>This produces the following triples in the <a href="/GetRDF.xml?global=">triplestore</a> if a term or synonym matches in a document:</p>
+ <p>This produces the following triples in the <a href="/interaction/GetRDF.xml?global=">triplestore</a> if a term or synonym matches in a document:</p>
<dl>
<dt>Triple #1</dt><dd>#[triple1]#</dd>
<dt>Triple #2</dt><dd>#[triple2]#</dd>
diff --git a/source/net/yacy/cora/lod/vocabulary/Tagging.java b/source/net/yacy/cora/lod/vocabulary/Tagging.java
index 8d47be415..f2d2ed8f7 100644
--- a/source/net/yacy/cora/lod/vocabulary/Tagging.java
+++ b/source/net/yacy/cora/lod/vocabulary/Tagging.java
@@ -73,10 +73,12 @@ public class Tagging {
}
private File tmpFile() {
+ if (this.propFile == null) return null;
return new File(this.propFile.getAbsolutePath() + ".tmp");
}
public void put(String term, String synonyms) throws IOException {
+ if (this.propFile == null) return;
File tmp = tmpFile();
BufferedWriter w = new BufferedWriter(new FileWriter(tmp));
BlockingQueue<String> list = Files.concurentLineReader(this.propFile, 1000);
@@ -109,6 +111,7 @@ public class Tagging {
}
public void delete(String term) throws IOException {
+ if (this.propFile == null) return;
File tmp = tmpFile();
BufferedWriter w = new BufferedWriter(new FileWriter(tmp));
BlockingQueue<String> list = Files.concurentLineReader(this.propFile, 1000);
@@ -136,6 +139,7 @@ public class Tagging {
}
public void setObjectspace(String os) throws IOException {
+ if (this.propFile == null) return;
if (os == null || (this.objectspace != null && this.objectspace.equals(os))) return;
this.objectspace = os;
File tmp = tmpFile();
diff --git a/source/net/yacy/document/Autotagging.java b/source/net/yacy/document/Autotagging.java
index 5458b7411..0a01f1458 100644
--- a/source/net/yacy/document/Autotagging.java
+++ b/source/net/yacy/document/Autotagging.java
@@ -115,6 +115,10 @@ public class Autotagging {
public void addLocalization(Localization localization) {
Tagging voc = new Tagging("Locale", localization);
+ try {
+ voc.setObjectspace("http://dbpedia.org/resource/");
+ } catch (IOException e) {
+ }
this.vocabularies.put("Locale", voc);
for (String t: voc.tags()) {
this.allTags.put(t, PRESENT);