Represent UML diagram in OWL

夙愿已清 提交于 2019-12-12 04:59:14

问题


I have two classes Person and Vehicle having owns as relation between them.

There is 1 to many relation between them like one person can own many vehicles. Person has attribute 'name' (person name) and vehicle also has attribute 'name' (brand name). Question is how to model this in OWL using protege editor? If there is an attribute on 'owns' relation saying 'DateOfPurchase' how to represents this in OWL ?


回答1:


Object properties in OWL describe relation between individuals, not between classes. It is a "borrowed" URI, nothing else. So, what you need is to reify each statement such as :PersonA :owns :VehicleB. RDF allows that, however Protégé does not. So, here's a workaround:

You create two object properties :hasSubjectOfOwns and :hasObjectOfOwns, and for each case you need to describe dateOfPurchase, you define an individual representing the statement, and assert :

:AownsB :hasSubjectOfOwns :PersonA; :hasObjectOfOwns :VehicleB; :dateOfPurchase "2014-10-01"^^xsd:date

Initially you'd need to create a property chain, which in Protégé would look like that: inverse (hasSubjectOfOwns) o hasObjectOfOwns SubPropertyOf owns




回答2:


If there is an attribute on 'owns' relation saying 'DateOfPurchase' how to represents this in OWL ?

If that's the domain model, then the UML doesn't capture it. What you're describing is that there's an Purchase or Ownership entity with some additional attributes, more like

+--------+     +-----------+   +---------+
| Person | → * | Ownership | → | Vehicle |
+--------+     +-----------+   +---------+
               | date      |
               +-----------+

This is essentially the same approach that I described in your earlier question, Can OWL punning help in defining data properties on object property?. There's no way to "sneak in" metadata about a relationship; you must make it explicit.



来源:https://stackoverflow.com/questions/38224423/represent-uml-diagram-in-owl

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!