Theory
Literals can carry a datatype or a language tag:
:Alice :age 30 . # xsd:integer (inferred)
:Alice :height "1.72"^^xsd:decimal .
:Alice foaf:name "Alice"@en, "アリス"@ja .
The XSD datatypes you'll meet most often:
| Datatype | Example literal | Notes |
|---|---|---|
xsd:string | "hello" | Default for bare strings |
xsd:integer | 42 | Inferred from bare integers |
xsd:decimal | "1.72"^^xsd:decimal | Use for exact decimals |
xsd:boolean | true | true / false keywords |
xsd:date | "1990-04-12"^^xsd:date | ISO-8601 calendar date |
xsd:dateTime | "2025-05-18T10:30:00Z"^^xsd:dateTime | Date + time + timezone |
