Rob,
The fix looks exactly right but when I tried it I didn't get an prefixes.
Putting a breakpoint in JsonLDReader, I don't see the dataset (from
jsonld-java) having any namespaces set (the entrySet exists and is empty).
The @context is making the URIs come out right, but nothing in the given
com.github.jsonldjava.core.RDFDataset object. (using v0.4 of jsonld-java).
Did you have a working example?
Andy
public static void main(String... argv) throws Exception {
// From TR/json-ld spec, example 19.
String x = StrUtils.strjoinNL
("{ \"@context\":"
," { \"foaf\": \"http://xmlns.com/foaf/0.1/\" } ,"
," \"@type\": \"foaf:Person\" ,"
," \"foaf:name\": \"Rob\""
,"}"
) ;
System.out.println(x) ;
Model m = ModelFactory.createDefaultModel() ;
RDFDataMgr.read(m, new StringReader(x), null, Lang.JSONLD) ;
System.out.println("Prefix map:"+ m.getNsPrefixMap()) ;
System.out.println() ;
RDFDataMgr.write(System.out, m, Lang.TTL) ;
}