changeset 25:52dff477e45f

on the way to a new ontology...
author casties
date Wed, 25 Apr 2012 18:02:44 +0200
parents d9809412b67f
children 235b91ba8dff
files src/main/java/de/mpiwg/itgroup/annotationManager/Constants/NS.java src/main/java/de/mpiwg/itgroup/annotationManager/RDFHandling/Convert.java
diffstat 2 files changed, 20 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/annotationManager/Constants/NS.java	Tue Apr 24 19:45:24 2012 +0200
+++ b/src/main/java/de/mpiwg/itgroup/annotationManager/Constants/NS.java	Wed Apr 25 18:02:44 2012 +0200
@@ -1,10 +1,11 @@
 package de.mpiwg.itgroup.annotationManager.Constants;
 
 public class NS {
-	public static final String MPIWG_PERSONS = "http://www.mpiwg-berlin.mpg.de/en/staff/members/";
-	public static String ANNOTATION_TYPE="http://www.w3.org/2000/10/annotationType#";
-	public static String ANNOTATION_NS="http://www.w3.org/2000/10/annotation-ns#";
-	public static String RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-	public static String MPIWG_annot="http://ontologies.mpiwg-berlin.mpg.de/annotations/";
+	public static final String MPIWG_PERSONS = "http://entities.mpiwg-berlin.mpg.de/persons/";
+	//public static String ANNOTATION_TYPE="http://www.w3.org/2000/10/annotationType#";
+	public static final String ANNOTATION_NS="http://www.openannotation.org/ns/";
+    public static final String DCTERMS_NS="http://www.purl.org/dc/terms/";
+	public static final String RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+	public static final String MPIWG_annot="http://entities.mpiwg-berlin.mpg.de/annotations/";
 		
 }
--- a/src/main/java/de/mpiwg/itgroup/annotationManager/RDFHandling/Convert.java	Tue Apr 24 19:45:24 2012 +0200
+++ b/src/main/java/de/mpiwg/itgroup/annotationManager/RDFHandling/Convert.java	Wed Apr 25 18:02:44 2012 +0200
@@ -29,7 +29,7 @@
 public class Convert {
     private String context = "file:///annotations";
     private static Logger logger = Logger.getRootLogger();
-    private String urlBase = "http://ontologies.mpiwg-berlin.mpg.de/annotations/"; // TODO should go into config
+    private String urlBase = "http://entities.mpiwg-berlin.mpg.de/annotations/"; // TODO should go into config
 
     public Convert(String context) {
         this.context = context;
@@ -66,25 +66,23 @@
         if (annotationUrl == null) {
             annotationUrl = createRessourceURL("annot:");
         }
-        
+        // type
+        // TODO: where to get types?
+        retQuad.add(new LiteralQuadruple(annotationUrl, NS.RDF + "type", annot.type, context));
+
+        // author
+        if (annot.creator.startsWith("http")) {
+            retQuad.add(new Quadruple(annotationUrl, NS.DCTERMS_NS + "creator", annot.creator, context));
+        } else {
+            // TODO: this should not happen
+            retQuad.add(new LiteralQuadruple(annotationUrl, NS.DCTERMS_NS + "creator", annot.creator, context));
+        }
+        // creation time
         if (annot.time == null) {
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
             annot.time = format.format(Calendar.getInstance().getTime());
         }
-
-        // TODO: check type
-        retQuad.add(new Quadruple(annotationUrl, NS.RDF + "type", NS.ANNOTATION_TYPE + annot.type, context));
-
-        // add author
-
-        if (annot.creator.startsWith("http")) {
-            retQuad.add(new Quadruple(annotationUrl, NS.ANNOTATION_NS + "author", annot.creator, context));
-        } else {
-            retQuad.add(new LiteralQuadruple(annotationUrl, NS.ANNOTATION_NS + "author", annot.creator, context));
-        }
-
-        // creation time
-        retQuad.add(new LiteralQuadruple(annotationUrl, NS.ANNOTATION_NS + "created", annot.time, context));
+        retQuad.add(new LiteralQuadruple(annotationUrl, NS.DCTERMS_NS + "created", annot.time, context));
 
         String[] xpointerSplitted = annot.xpointer.split("#");