On 22/05/14 14:06, Rob Vesse 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

Jena's not passing in the options correctly (or even all!).

Fix going into svn ...



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