Yeahp... Looks like it's something wrong in the turorial. Indeed, according to Jena's JavaDoc, is the paragraph preceding the code also wrong?
"Jena's interfaces also support typed literals. The old-fashioned way (shown below) treats typed literals as shorthand for strings: *typed values are converted in the usual Java way to strings and these strings are stored in the Model*. For example, try (noting that for simple literals, we can omit the model.createLiteral(...) call):" Thanks!! Panian. El mar., 25 sept. 2018 a las 7:43, Lorenz B. (< [email protected]>) escribió: > > > > // add the property > > r.addProperty(RDFS.label, "11") > > .addLiteral(RDFS.label, 11); > I'm wondering whether the tutorial is correct here given the fact that > the method addLiteral will handle argument 11 in the second call as a > proper number and thus create a typed literal of type xsd:long, see [1] > > [1] > > https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Resource.html#addLiteral-org.apache.jena.rdf.model.Property-long- > > -- > Lorenz Bühmann > AKSW group, University of Leipzig > Group: http://aksw.org - semantic web research center > >
