Domain and range restrictions: RDFS vs. Grakn



I’m trying to figure out how to capture the semantics of RDFS ontologies in Grakn, including subclass/subproperty hierarchies and domain/range restrictions on properties/roles. While subclass/subproperty axioms seem quite straightforward to translate via “sub” statements, I find domain/range restrictions a little more problematic. For instance, in RDFS I can assert that the range of hasParent property is a Person. Then, when I assert

“X hasParent Y”,

I can infer that Y is a Person because of that range restriction. I’m trying to model the same using “person plays-role parent” statement but I can’t see that inference working. What is the exact meaning of “plays-role” construct then? Does it allow for expressing range restrictions on roles?



Hi Marcel,

Right, the sub assertions in Grakn enable construction of inheritance hierarchies with the exact same semantics as in RDFS using rdfs:subClassOf and rdfs:subPropertyOf. The plays-role assertions, on the other hand, work quite differently from rdfs:range and rdfs:domain. They should be seen as schema constraints - not “inference rules”. This means that, in your example, if “person plays-role parent” and X is not known to be a person, the system won’t infer this fact, but rather prohibit X from playing that role in any relationship.



Hi Szymon,

Ok, now this makes more sense, thanks.



So it is not possible to restrict the range (rdfs:range) of a role, in the example, that in the “parent” role only entities of the type “person” can be associated? In graql it would be something like:

person sub entity;
parent sub role;
child sub role;
parentship sub relationship
relates parent
relates child;

parent must_be_a person;