Hello. While exploring Jena (v4.6.1)'s RDF-star functionality and features, I'm 
getting the following output:


@prefix calculus: <http://www.w3.org/community/planning/calculus/ontology#> .
@prefix example:  <http://example.org/#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .

<< example:predicate calculus:holdsFor _:b0 >>
        calculus:probability  "0.95"^^xsd:double .

[ rdf:first example:x ; rdf:rest ( example:y example:z ) ] .


while expecting:


@prefix calculus: <http://www.w3.org/community/planning/calculus/ontology#> .
@prefix example:  <http://example.org/#> .
@prefix rdf:      <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:      <http://www.w3.org/2001/XMLSchema#> .

<< example:predicate calculus:holdsFor ( example:x example:y example:z ) >>
        calculus:probability  "0.95"^^xsd:double .


To obtain the output, I'm utilizing the following source code:

public static void foo(Model model)
{
  model.setNsPrefix("calculus", 
"http://www.w3.org/community/planning/calculus/ontology#";);
  model.setNsPrefix("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#";);
  model.setNsPrefix("xsd", "http://www.w3.org/2001/XMLSchema#";);
  model.setNsPrefix("example", "http://example.org/#";);

  Resource predicate = model.createResource("http://example.org/#predicate";);
  Resource p1 = model.createResource("http://example.org/#x";);
  Resource p2 = model.createResource("http://example.org/#y";);
  Resource p3 = model.createResource("http://example.org/#z";);

  Property calculus_holdsFor = 
model.createProperty("http://www.w3.org/community/planning/calculus/ontology#holdsFor";);
  Property calculus_probability = 
model.createProperty("http://www.w3.org/community/planning/calculus/ontology#probability";);
      
  RDFList list = model.createList(p1, p2, p3);
  Statement s = model.createStatement(predicate, calculus_holdsFor, list);
  Resource quoted = model.createResource(s);
      
  //model.add(s);
  model.add(quoted, calculus_probability, model.createTypedLiteral(0.95));
}
      
public static void main(String[] args) throws IOException
{
  Model model = ModelFactory.createDefaultModel();
  foo(model);           

  RDFDataMgr.write(System.out, model, Lang.TURTLE);
}

Might this be a bug or issue with respect to list-handling in quoted RDF-star 
triples or with respect to serialization to Turtle-star? Thank you.


Best regards,
Adam Sobieski

Reply via email to