I figured out the problem, it was two-fold:

1 - We weren't passing the options correctly to the JsonLDReader so
namespaces weren't extracted
2 - JsonLDWriter passed the default namespaces in such a way that it
wouldn't round trip

Should now be fixed in trunk and the tests are updated to include checking
namespace round tripping

Rob

On 22/05/2014 14:06, "Rob Vesse" <[email protected]> wrote:

>Huh that is strange, certainly when I applied the equivalent fix to their
>code on GitHub I did get prefixes back out
>
>I will take a look at what's going on
>
>
>Rob
>
>On 22/05/2014 13:29, "Andy Seaborne" <[email protected]> wrote:
>
>>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) ;
>>}
>>
>
>
>
>




Reply via email to