Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2099

Converting rdfstar to plain rdf formats do not work

    XMLWordPrintableJSON

Details

    • Question
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • Jena 3.17.0
    • None
    • RIOT
    • None

    Description

      Given a file ex1.ttl

       

      @prefix : <http://www.example.org/> .
      :employee38 :familyName "Smith" .
      << :employee38 :jobTitle "Assistant Designer" >> :accordingTo :employee22 .
      

       

      my expectation is that I should be able to use riot to serialize as plain rdf, ttl, ntriples, rdf-xml, and json-ld, with reification used (I cannot find a normative statement in the spec to support this but I hold it's a reasonably user expectation given what has been written about rdfstar by the authors of the spec).

      This doesn't work however:

       

      $ riot --out=jsonld ex1.ttl 
      org.apache.jena.riot.RiotException: Subject node is not a URI or a blank node
              at org.apache.jena.riot.writer.JenaRDF2JSONLD.parse(JenaRDF2JSONLD.java:64)
              at org.apache.jena.riot.writer.JsonLDWriter.toJsonLDJavaAPI(JsonLDWriter.java:200)
              at org.apache.jena.riot.writer.JsonLDWriter.serialize(JsonLDWriter.java:174)
              at org.apache.jena.riot.writer.JsonLDWriter.write(JsonLDWriter.java:135)
              at org.apache.jena.riot.writer.JsonLDWriter.write(JsonLDWriter.java:141)
              at org.apache.jena.riot.RDFWriter.write$(RDFWriter.java:208)
              at org.apache.jena.riot.RDFWriter.output(RDFWriter.java:166)
              at org.apache.jena.riot.RDFWriter.output(RDFWriter.java:113)
              at org.apache.jena.riot.RDFWriterBuilder.output(RDFWriterBuilder.java:204)
              at riotcmd.CmdLangParse.lambda$createAccumulateSink$0(CmdLangParse.java:348)
              at riotcmd.CmdLangParse.exec$(CmdLangParse.java:172)
              at riotcmd.CmdLangParse.exec(CmdLangParse.java:130)
              at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
              at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
              at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
              at riotcmd.riot.main(riot.java:29)
      

       

      similarly for export to rdfxml

      When I convert to turtle, the syntax remains turtlestar:

       

      $ riot --out=ttl ex1.ttl 
      @prefix :      <http://www.example.org/> .
      :employee38  :familyName  "Smith" .
      << :employee38 :jobTitle "Assistant Designer" >>
              :accordingTo  :employee22 .

       

      I'm not totally sure if this is what should happen. I'm not totally sure of what the different file format options are, and if there is a distinct "turtlestar" and "ntriplesstar" (as an aside, it would be useful to have more command line help on permissible values for input and output formats in riot).

      My expectation is that parsing should be lenient as should accept *star syntaxes, but allow fine-grained control in output as to whether plain rdf syntax or *star syntaxes are used (with expansion to reification happening in the latter), but I may be using riot incorrectly.

      FWIW, explicitly using reification doesn't syntactically convert to rdfstar, e.g. with ex1r.ttl:

       

      @prefix : <http://www.example.org/> .
      @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
      @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
      :employee38 :jobTitle "Assistant Designer" .
       [a rdf:Statement ;
       rdf:subject :employee38 ;
       rdf:predicate :jobTitle ;
       rdf:object "Assistant Designer" ;
       :accordingTo :employee22
       ] .
      

       

      I can't seem to convert this into rdfstar syntax using riot

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              cmungall Chris Mungall
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: