comparison src/main/java/de/mpiwg/itgroup/annotationManager/RDFHandling/Convert.java @ 33:e5f5848892a2

new annotation model basically works.
author casties
date Thu, 31 May 2012 19:08:48 +0200
parents b37487b756ac
children
comparison
equal deleted inserted replaced
32:40846c0b344d 33:e5f5848892a2
20 * 20 *
21 * Klasse zum Konvertieren von Annotationen zum mpiwg RDF-Format: http://ontologies.mpiwg-berlin.mpg.de/annotations/ 21 * Klasse zum Konvertieren von Annotationen zum mpiwg RDF-Format: http://ontologies.mpiwg-berlin.mpg.de/annotations/
22 */ 22 */
23 23
24 public class Convert { 24 public class Convert {
25 private String context = "file:///annotations"; 25 private String context = NS.MPIWG_ANNOT_CTX;
26 private static Logger logger = Logger.getRootLogger(); 26 private static Logger logger = Logger.getRootLogger();
27 private String urlBase = "http://entities.mpiwg-berlin.mpg.de/annotations/"; // TODO should go into config 27 private String urlBase = "http://entities.mpiwg-berlin.mpg.de/annotations/"; // TODO should go into config
28 28
29 public Convert(String context) { 29 public Convert(String context) {
30 this.context = context; 30 this.context = context;
87 * target without page number (full URL) 87 * target without page number (full URL)
88 */ 88 */
89 retQuad.add(new Quadruple(annot.xpointer, NS.RDF_NS + "type", NS.OAC_NS + "Target", context)); 89 retQuad.add(new Quadruple(annot.xpointer, NS.RDF_NS + "type", NS.OAC_NS + "Target", context));
90 // is target of annotation 90 // is target of annotation
91 retQuad.add(new Quadruple(annotationUrl, NS.OAC_NS + "hasTarget", annot.xpointer, context)); 91 retQuad.add(new Quadruple(annotationUrl, NS.OAC_NS + "hasTarget", annot.xpointer, context));
92 if (annot.xpointer.contains("#")) {
93 // isPartOf base resource (without xpointer/fragment)
94 String baseUri = annot.xpointer.substring(0, annot.xpointer.indexOf("#"));
95 retQuad.add(new Quadruple(annot.xpointer, NS.DCTERMS_NS + "isPartOf", baseUri, context));
96 }
92 } else { 97 } else {
93 /* 98 /*
94 * ConstrainedTarget with page number 99 * ConstrainedTarget with page number
95 */ 100 */
96 String ctUrl = createRessourceURL("annotCT:"); 101 String ctUrl = createRessourceURL("annotCT:");