[
https://issues.apache.org/jira/browse/JENA-2134?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17380152#comment-17380152
]
Rem Collier commented on JENA-2134:
-----------------------------------
Hi Rob,
I have added the code I used to printout the model.
The output is generated by RDF4J which is being used on a server (not written
by me). The triples are inserted into its knowledge store using SPARQL
statements. I have just used the default TURTLE Formatter provided with RDF4J
to format the output.
The server code is open source and can be found here:
[bold-benchmark/bold-server: Linked Data server managing the BOLD simulation
environment (github.com)|https://github.com/bold-benchmark/bold-server]
> 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)