Skip to content

Properties

Properties define relationships between entities (object properties) and attributes of entities (data properties).

Object properties link two individuals:

:hasOwner a owl:ObjectProperty ;
rdfs:domain :Animal ;
rdfs:range :Person .
  • Domain: the class of the subject (using hasOwner on a node infers it’s an Animal)
  • Range: the class of the object (the target of hasOwner is inferred as a Person)

Data properties link an individual to a literal value:

:name a owl:DatatypeProperty ;
rdfs:domain :Person ;
rdfs:range xsd:string .
:age a owl:DatatypeProperty ;
rdfs:range xsd:integer .

Declare two properties as inverses. When one is asserted, the other is materialized automatically:

:hasOwner a owl:ObjectProperty .
:isOwnerOf a owl:ObjectProperty ;
owl:inverseOf :hasOwner .

Insert <rex> <hasOwner> <alice> → OWLGraph creates <alice> <isOwnerOf> <rex> automatically.

If A→B and B→C, then A→C:

:locatedIn a owl:ObjectProperty , owl:TransitiveProperty .

Query with transitive paths: locatedIn* { name } follows the chain.

If A→B, then B→A with the same property:

:friendOf a owl:ObjectProperty , owl:SymmetricProperty .

At most one value per subject:

:name a owl:DatatypeProperty , owl:FunctionalProperty .

At most one subject per value (like a unique constraint):

:email a owl:DatatypeProperty , owl:InverseFunctionalProperty .
:knows a owl:ObjectProperty , owl:ReflexiveProperty . # Everyone knows themselves
:parentOf a owl:ObjectProperty , owl:IrreflexiveProperty . # Nobody is their own parent

If A→B, then B→A is forbidden:

:parentOf a owl:ObjectProperty , owl:AsymmetricProperty .

Define a derived property as a chain of other properties:

:hasParent a owl:ObjectProperty .
:hasGrandparent a owl:ObjectProperty ;
owl:propertyChainAxiom ( :hasParent :hasParent ) .

When <C> hasParent <B> and <B> hasParent <A> appear in the same mutation, OWLGraph creates <C> hasGrandparent <A>.

Property chains currently support length-2 chains within a single mutation batch.

:hasMotherOf a owl:ObjectProperty ;
rdfs:subPropertyOf :hasParent .

Domain and range declarations trigger automatic type inference:

:writtenBy a owl:ObjectProperty ;
rdfs:domain :Book ;
rdfs:range :Author .

When you insert <node1> writtenBy <node2>:

  • node1 gets dgraph.type = "Book" (domain inference)
  • node2 gets dgraph.type = "Author" (range inference)
  • Both also get ancestor types materialized (Book → CreativeWork, Author → Person, etc.)