diff options
| -rw-r--r-- | examples/surrogate_dublin_core.xml | 10 | ||||
| -rw-r--r-- | source/de/anomic/crawler/Surrogate.java | 15 |
2 files changed, 12 insertions, 13 deletions
diff --git a/examples/surrogate_dublin_core.xml b/examples/surrogate_dublin_core.xml index d71058f72..2558b1a62 100644 --- a/examples/surrogate_dublin_core.xml +++ b/examples/surrogate_dublin_core.xml @@ -18,11 +18,11 @@ xmlns:dc="http://purl.org/dc/elements/1.1/"> <record> - <dc:title><![CDATA[Alan Smithee]]></dc:title> - <dc:identifier>http://de.wikipedia.org/wiki/Alan_Smithee</dc:identifier> - <dc:description><![CDATA[Der als Filmregisseur oft genannte '''Alan Smithee''' ist ein Anagramm von „The Alias Men“.]]></dc:description> - <dc:language>de</dc:language> - <dc:date>2009-03-02T11:12:36Z</dc:date> <!-- date is in ISO 8601 --> + <dc:Title><![CDATA[Alan Smithee]]></dc:Title> + <dc:Identifier>http://de.wikipedia.org/wiki/Alan_Smithee</dc:Identifier> + <dc:Description><![CDATA[Der als Filmregisseur oft genannte '''Alan Smithee''' ist ein Anagramm von „The Alias Men“.]]></dc:Description> + <dc:Language>de</dc:Language> + <dc:Date>2009-03-02T11:12:36Z</dc:Date> <!-- date is in ISO 8601 --> </record> </surrogates> diff --git a/source/de/anomic/crawler/Surrogate.java b/source/de/anomic/crawler/Surrogate.java index c4653aa39..173083217 100644 --- a/source/de/anomic/crawler/Surrogate.java +++ b/source/de/anomic/crawler/Surrogate.java @@ -63,9 +63,8 @@ public class Surrogate extends HashMap<String, String> { */
public Date date() {
- String d = this.get("dateISO8601");
- if (d == null) d = this.get("docdatetime");
- if (d == null) d = this.get("dc:date");
+ String d = this.get("docdatetime");
+ if (d == null) d = this.get("dc:Date");
if (d == null) return null;
try {
return DateFormatter.parseISO8601(d);
@@ -76,7 +75,7 @@ public class Surrogate extends HashMap<String, String> { }
public yacyURL url() {
String u = this.get("url");
- if (u == null) u = this.get("dc:identifier");
+ if (u == null) u = this.get("dc:Identifier");
if (u == null) return null;
try {
return new yacyURL(u, null);
@@ -87,26 +86,26 @@ public class Surrogate extends HashMap<String, String> { }
public String language() {
String l = this.get("language");
- if (l == null) l = this.get("dc:language");
+ if (l == null) l = this.get("dc:Language");
if (l == null) return "en"; else return l;
}
public String title() {
String t = this.get("title");
- if (t == null) t = this.get("dc:title");
+ if (t == null) t = this.get("dc:Title");
t = stripCDATA(t);
if (t == null) return "";
return t;
}
public String body() {
String t = this.get("body");
- if (t == null) t = this.get("dc:description");
+ if (t == null) t = this.get("dc:Description");
t = stripCDATA(t);
if (t == null) return "";
return t;
}
public String[] categories() {
String t = this.get("categories");
- if (t == null) this.get("dc:subject");
+ if (t == null) this.get("dc:Subject");
t = stripCDATA(t);
if (t == null) return new String[]{};
return t.split(";");
|
