Search code examples
javaowlontologyowl-api

How to represent n-ary dataytypes properties in OWL and in OWL-API


We can easily represent Binary data properties, for example the class Pizza has the data property hasCalorificContentValue some xsd:integer

Lets say we want to represent the distance between two individuals location1 and location2 from the Class Location, we want to say that the distance between these locations is equal to an integer, how do we do that?

This relation is between three things (n-ary); between location1, location2, some integer. (in this example it happens that location1 and location2 are from the same Class, in other examples they might have different classes.

What is the best way to describe this relation in OWL and also in OWL-API? I read about this in https://www.w3.org/TR/swbp-n-aryRelations/#useCase1 However i am not sure if i got it right and how to represent this in OWL-API

I am going to attach an image of how i am thinking to approach this ->: Class definition

Kindly advise me, if this is the correct way, and how to do in OWL-API

Regards


Solution

  • This is done the same way n-ary relationships for object properties are represented. You need to create an individual representing the relationship and add (binary) properties to it. If it fits your use case, the individual can be named or unnamed, and you can define a named class for this individual or not.

    There is no utility class for this scenario, so you'll have to manually create at least four assertion axioms - one to the individual and three from the individual to the locations and to the distance.