hi

I am trying to read a json-ld file into a Model so I can use IsoMatcher to
compare it with another Model.

When I try the simple approach:

   Model mj = RDFDataMgr.loadModel([json-ld filename]);

I get the error LOADING_REMOTE_CONTEXT_FAILED returned. I don't know why;
the file works in the json-ld playground. The source is actually
http://build.fhir.org/account-example.jsonld. Unfortunately, jsonld-java
suppresses the original exception.

But irrespective of that, I need to override the @context value and specify
my own local context instead (I'm actually running the build that generates
the content for build.fhir.org). I can't find out how to override the
context. At
http://stackoverflow.com/questions/41494678/how-can-i-override-the-context-when-loading-json-ld-in-jena
, it was suggested that I use read(Model model, String uri, Context context)
<https://jena.apache.org/documentation/javadoc/arq/org/apache/jena/riot/RDFDataMgr.html#read-org.apache.jena.rdf.model.Model-java.lang.String-org.apache.jena.sparql.util.Context->,
but I've drawn a blank trying to find information about how to use the
Context to do this.

Alternatively, I could use the loading method documented here:
https://github.com/jsonld-java/jsonld-java#code-example - but I have no
idea how to get to a Jena graph from there (and I haven't figured out how
make the custom resolution work in my Eclipse context either)

How can I get to a Jena graph using a context defined in code somewhere?
Grahame


-- 
-----
http://www.healthintersections.com.au / [email protected]
/ +61 411 867 065

Reply via email to