[英]Associate a property with a class in OWL/Protege
Consider this scenario: 考虑这种情况:
Employer
and a class Employee
. Employer
类和Employee
类进行建模。 hasEmployer
with inverse hasEmployee
. hasEmployer
和相反的hasEmployee
。 EmploymentContract
. EmploymentContract
的类。 I want to be able to say that for every hasEmployer
property, and its inverse, there must exist an EmploymentContract
associated with that relation. 我要说的是,对于每个
hasEmployer
属性及其相反的属性,必须存在一个与该关系相关联的EmploymentContract
。
So basically I want something called hasEmploymentContract
which is a property with domain hasEmployer
(an object property) and range EmploymentContract
(a class). 因此,基本上我想要一个名为
hasEmploymentContract
东西,它是一个具有hasEmployer
域(对象属性)和Range EmploymentContract
(一个类)的属性。
Is this possible in OWL? 在OWL中这可能吗? Am I thinking about the problem wrong maybe?
我是不是在想这个问题呢?
If possible, an implementation using Protege Ontology Editor would also be greatly appreciated. 如果可能的话,使用Protege Ontology Editor的实现也将不胜感激。
n-ary relations are one way to deal with this. 一元关系是处理此问题的一种方法。 Another is through property chaining.
另一个是通过财产链。 For this I will assume the diagram as given below.
为此,我将假设如下图所示。 Here the chained properties
providesEmploymentContract, hasEmployeeAsParticipant
represent the property hasEmployee
. 在这里,链接的属性
hasEmployee
providesEmploymentContract, hasEmployeeAsParticipant
代表属性hasEmployee
。 This means an Employer
that is in a providesEmploymentContract
relation with an EmploymentContract
where the EmploymentContract
is in a hasEmployeeAsParticipant
with an Employee
, is an Employer
that is in a hasEmployee
relation with the Employee
. 这意味着一个
Employer
是在providesEmploymentContract
与关系EmploymentContract
其中EmploymentContract
处于hasEmployeeAsParticipant
与Employee
,是一个Employer
是在hasEmployee
与关系Employee
。
Similar relations can be set up for hasEmployer
based on the diagram. 可以根据该图为
hasEmployer
建立类似的关系。 In Protege this can be represented as follows: 在Protege中,可以表示为以下形式:
Class: Employee
Class: Employer
Class: EmploymentContract
ObjectProperty: providesEmploymentContract
Domain: Employer
Range: EmploymentContract
ObjectProperty: agreesToEmploymentContract
Domain:Employee
Range: EmploymentContract
ObjectProperty: hasEmployerAsParticipant
Domain: EmploymentContract
Range: Employer
ObjectProperty: hasEmployeeAsParticipant
Domain: EmploymentContract
Range: Employee
ObjectProperty: hasEmployee
SubPropertyChain: providesEmploymentContract o hasEmployeeAsParticipant
Domain: Employer
Range: Employee
InverseOf: hasEmployer
ObjectProperty: hasEmployer
SubPropertyChain: agreesToEmploymentContract o hasEmployerAsParticipant
Domain: Employee
Range: Employer
InverseOf: hasEmployee
Notwithstanding the snarky comments indicating that I was being stupid, it appears that it is indeed not possible to implement this logic directly. 尽管有nar昧的评论表明我很愚蠢,但看来确实不可能直接实现这种逻辑。 The W3C working group has identified this shortcoming released a "Working Group Note" on design patterns for achieving this behavior through other means, which I eventually found.
W3C工作组已经发现了此缺陷,并发布了有关通过其他方式实现此行为的设计模式的“工作组说明”,我最终发现了这一点。 In fact an example in the head of the document is almost identical to my question:
实际上,文档开头的示例与我的问题几乎相同:
Another example is representing relations among multiple individuals, such as a buyer, a seller, and an object that was bought when describing a purchase of a book. 另一个例子是表示多个人之间的关系,例如买方,卖方和描述书籍购买时所购买的对象。
For anyone else interested, that document can be found here: https://www.w3.org/TR/swbp-n-aryRelations/ 对于其他感兴趣的人,可以在以下位置找到该文档: https : //www.w3.org/TR/swbp-n-aryRelations/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.