corrections in dublin core syntax

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@5823 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
orbiter 16 years ago
parent 44daec7936
commit 4e97a31009

@ -18,11 +18,11 @@
xmlns:dc="http://purl.org/dc/elements/1.1/"> xmlns:dc="http://purl.org/dc/elements/1.1/">
<record> <record>
<dc:title><![CDATA[Alan Smithee]]></dc:title> <dc:Title><![CDATA[Alan Smithee]]></dc:Title>
<dc:identifier>http://de.wikipedia.org/wiki/Alan_Smithee</dc:identifier> <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:Description><![CDATA[Der als Filmregisseur oft genannte '''Alan Smithee''' ist ein Anagramm von „The Alias Men“.]]></dc:Description>
<dc:language>de</dc:language> <dc:Language>de</dc:Language>
<dc:date>2009-03-02T11:12:36Z</dc:date> <!-- date is in ISO 8601 --> <dc:Date>2009-03-02T11:12:36Z</dc:Date> <!-- date is in ISO 8601 -->
</record> </record>
</surrogates> </surrogates>

@ -63,9 +63,8 @@ public class Surrogate extends HashMap<String, String> {
*/ */
public Date date() { public Date date() {
String d = this.get("dateISO8601"); String d = this.get("docdatetime");
if (d == null) d = this.get("docdatetime"); if (d == null) d = this.get("dc:Date");
if (d == null) d = this.get("dc:date");
if (d == null) return null; if (d == null) return null;
try { try {
return DateFormatter.parseISO8601(d); return DateFormatter.parseISO8601(d);
@ -76,7 +75,7 @@ public class Surrogate extends HashMap<String, String> {
} }
public yacyURL url() { public yacyURL url() {
String u = this.get("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; if (u == null) return null;
try { try {
return new yacyURL(u, null); return new yacyURL(u, null);
@ -87,26 +86,26 @@ public class Surrogate extends HashMap<String, String> {
} }
public String language() { public String language() {
String l = this.get("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; if (l == null) return "en"; else return l;
} }
public String title() { public String title() {
String t = this.get("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); t = stripCDATA(t);
if (t == null) return ""; if (t == null) return "";
return t; return t;
} }
public String body() { public String body() {
String t = this.get("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); t = stripCDATA(t);
if (t == null) return ""; if (t == null) return "";
return t; return t;
} }
public String[] categories() { public String[] categories() {
String t = this.get("categories"); String t = this.get("categories");
if (t == null) this.get("dc:subject"); if (t == null) this.get("dc:Subject");
t = stripCDATA(t); t = stripCDATA(t);
if (t == null) return new String[]{}; if (t == null) return new String[]{};
return t.split(";"); return t.split(";");

Loading…
Cancel
Save