You are looking at the docs for the unreleased master branch of Dgraph. The latest version is v21.03.
Report Issue Edit Page

Language and RDF Types

RDF N-Quad allows specifying a language for string values and an RDF type. Languages are written using @lang. For example

<0x01> <name> "Adelaide"@en .
<0x01> <name> "Аделаида"@ru .
<0x01> <name> "Adélaïde"@fr .
<0x01> <dgraph.type> "Person" .

See also how language strings are handled in queries.

RDF types are attached to literals with the standard ^^ separator. For example

<0x01> <age> "32"^^<xs:int> .
<0x01> <birthdate> "1985-06-08"^^<xs:dateTime> .

The supported RDF datatypes and the corresponding internal type in which the data is stored are as follows.

Storage Type Dgraph type
<xs:string> string
<xs:dateTime> dateTime
<xs:date> datetime
<xs:int> int
<xs:integer> int
<xs:boolean> bool
<xs:double> float
<xs:float> float
<geo:geojson> geo
<xs:password> password
<> string
<> dateTime
<> dateTime
<> int
<> int
<> int
<> bool
<> float
<> float

See the section on RDF schema types to understand how RDF types affect mutations and storage.

Continue the conversation on Discuss.