Symmetric, inverse, transitive relationships


#1

Hi,

Looking further for commonalities with the OWL world… What would be a natural way of modelling relationships that would behave as symmetric, inverse and transitive OWL properties?

The OWL migration page in Grakn documentation is not exactly clear about this… :wink:

Thanks,
Marcel


#2

Hi Marcel,

In general the inference rule mechanism is exactly what you need to express different meta-properties over relationships in your data, such as those you mention. We’re still working on it and it’s not properly documented on our website yet, but take a look our blog post for some quick examples: https://blog.grakn.ai/how-to-find-information-that-is-not-there-de0d66360179#.jzsbnqkzx

Note also that in case of symmetric relations there’s also more straightforward way. Basically, our n-relations are unordered tuples of role-role-player pairs. So if you define a symmetric relation, say neighbouring, with only one role neighbour, and assert:

(neighbour: person1, neighbour:person2) isa neighbouring

and query for:

match (neighbour:$x, neighbour:$y) isa neighbouring

you will get two matches:

person1, person2
person2, person1

which is exactly what you would expect from a symmetric relation.

Szymon