Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
Jena 3.17.0
-
None
Description
I think the issue is in the Seq.set() method but the if the example below is executed the results are variously boolean values or strings representing boolean values.
Code:
import org.apache.jena.rdf.model.Model; import org.apache.jena.rdf.model.ModelFactory; import org.apache.jena.rdf.model.Seq; public class SeqTest { public static void main(String[] args) { Model m = ModelFactory.createDefaultModel(); Seq seq = m.createSeq(); seq.add( 1L ); seq.add(2, 2L ); m.write(System.out, "TURTLE"); seq.set(1, 1L); m.write(System.out, "TURTLE"); } }
Result:
[ a <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> ; <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1" ; <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" ] . [ a <http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq> ; <http://www.w3.org/1999/02/22-rdf-syntax-ns#_1> "1"^^<http://www.w3.org/2001/XMLSchema#long> ; <http://www.w3.org/1999/02/22-rdf-syntax-ns#_2> "2" ] .
The Collection.add() code and the Seq.add() methods both insert string representations for the long values. The Seq.set() method on the other hand places a typed literal in the graph.
Personally I would rather see the typed literal but I don't know that the standard says.
Attachments
Issue Links
- links to