[ https://issues.apache.org/jira/browse/JENA-2075?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17307267#comment-17307267 ]
ASF subversion and git services commented on JENA-2075: ------------------------------------------------------- Commit 31dc0d328c4858401e5d3fa99702c97eba0383a0 in jena's branch refs/heads/main from Andy Seaborne [ https://gitbox.apache.org/repos/asf?p=jena.git;h=31dc0d3 ] Merge pull request #965 from Claudenw/JENA-2075 JENA-2075: Changed String.valueOf() to getModel().createTypeLiteral() > Seq "set" and "add" methods yield different results. > ---------------------------------------------------- > > Key: JENA-2075 > URL: https://issues.apache.org/jira/browse/JENA-2075 > Project: Apache Jena > Issue Type: Bug > Components: Core > Affects Versions: Jena 3.17.0 > Reporter: Claude Warren > Priority: Major > > 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: > {code:java} > 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"); > } > } > {code} > Result: > {code:java} > [ 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" > ] . > {code} > 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. -- This message was sent by Atlassian Jira (v8.3.4#803005)