<subject>
of a triple is always a node, and must be a numeric
UID. The <object>
of a triple may be another node or a literal value:
name
, and the object is
the literal value string: "Alice"
. The second triple specifies that Alice
knows Bob. The subject is again the UID of a node (the βaliceβ node), the
predicate is knows
, and the object of this triple is the UID of the other node
(the βbobβ node). When the object is a UID, the triple represents a relationship
in Dgraph.
Each triple representation in RDF ends with a period.
_:
. All
references to the same blank node, such as _:identifier123
, identify the same
node within a mutation. Dgraph creates a UID identifying each blank node.
@lang
. For example
^^
separator.
For example
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 |
<http://www.w3.org/2001/XMLSchema#string> | string |
<http://www.w3.org/2001/XMLSchema#dateTime> | dateTime |
<http://www.w3.org/2001/XMLSchema#date> | dateTime |
<http://www.w3.org/2001/XMLSchema#int> | int |
<http://www.w3.org/2001/XMLSchema#positiveInteger> | int |
<http://www.w3.org/2001/XMLSchema#integer> | int |
<http://www.w3.org/2001/XMLSchema#boolean> | bool |
<http://www.w3.org/2001/XMLSchema#double> | float |
<http://www.w3.org/2001/XMLSchema#float> | float |
<http://abc.org/schema/foo#item1> <http://abc.org/hasRelation> "somevalue"^^xs:string
may be rewritten as
<_:http://abc.org/schema/foo#item1> <http://abc.org/hasRelation> "somevalue"^^xs:string
Dgraph will create a consistent UID for all references to the uniquely-named
blank node. To maintain this uniqueness over multiple data loads, use the
dgraph live utility with the xid option, or use specific
UIDs such as the hash of the IRI in the source RDF directly.