Author: ogrisel
Date: Fri Sep 30 15:28:23 2011
New Revision: 1177698
URL: http://svn.apache.org/viewvc?rev=1177698&view=rev
Log:
STANBOL-334: fix @type are always UriRef hence should use getUnicodeString for
serialization
Modified:
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProvider.java
incubator/stanbol/trunk/commons/web/base/src/test/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProviderTest.java
Modified:
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProvider.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProvider.java?rev=1177698&r1=1177697&r2=1177698&view=diff
==============================================================================
---
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProvider.java
(original)
+++
incubator/stanbol/trunk/commons/web/base/src/main/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProvider.java
Fri Sep 30 15:28:23 2011
@@ -101,7 +101,7 @@ public class JsonLdSerializerProvider im
if (logger.isDebugEnabled()) {
logger.debug("serialize() adding rdf:type: \"a\":" +
currentTriple.getObject());
}
- resource.addType(currentTriple.getObject().toString());
+ resource.addType(((UriRef)
currentTriple.getObject()).getUnicodeString());
} else {
if (logger.isDebugEnabled()) {
logger.debug("serializer() adding predicate " +
currentTriple.getPredicate().toString() + " with object " +
currentTriple.getObject().toString());
Modified:
incubator/stanbol/trunk/commons/web/base/src/test/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProviderTest.java
URL:
http://svn.apache.org/viewvc/incubator/stanbol/trunk/commons/web/base/src/test/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProviderTest.java?rev=1177698&r1=1177697&r2=1177698&view=diff
==============================================================================
---
incubator/stanbol/trunk/commons/web/base/src/test/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProviderTest.java
(original)
+++
incubator/stanbol/trunk/commons/web/base/src/test/java/org/apache/stanbol/commons/web/base/writers/JsonLdSerializerProviderTest.java
Fri Sep 30 15:28:23 2011
@@ -102,7 +102,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setUseTypeCoercion(false);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected =
"{\"@context\":{\"dc\":\"http://purl.org/dc/terms/\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xsd\":\"http://www.w3.org/2001/XMLSchema#\"},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"<enhancer:Enhancement>\",\"<enhancer:TextAnnotation>\"],\"dc:created\":{\"@literal\":\""
+ this.expectedW3CFormattedDate +
"\",\"@datatype\":\"xsd:dateTime\"},\"dc:creator\":{\"@literal\":\"urn:iks-project:enhancer:test:dummyEngine\",\"@datatype\":\"@iri\"},\"dc:type\":{\"@literal\":\"http://dbpedia.org/ontology/Person\",\"@datatype\":\"@iri\"},\"enhancer:end\":{\"@literal\":\"20\",\"@datatype\":\"xsd:int\"},\"enhancer:selected-text\":{\"@literal\":\"Patrick
Marshall\",\"@datatype\":\"xsd:string\"},\"enhancer:selection-context\":{\"@literal\":\"Dr.
Patrick Marshall (1869 - November 1950) was a geologist who lived in New
Zealand and worked at the University of
Otago.\",\"@datatype\":\"xsd:string\"},\"enhancer:start\":
{\"@literal\":\"4\",\"@datatype\":\"xsd:int\"}}";
+ String expected =
"{\"@context\":{\"dc\":\"http://purl.org/dc/terms/\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xsd\":\"http://www.w3.org/2001/XMLSchema#\"},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"enhancer:Enhancement\",\"enhancer:TextAnnotation\"],\"dc:created\":{\"@literal\":\""
+ this.expectedW3CFormattedDate +
"\",\"@datatype\":\"xsd:dateTime\"},\"dc:creator\":{\"@literal\":\"urn:iks-project:enhancer:test:dummyEngine\",\"@datatype\":\"@iri\"},\"dc:type\":{\"@literal\":\"http://dbpedia.org/ontology/Person\",\"@datatype\":\"@iri\"},\"enhancer:end\":{\"@literal\":\"20\",\"@datatype\":\"xsd:int\"},\"enhancer:selected-text\":{\"@literal\":\"Patrick
Marshall\",\"@datatype\":\"xsd:string\"},\"enhancer:selection-context\":{\"@literal\":\"Dr.
Patrick Marshall (1869 - November 1950) was a geologist who lived in New
Zealand and worked at the University of
Otago.\",\"@datatype\":\"xsd:string\"},\"enhancer:start\":{\"@
literal\":\"4\",\"@datatype\":\"xsd:int\"}}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}
@@ -119,7 +119,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setIndentation(0);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected =
"{\"@context\":{\"dbp-ont\":\"http://dbpedia.org/ontology/\",\"dc\":\"http://purl.org/dc/terms/\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xsd\":\"http://www.w3.org/2001/XMLSchema#\",\"@coerce\":{\"@iri\":[\"dc:creator\",\"dc:type\"],\"xsd:dateTime\":\"dc:created\",\"xsd:int\":[\"enhancer:end\",\"enhancer:start\"],\"xsd:string\":[\"enhancer:selected-text\",\"enhancer:selection-context\"]}},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"<enhancer:Enhancement>\",\"<enhancer:TextAnnotation>\"],\"dc:created\":\""+this.expectedW3CFormattedDate+"\",\"dc:creator\":\"urn:iks-project:enhancer:test:dummyEngine\",\"dc:type\":\"dbp-ont:Person\",\"enhancer:end\":20,\"enhancer:selected-text\":\"Patrick
Marshall\",\"enhancer:selection-context\":\"Dr. Patrick Marshall (1869 -
November 1950) was a geologist who lived in New Zealand and worked at the
University of Otago.\",\"enhancer:start\":4}";
+ String expected =
"{\"@context\":{\"dbp-ont\":\"http://dbpedia.org/ontology/\",\"dc\":\"http://purl.org/dc/terms/\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xsd\":\"http://www.w3.org/2001/XMLSchema#\",\"@coerce\":{\"@iri\":[\"dc:creator\",\"dc:type\"],\"xsd:dateTime\":\"dc:created\",\"xsd:int\":[\"enhancer:end\",\"enhancer:start\"],\"xsd:string\":[\"enhancer:selected-text\",\"enhancer:selection-context\"]}},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"enhancer:Enhancement\",\"enhancer:TextAnnotation\"],\"dc:created\":\""+this.expectedW3CFormattedDate+"\",\"dc:creator\":\"urn:iks-project:enhancer:test:dummyEngine\",\"dc:type\":\"dbp-ont:Person\",\"enhancer:end\":20,\"enhancer:selected-text\":\"Patrick
Marshall\",\"enhancer:selection-context\":\"Dr. Patrick Marshall (1869 -
November 1950) was a geologist who lived in New Zealand and worked at the
University of Otago.\",\"enhancer:start\":4}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}
@@ -135,7 +135,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setUseTypeCoercion(false);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected = "{\n \"@context\": {\n \"dc\":
\"http://purl.org/dc/terms/\",\n \"enhancer\":
\"http://fise.iks-project.eu/ontology/\",\n \"xsd\":
\"http://www.w3.org/2001/XMLSchema#\"\n },\n \"@subject\":
\"urn:iks-project:enhancer:test:text-annotation:Person\",\n \"@type\": [\n
\"<enhancer:Enhancement>\",\n \"<enhancer:TextAnnotation>\"\n ],\n
\"dc:created\": {\n \"@literal\": \""+this.expectedW3CFormattedDate+"\",\n
\"@datatype\": \"xsd:dateTime\"\n },\n \"dc:creator\": {\n \"@literal\":
\"urn:iks-project:enhancer:test:dummyEngine\",\n \"@datatype\": \"@iri\"\n
},\n \"dc:type\": {\n \"@literal\":
\"http://dbpedia.org/ontology/Person\",\n \"@datatype\": \"@iri\"\n },\n
\"enhancer:end\": {\n \"@literal\": \"20\",\n \"@datatype\":
\"xsd:int\"\n },\n \"enhancer:selected-text\": {\n \"@literal\": \"Patrick
Marshall\",\n \"@datatype\": \"xsd:string\"\n },\n
\"enhancer:selection-context\": {\n \"@literal\"
: \"Dr. Patrick Marshall (1869 - November 1950) was a geologist who lived in
New Zealand and worked at the University of Otago.\",\n \"@datatype\":
\"xsd:string\"\n },\n \"enhancer:start\": {\n \"@literal\": \"4\",\n
\"@datatype\": \"xsd:int\"\n }\n}";
+ String expected = "{\n \"@context\": {\n \"dc\":
\"http://purl.org/dc/terms/\",\n \"enhancer\":
\"http://fise.iks-project.eu/ontology/\",\n \"xsd\":
\"http://www.w3.org/2001/XMLSchema#\"\n },\n \"@subject\":
\"urn:iks-project:enhancer:test:text-annotation:Person\",\n \"@type\": [\n
\"enhancer:Enhancement\",\n \"enhancer:TextAnnotation\"\n ],\n
\"dc:created\": {\n \"@literal\": \""+this.expectedW3CFormattedDate+"\",\n
\"@datatype\": \"xsd:dateTime\"\n },\n \"dc:creator\": {\n \"@literal\":
\"urn:iks-project:enhancer:test:dummyEngine\",\n \"@datatype\": \"@iri\"\n
},\n \"dc:type\": {\n \"@literal\":
\"http://dbpedia.org/ontology/Person\",\n \"@datatype\": \"@iri\"\n },\n
\"enhancer:end\": {\n \"@literal\": \"20\",\n \"@datatype\":
\"xsd:int\"\n },\n \"enhancer:selected-text\": {\n \"@literal\": \"Patrick
Marshall\",\n \"@datatype\": \"xsd:string\"\n },\n
\"enhancer:selection-context\": {\n \"@literal\": \"
Dr. Patrick Marshall (1869 - November 1950) was a geologist who lived in New
Zealand and worked at the University of Otago.\",\n \"@datatype\":
\"xsd:string\"\n },\n \"enhancer:start\": {\n \"@literal\": \"4\",\n
\"@datatype\": \"xsd:int\"\n }\n}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}
@@ -158,7 +158,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setNamespacePrefixMap(nsMap);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected =
"{\"@context\":{\"dcterms\":\"http://purl.org/dc/terms\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xmlns\":\"http://www.w3.org/2001/XMLSchema#\"},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"<enhancer:Enhancement>\",\"<enhancer:TextAnnotation>\"],\"dcterms:/created\":{\"@literal\":\""+this.expectedW3CFormattedDate+"\",\"@datatype\":\"xmlns:dateTime\"},\"dcterms:/creator\":{\"@literal\":\"urn:iks-project:enhancer:test:dummyEngine\",\"@datatype\":\"@iri\"},\"dcterms:/type\":{\"@literal\":\"http://dbpedia.org/ontology/Person\",\"@datatype\":\"@iri\"},\"enhancer:end\":{\"@literal\":\"20\",\"@datatype\":\"xmlns:int\"},\"enhancer:selected-text\":{\"@literal\":\"Patrick
Marshall\",\"@datatype\":\"xmlns:string\"},\"enhancer:selection-context\":{\"@literal\":\"Dr.
Patrick Marshall (1869 - November 1950) was a geologist who lived in New
Zealand and worked at the University of Otago.\",\"@datatype\":\"xmlns:s
tring\"},\"enhancer:start\":{\"@literal\":\"4\",\"@datatype\":\"xmlns:int\"}}";
+ String expected =
"{\"@context\":{\"dcterms\":\"http://purl.org/dc/terms\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xmlns\":\"http://www.w3.org/2001/XMLSchema#\"},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"enhancer:Enhancement\",\"enhancer:TextAnnotation\"],\"dcterms:/created\":{\"@literal\":\""+this.expectedW3CFormattedDate+"\",\"@datatype\":\"xmlns:dateTime\"},\"dcterms:/creator\":{\"@literal\":\"urn:iks-project:enhancer:test:dummyEngine\",\"@datatype\":\"@iri\"},\"dcterms:/type\":{\"@literal\":\"http://dbpedia.org/ontology/Person\",\"@datatype\":\"@iri\"},\"enhancer:end\":{\"@literal\":\"20\",\"@datatype\":\"xmlns:int\"},\"enhancer:selected-text\":{\"@literal\":\"Patrick
Marshall\",\"@datatype\":\"xmlns:string\"},\"enhancer:selection-context\":{\"@literal\":\"Dr.
Patrick Marshall (1869 - November 1950) was a geologist who lived in New
Zealand and worked at the University of Otago.\",\"@datatype\":\"xmlns:strin
g\"},\"enhancer:start\":{\"@literal\":\"4\",\"@datatype\":\"xmlns:int\"}}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}
@@ -181,7 +181,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setNamespacePrefixMap(nsMap);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected =
"{\"@context\":{\"dbpedia\":\"http://dbpedia.org/ontology/\",\"dcterms\":\"http://purl.org/dc/terms/\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xmlns\":\"http://www.w3.org/2001/XMLSchema#\",\"@coerce\":{\"@iri\":[\"dcterms:creator\",\"dcterms:type\"],\"xmlns:dateTime\":\"dcterms:created\",\"xmlns:int\":[\"enhancer:end\",\"enhancer:start\"],\"xmlns:string\":[\"enhancer:selected-text\",\"enhancer:selection-context\"]}},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"<enhancer:Enhancement>\",\"<enhancer:TextAnnotation>\"],\"dcterms:created\":\""+this.expectedW3CFormattedDate+"\",\"dcterms:creator\":\"urn:iks-project:enhancer:test:dummyEngine\",\"dcterms:type\":\"dbpedia:Person\",\"enhancer:end\":20,\"enhancer:selected-text\":\"Patrick
Marshall\",\"enhancer:selection-context\":\"Dr. Patrick Marshall (1869 -
November 1950) was a geologist who lived in New Zealand and worked at the
University of Otago.\",\
"enhancer:start\":4}";
+ String expected =
"{\"@context\":{\"dbpedia\":\"http://dbpedia.org/ontology/\",\"dcterms\":\"http://purl.org/dc/terms/\",\"enhancer\":\"http://fise.iks-project.eu/ontology/\",\"xmlns\":\"http://www.w3.org/2001/XMLSchema#\",\"@coerce\":{\"@iri\":[\"dcterms:creator\",\"dcterms:type\"],\"xmlns:dateTime\":\"dcterms:created\",\"xmlns:int\":[\"enhancer:end\",\"enhancer:start\"],\"xmlns:string\":[\"enhancer:selected-text\",\"enhancer:selection-context\"]}},\"@subject\":\"urn:iks-project:enhancer:test:text-annotation:Person\",\"@type\":[\"enhancer:Enhancement\",\"enhancer:TextAnnotation\"],\"dcterms:created\":\""+this.expectedW3CFormattedDate+"\",\"dcterms:creator\":\"urn:iks-project:enhancer:test:dummyEngine\",\"dcterms:type\":\"dbpedia:Person\",\"enhancer:end\":20,\"enhancer:selected-text\":\"Patrick
Marshall\",\"enhancer:selection-context\":\"Dr. Patrick Marshall (1869 -
November 1950) was a geologist who lived in New Zealand and worked at the
University of Otago.\",\"enh
ancer:start\":4}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}
@@ -204,7 +204,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setNamespacePrefixMap(nsMap);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected = "{\n \"@context\": {\n \"dcterms\":
\"http://purl.org/dc/terms/\",\n \"enhancer\":
\"http://fise.iks-project.eu/ontology/\",\n \"xmlns\":
\"http://www.w3.org/2001/XMLSchema#\"\n },\n \"@subject\":
\"urn:iks-project:enhancer:test:text-annotation:Person\",\n \"@type\": [\n
\"<enhancer:Enhancement>\",\n \"<enhancer:TextAnnotation>\"\n
],\n \"dcterms:created\": {\n \"@literal\":
\""+this.expectedW3CFormattedDate+"\",\n \"@datatype\":
\"xmlns:dateTime\"\n },\n \"dcterms:creator\": {\n \"@literal\":
\"urn:iks-project:enhancer:test:dummyEngine\",\n \"@datatype\":
\"@iri\"\n },\n \"dcterms:type\": {\n \"@literal\":
\"http://dbpedia.org/ontology/Person\",\n \"@datatype\": \"@iri\"\n
},\n \"enhancer:end\": {\n \"@literal\": \"20\",\n
\"@datatype\": \"xmlns:int\"\n },\n \"enhancer:selected-text\": {\n
\"@literal\": \"Patri
ck Marshall\",\n \"@datatype\": \"xmlns:string\"\n },\n
\"enhancer:selection-context\": {\n \"@literal\": \"Dr. Patrick Marshall
(1869 - November 1950) was a geologist who lived in New Zealand and worked at
the University of Otago.\",\n \"@datatype\": \"xmlns:string\"\n },\n
\"enhancer:start\": {\n \"@literal\": \"4\",\n \"@datatype\":
\"xmlns:int\"\n }\n}";
+ String expected = "{\n \"@context\": {\n \"dcterms\":
\"http://purl.org/dc/terms/\",\n \"enhancer\":
\"http://fise.iks-project.eu/ontology/\",\n \"xmlns\":
\"http://www.w3.org/2001/XMLSchema#\"\n },\n \"@subject\":
\"urn:iks-project:enhancer:test:text-annotation:Person\",\n \"@type\": [\n
\"enhancer:Enhancement\",\n \"enhancer:TextAnnotation\"\n ],\n
\"dcterms:created\": {\n \"@literal\":
\""+this.expectedW3CFormattedDate+"\",\n \"@datatype\":
\"xmlns:dateTime\"\n },\n \"dcterms:creator\": {\n \"@literal\":
\"urn:iks-project:enhancer:test:dummyEngine\",\n \"@datatype\":
\"@iri\"\n },\n \"dcterms:type\": {\n \"@literal\":
\"http://dbpedia.org/ontology/Person\",\n \"@datatype\": \"@iri\"\n
},\n \"enhancer:end\": {\n \"@literal\": \"20\",\n
\"@datatype\": \"xmlns:int\"\n },\n \"enhancer:selected-text\": {\n
\"@literal\": \"Patrick M
arshall\",\n \"@datatype\": \"xmlns:string\"\n },\n
\"enhancer:selection-context\": {\n \"@literal\": \"Dr. Patrick Marshall
(1869 - November 1950) was a geologist who lived in New Zealand and worked at
the University of Otago.\",\n \"@datatype\": \"xmlns:string\"\n },\n
\"enhancer:start\": {\n \"@literal\": \"4\",\n \"@datatype\":
\"xmlns:int\"\n }\n}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}
@@ -227,7 +227,7 @@ public class JsonLdSerializerProviderTes
jsonldProvider.setUseTypeCoercion(true);
jsonldProvider.serialize(serializedGraph, ci.getMetadata(),
formatIdentifier);
- String expected = "{\n \"@context\": {\n \"dbpedia\":
\"http://dbpedia.org/ontology/\",\n \"dcterms\":
\"http://purl.org/dc/terms/\",\n \"enhancer\":
\"http://fise.iks-project.eu/ontology/\",\n \"xmlns\":
\"http://www.w3.org/2001/XMLSchema#\",\n \"@coerce\": {\n
\"@iri\": [\n \"dcterms:creator\",\n
\"dcterms:type\"\n ],\n \"xmlns:dateTime\":
\"dcterms:created\",\n \"xmlns:int\": [\n
\"enhancer:end\",\n \"enhancer:start\"\n ],\n
\"xmlns:string\": [\n \"enhancer:selected-text\",\n
\"enhancer:selection-context\"\n ]\n }\n },\n
\"@subject\": \"urn:iks-project:enhancer:test:text-annotation:Person\",\n
\"@type\": [\n \"<enhancer:Enhancement>\",\n
\"<enhancer:TextAnnotation>\"\n ],\n \"dcterms:created\":
\""+this.expectedW3CFormattedDate
+"\",\n \"dcterms:creator\":
\"urn:iks-project:enhancer:test:dummyEngine\",\n \"dcterms:type\":
\"dbpedia:Person\",\n \"enhancer:end\": 20,\n \"enhancer:selected-text\":
\"Patrick Marshall\",\n \"enhancer:selection-context\": \"Dr. Patrick
Marshall (1869 - November 1950) was a geologist who lived in New Zealand and
worked at the University of Otago.\",\n \"enhancer:start\": 4\n}";
+ String expected = "{\n \"@context\": {\n \"dbpedia\":
\"http://dbpedia.org/ontology/\",\n \"dcterms\":
\"http://purl.org/dc/terms/\",\n \"enhancer\":
\"http://fise.iks-project.eu/ontology/\",\n \"xmlns\":
\"http://www.w3.org/2001/XMLSchema#\",\n \"@coerce\": {\n
\"@iri\": [\n \"dcterms:creator\",\n
\"dcterms:type\"\n ],\n \"xmlns:dateTime\":
\"dcterms:created\",\n \"xmlns:int\": [\n
\"enhancer:end\",\n \"enhancer:start\"\n ],\n
\"xmlns:string\": [\n \"enhancer:selected-text\",\n
\"enhancer:selection-context\"\n ]\n }\n },\n
\"@subject\": \"urn:iks-project:enhancer:test:text-annotation:Person\",\n
\"@type\": [\n \"enhancer:Enhancement\",\n
\"enhancer:TextAnnotation\"\n ],\n \"dcterms:created\":
\""+this.expectedW3CFormattedDate+"\"
,\n \"dcterms:creator\": \"urn:iks-project:enhancer:test:dummyEngine\",\n
\"dcterms:type\": \"dbpedia:Person\",\n \"enhancer:end\": 20,\n
\"enhancer:selected-text\": \"Patrick Marshall\",\n
\"enhancer:selection-context\": \"Dr. Patrick Marshall (1869 - November 1950)
was a geologist who lived in New Zealand and worked at the University of
Otago.\",\n \"enhancer:start\": 4\n}";
String result = serializedGraph.toString();
Assert.assertEquals(expected, result);
}