The example in the README (Sesame, Jena) throws an exception for both implementation:
Sesame:
Exception in thread "main" java.lang.IllegalArgumentException: Not a valid (absolute) URI: my.rdf#/
at org.openrdf.model.impl.URIImpl.setURIString(URIImpl.java:79)
at org.openrdf.model.impl.URIImpl.<init>(URIImpl.java:68)
at org.eclipselabs.emftriple.sesame.map.Extensions.toURI(Extensions.java:37)
at org.eclipselabs.emftriple.sesame.map.Extensions.toURI(Extensions.java:32)
at org.eclipselabs.emftriple.sesame.map.Serializer.createTypeStatement(Serializer.java:72)
at org.eclipselabs.emftriple.sesame.map.Serializer.to(Serializer.java:45)
at org.eclipselabs.emftriple.sesame.map.Serializer$1.accept(Serializer.java:33)
at org.eclipselabs.emftriple.sesame.map.Serializer$1.accept(Serializer.java:1)
at java.lang.Iterable.forEach(Iterable.java:75)
at org.eclipselabs.emftriple.sesame.map.Serializer.to(Serializer.java:36)
at org.eclipselabs.emftriple.sesame.map.EObjectMapper.to(EObjectMapper.java:34)
at org.eclipselabs.emftriple.sesame.map.EObjectMapper.to(EObjectMapper.java:19)
at org.eclipselabs.emftriple.sesame.resource.RDFResource.doSave(RDFResource.java:58)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at org.eclipselabs.emftriples.examples.maven.EMFTripleExample.main(EMFTripleExample.java:27)
Jena:
Exception in thread "main" com.hp.hpl.jena.shared.BadURIException: Only well-formed absolute URIrefs can be included in RDF/XML output: <my.rdf#/> Code: 57/REQUIRED_COMPONENT_MISSING in SCHEME: A component that is required by the scheme is missing.
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.checkURI(BaseXMLWriter.java:820)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.relativize(BaseXMLWriter.java:797)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeResourceId(Basic.java:144)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeDescriptionHeader(Basic.java:92)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFStatements(Basic.java:84)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeRDFStatements(Basic.java:74)
at com.hp.hpl.jena.xmloutput.impl.Basic.writeBody(Basic.java:48)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.writeXMLBody(BaseXMLWriter.java:492)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:464)
at com.hp.hpl.jena.xmloutput.impl.BaseXMLWriter.write(BaseXMLWriter.java:450)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.write(ModelCom.java:347)
at org.eclipselabs.emftriple.jena.io.RDFWriter.writeXML(RDFWriter.java:47)
at org.eclipselabs.emftriple.jena.io.RDFWriter.write(RDFWriter.java:28)
at org.eclipselabs.emftriple.jena.resource.RDFResource.write(RDFResource.java:67)
at org.eclipselabs.emftriple.jena.resource.RDFResource.doSave(RDFResource.java:58)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:1430)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.save(ResourceImpl.java:999)
at org.eclipselabs.emftriples.examples.maven.sesame.EMFTripleExample.main(EMFTripleExample.java:26)
To fix this, I changed the my.rdf URI to a file URI file:///tmp/my.rdf:
final Resource r = resourceSet.createResource(URI.createURI("file:///tmp/my.rdf"));
The example in the README (Sesame, Jena) throws an exception for both implementation:
Sesame:
Jena:
To fix this, I changed the
my.rdf
URI to a file URIfile:///tmp/my.rdf
:This runs fine for both.
Sesame:
Jena:
The latter is very similar to the output suggested in the README, the main difference is (of course) the URI in the
rdf:about
attribute.Should this be fixed in the README or the implementation?