Chris Mungall created JENA-2099:
-----------------------------------

             Summary: Converting rdfstar to plain rdf formats do not work
                 Key: JENA-2099
                 URL: https://issues.apache.org/jira/browse/JENA-2099
             Project: Apache Jena
          Issue Type: Bug
          Components: RIOT
    Affects Versions: Jena 3.17.0
            Reporter: Chris Mungall


Given a file ex1.ttl

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

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:

 
{code:java}
$ 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)
{code}
 

similarly for export to rdfxml

When I convert to turtle, the syntax remains turtlestar:

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

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:

 
{code:java}
@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
 ] .
{code}
 

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

 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to