Literals are always datatyped in RDF. No guessing.


There syntax conveniences:

"abc" is the same as writing "abc"^^xsd:string.

The specs say to prefer writing output without ^^xsd:string.

In Turtle and related syntaxes:

42 is an xsd:integer == "42"^^xsd:integer

42.99 is an xsd:decimal

42e0 is an xsd;double.

"2021-07-16" is string.
"2021-07-16"^^xsd;date is a date.

and language strings "abc"@en have datatype rdf:langString.

On 16/07/2021 08:35, Laura Morales wrote:
When I insert new triples into a Jena/Fuseki store, are *all* the quoted 
literals treated as strings by default unless I specify the type explicitly 
(eg. xsd:dateTime)? Or does Jena use duck typing to determine the best type fit 
for storing the value?
What about numbers instead? Will Jena store 42 as an xsd:integer and 42.99 as 
xsd:double if I don't explicitly write the type?

How can I specify a set of constraints in Fuseki for all the properties of my model? For 
example "this property is a double, with range [1.0 .. 2.0]" (the same way that 
I can specify constraints on Postgres for example)?

Using ontology/schema/shapes.

    Andy

Reply via email to