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 2021/07/14 08:29:00 UTC

[jira] [Closed] (JENA-2134) Model loads incorrectly from ttl file

     [ https://issues.apache.org/jira/browse/JENA-2134?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Seaborne closed JENA-2134.
-------------------------------
    Resolution: Information Provided

> Model loads incorrectly from ttl file
> -------------------------------------
>
>                 Key: JENA-2134
>                 URL: https://issues.apache.org/jira/browse/JENA-2134
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Jena
>    Affects Versions: Jena 4.1.0
>         Environment: Windows, WSL2, Maven, Java 14.0.2
>            Reporter: Rem Collier
>            Priority: Major
>         Attachments: example.ttl
>
>
> I downloaded knowledge from an RDF4J data store in triple format. I stored the content in a file called example.ttl.
> When I try to load the file, the composite resources do not get generated, resulting in some triples not being added to the model.
> The code I run is:
> {code:java}
> Model model = ModelFactory.createDefaultModel();
> model.read("example.ttl"); 
> {code}
> {{The output is:}}
> {code:java}
> null inXSDDateTimeStamp "2020-05-21T06:00:00Z^^http://www.w3.org/2001/XMLSchema#dateTime" .
> null inXSDDateTimeStamp "2020-05-21T21:00:00Z^^http://www.w3.org/2001/XMLSchema#dateTime" .
> null year "2020^^http://www.w3.org/2001/XMLSchema#integer" .
> null second "0.0^^http://www.w3.org/2001/XMLSchema#decimal" .
> null month "5^^http://www.w3.org/2001/XMLSchema#integer" .
> null minute "51^^http://www.w3.org/2001/XMLSchema#integer" .
> null hour "10^^http://www.w3.org/2001/XMLSchema#integer" .
> null day "21^^http://www.w3.org/2001/XMLSchema#integer" .
> null inXSDDateTimeStamp "2020-05-21T10:51:00.000Z^^http://www.w3.org/2001/XMLSchema#dateTime" .
> null inDateTime deab4047bb2762830ec586ecdbb6ebf7 .
> sim timeslotDuration "60000^^http://www.w3.org/2001/XMLSchema#integer" .
> sim sunsetTime de28266990fc799c9dde46e9a902ff55 .
> sim sunriseTime ccdbc2858add8f74d995dffcdcec5a22 .
> sim iterations "1440^^http://www.w3.org/2001/XMLSchema#integer" .
> sim initialTime "2020-05-21T08:00:00Z^^http://www.w3.org/2001/XMLSchema#dateTime" .
> sim currentTime 1806f92a70aa91903b714f6ba5bdb68f .
> sim currentIteration "171^^http://www.w3.org/2001/XMLSchema#integer" .{code}
> {{Note the null subjects.}}
> The code I used to generate the output is below:
>  
> {code:java}
> Iterator<Statement> iterator = model.listStatements();
> while (iterator.hasNext()) {
>     Statement stmt = iterator.next();
>     Resource subject = stmt.getSubject();
>     Property predicate = stmt.getPredicate();
>     RDFNode object = stmt.getObject(); 
>     System.out.print(subject.getLocalName());
>     System.out.print(" " + predicate.getLocalName() + " ");
>     if (object instanceof Resource) {
>         System.out.print(object.toString());
>     } else {
>         // object is a literal
>         System.out.print(" \"" + object.toString() + "\"");
>     } 
>     System.out.println(" .");
> } {code}
>  



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