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

ASF subversion and git services commented on JENA-908:
------------------------------------------------------

Commit 8ddef8a52f1fc6f560669aee113e78d1020f17ee in jena's branch 
refs/heads/master from [~rvesse]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=8ddef8a ]

Add test cases that demonstrate Turtle output bug (JENA-908)

The failing test cases are currently disabled until JENA-908 is resolved


> Turtle output can be empty when graph contains cyclic blank node references
> ---------------------------------------------------------------------------
>
>                 Key: JENA-908
>                 URL: https://issues.apache.org/jira/browse/JENA-908
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: RIOT
>    Affects Versions: Jena 2.13.0
>            Reporter: Rob Vesse
>            Assignee: Andy Seaborne
>            Priority: Critical
>              Labels: BNodes, BlankNodes, Turtle
>
> Discovered a bug in writing Turtle with the latest release, haven't checked 
> whether it applies to past versions of ARQ.
> Simple test case using test data from the DAWG tests:
> {noformat}
>     @Test
>     public void bnode_cycles() {
>         Model m = 
> RDFDataMgr.loadModel("testing/DAWG-Final/construct/data-ident.ttl");
>         Assert.assertTrue(m.size() > 0);
>         
>         ByteArrayOutputStream output = new ByteArrayOutputStream();
>         RDFDataMgr.write(output, m, Lang.TURTLE);
>         
>         ByteArrayInputStream input = new 
> ByteArrayInputStream(output.toByteArray());
>         System.out.println(new String(output.toByteArray(), 
> Charset.forName("utf-8")));
>         Model m2 = ModelFactory.createDefaultModel();
>         RDFDataMgr.read(m2, input, Lang.TURTLE);
>         Assert.assertTrue(m2.size() > 0);
>         
>         Assert.assertTrue(m.isIsomorphicWith(m2));
>     }
> {noformat}
> Debugging this I can see that the problem appears to lie in {{TurtleShell}} 
> which refuses to write any triples because each subject appears as the object 
> of some other triple.  This creates a cycle resulting in no data being output.
> {{TurtleShell}} needs to detect and arbitrarily break the cycles such that it 
> can output the data successfully.
> I'll commit this as a disabled test case in {{TestLangTurtle}} to make it 
> easy to start debugging.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to