I'm converting from JSON-LD to Jena using the following:
Model model     = ModelFactory.createDefaultModel()
RDFParser.create.fromString(json).base("").lang(Lang.JSONLD).parse(StreamRDFLib.graph(model.getGraph))
 And having the following JSON-LD:
{
  "@id": "http://example.com/id";,
  "@type": "Person",
  "name": "a"
}
It will generate a model with the triple:
http://example.com/id @http://www.w3.org/1999/02/22-rdf-syntax-ns#type 
file:///some/path/Person

I want the model to fail, throw an exception when some field is supposed to be 
an @id but it isn't and not to make up an id from my file path (If I expose 
this to the outside world is a big security issue).

Is the way to go as described on this StackOverflow response: 
https://stackoverflow.com/questions/47763738/jena-relative-uri-base#answer-48178761

or is there a better way (note the response is from 2010)

Reply via email to