You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2019/05/10 09:04:00 UTC

[jira] [Commented] (JENA-1710) Wrong turtle serialization of RDFList with itself inside

    [ https://issues.apache.org/jira/browse/JENA-1710?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16837058#comment-16837058 ] 

Andy Seaborne commented on JENA-1710:
-------------------------------------

[~szz] - thanks for the report and test case.

The indirect cycle is confusing the pretty printer. Directly including a list in itself is handled but the indirect, through owl:unionOf isn't handled. Because that is potentially an arbitrary chain of properties, it is difficult to see an immediate fix.

Using {{RDFData.write}} and formats {{RDFFormat.TURTLE_BLOCKS}} or {{RDFFormat.TURTLE_FLAT}} work - they don't do any list formatting.  

The other workaround, especially for OWL class definitions, is "don't do that!".

> Wrong turtle serialization of RDFList with itself inside
> --------------------------------------------------------
>
>                 Key: JENA-1710
>                 URL: https://issues.apache.org/jira/browse/JENA-1710
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Base, Jena, RIOT
>    Affects Versions: Jena 3.9.0, Jena 3.10.0, Jena 3.11.0
>         Environment: jena-arq-3.11.0, java8
>            Reporter: ssz
>            Priority: Minor
>
> Testcase:
> {quote}Model m = ModelFactory.createDefaultModel();
> Resource b0 = m.createResource();
>  Resource b1 = m.createResource();
> {color:#808080}// add 4 statements:{color}
> b0.addProperty(OWL.{color:#660e7a}unionOf{color}, b1).addProperty(RDF.{color:#660e7a}type{color}, OWL.{color:#660e7a}Class{color});
>  b1.addProperty(RDF.{color:#660e7a}first{color}, b0).addProperty(RDF.{color:#660e7a}rest{color}, RDF.{color:#660e7a}nil{color});
> m.write(System.{color:#660e7a}out{color}, {color:#008000}"ttl"{color});
> m.write(System.{color:#660e7a}out{color}, {color:#008000}"nt"{color});
> {quote}
> Output:
> {quote}_:b0    <[http://www.w3.org/1999/02/22-rdf-syntax-ns#first]>
>                  _:b1 ;
>          <[http://www.w3.org/1999/02/22-rdf-syntax-ns#rest]>
>                  () .
>  _:B40396d1bX2D68d6X2D40b4X2DbbcdX2Dbe185973bfc1 <[http://www.w3.org/1999/02/22-rdf-syntax-ns#rest]> <[http://www.w3.org/1999/02/22-rdf-syntax-ns#nil]> .
>  _:B40396d1bX2D68d6X2D40b4X2DbbcdX2Dbe185973bfc1 <[http://www.w3.org/1999/02/22-rdf-syntax-ns#first]> _:B4da6d814X2Ddb64X2D4ff1X2Da5d4X2D4f71d5718fd9 .
>  _:B4da6d814X2Ddb64X2D4ff1X2Da5d4X2D4f71d5718fd9 <[http://www.w3.org/1999/02/22-rdf-syntax-ns#type]> <[http://www.w3.org/2002/07/owl#Class]> .
>  _:B4da6d814X2Ddb64X2D4ff1X2Da5d4X2D4f71d5718fd9 <[http://www.w3.org/2002/07/owl#unionOf]> _:B40396d1bX2D68d6X2D40b4X2DbbcdX2Dbe185973bfc1 .
> {quote}
>  
> So in turtle there are only 2 triples, while expected 4.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)