Your RDF/XML document doesn't specify an xml:base
, but uses relative URIs:
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://www.someaddress2.com/ontology#"
xmlns:owl="http://www.w3.org/2002/07/owl#"
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" >
<!-- … -->
<rdf:Description rdf:nodeID="A1">
<!-- "tag/tag/…" is relative -->
<rdf:_1 rdf:resource="tag/tag/rs_tagapplication-guid-5CCC6F83F6DDEE9DC69390E3767DEA4BD8BD4DCD4E9F3570A67E8F7455785C51"/>
<rdf:type rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag"/>
</rdf:Description>
<!-- … -->
</rdf:RDF>
There's no xml:base
in the document, so the relative URIs are apparently being resolved against
the path of the file from which the model is being read. Either (i) use only absolute URIs in your document or (ii) explicitly specify a base in the document or (iii) use one of the read methods that take a base
argument, e.g., read(model,uri,base,hintLang).
Although you mention that you do:
String uri = BASE_URL + "resources/resourceid-1";
Resource rdfResource = model.createResource(uri, ocResource );
I expect that somewhere you left out the BASE_URL
prefix (and after all, you haven't shown us all your code) and did something like:
String uri = "resources/resourceid-1";
Resource rdfResource = model.createResource(uri, ocResource );