2

I have created an ontology in Protege 5.2 and now I am trying to create correctly the object properties of my corresponding classes. Here is a snippet of my UML diagram according to which I have built my ontology: Snippet of my ontology

Regarding the isLocated object property, they are characterized in the following way: If a Node X has a SITE value Z, and the same value Z appears in SITEIST of a Location Y, then Node X is Located in Location Y.

Should I look into SWRL rules or is there some way to encode this without having to go there?

Thank you guys in advance!

  • It is possible, when using object properties instead of data properties, i. e. using URIs instead of integers as properties values. With integers, I tried to combine approaches [1](https://stackoverflow.com/a/43821560/7879193) and [2](https://stackoverflow.com/a/43876250/7879193), but was unsuccessful. – Stanislav Kralin May 26 '17 at 11:30
  • So @StanislanKralin are you suggesting that I create some object properties, for example for the Node class, like: hasNodeId, hasPlaceInstId, etc? In this case, do you have any idea regarding the domain and range of each of these object properties? – Ioannis Gerochristos May 31 '17 at 12:57
  • I don't know what your nodes and locations are... I mean something like this: `:nodeXXX :hasSite` `:zipArea85223`, `:locationYYY :hasSiteIst :zipArea85223` => `:nodeXXX :isLocatedIn :locationYYY`. – Stanislav Kralin May 31 '17 at 14:34
  • My Locations look like this: http://imgur.com/a/KMmVk, and my Nodes look like this: http://imgur.com/a/FXf8Y . As you see, the site in Node and the sitemek in Location have the same value in this instance, 335836, so I would like to create a new object property named isLocated, every time that this is the case. Now, I am trying to create this helping predicate hasNodeId in Protege. This is what I have tried: http://imgur.com/a/Hdd55 . I would like to automatically create the predicate hasNodeId for every node_id that I have for every node. Do you have any idea about how to do that in Protege? – Ioannis Gerochristos May 31 '17 at 15:28
  • I think it is not possible. But if `site` and `siteist` were _object propertiew_, not _data properties_, it would be possible. – Stanislav Kralin Jun 01 '17 at 04:48

1 Answers1

1

In SWRL you can achieve that straightforward:

locationHasSiteIst(?l, ?s) ^ nodeHasSite(?n, ?s) -> nodeLocatedInLocation(?n, ?l)

If you want yo make it in OWL, you need to make locationHasSiteIst and nodeHasSite as object properties, and Site as a class instead of a datatype, then you can use object property chaining and inclusion in Protege as follows:

nodeHasSite o inverse(locationHasSiteIst) SubPropertyOf nodeLocatedInLocation

The last line means that if a node n1 is located in site1, and a location l1 is located in s1 as well, then n1 is located in l1.

Median Hilal
  • 1,483
  • 9
  • 17
  • thank you for your reply! But how do you implement the object property chaining and inclusion in practice? Is there some window that I am supposed to write this "command"? – Ioannis Gerochristos Jun 12 '17 at 12:21
  • If you use Protege, click on the right-hand side object property `nodeLocatedInLocation` of the expression above, then there is a `superPropertyOf (Chain)` option, click on **add**, then type down `nodeHasSite o inverse(locationHasSiteIst)`. This will make the property chain `nodeHasSite o inverse(locationHasSiteIst)` included in `nodeLocatedInLocation`. If this answer solved your problem, please don't forget to tick it as a solution. – Median Hilal Jun 12 '17 at 12:38
  • I ended up using the SWRL rule that you mentioned in the beginning and it did the trick, thanks! But now I'm facing another issue. My ontology is working perfectly when I am using a small sample of my dataset, but when I'm using the complete one, the "Run Drools" option runs out of memory. I'm attaching a screenshot of the metrics of the ontology: http://imgur.com/a/8dxwK I'm aware that the dataset is quite big, just wondering whether you have some optimization tips or whatever that could help bypass this problem (I have already set the heap space to 4GBs). – Ioannis Gerochristos Jun 12 '17 at 15:50