简体   繁体   English

将属性与OWL / Protege中的类相关联

[英]Associate a property with a class in OWL/Protege

Consider this scenario: 考虑这种情况:

  • There are employers and employees. 有雇主和雇员。 I model this with a class Employer and a class Employee . 我使用Employer类和Employee类进行建模。
  • Then I create an object property hasEmployer with inverse hasEmployee . 然后,我创建一个对象属性hasEmployer和相反的hasEmployee
  • Now I also create a class called 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处于hasEmployeeAsParticipantEmployee ,是一个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.

相关问题 Protege中Data属性下的owl:topDataProperty - owl:topDataProperty under Data Property in Protege OWL Protege-5.0如何将对象属性的范围设置为外部Ontolgoy类 - OWL Protege-5.0 how to set the range of Object Property as an external Ontolgoy class OWL,Protege:从DefaultOWLObjectProperty值获取到个人的类 - OWL, Protege: Getting from a DefaultOWLObjectProperty value to the class of an individual 猫头鹰 - 保护不正确? 如何准确定义一个“素食”类? - owl - protege not inferring correctly? how to define precisely a class “vegetarian”? OWL/Protege:Model 推断不是组成员的人的 class - OWL/Protege: Model inferred class of persons, who are not members of a group 建模 class 作为父兄弟 Class OWL/Protege 的补充/否定 - Modelling class as complement / negation of Parent Sibling Class OWL/Protege 使用属性链在OWL本体(Protege)中获取推断知识 - Using Property Chains to get inferred Knowledge in an OWL Ontology(Protege) 在Protege OWL上识别丢失的数据类型属性值的好选择吗? - Any good choice for identifying missing datatype property values on Protege OWL? 如何在 OWL2/Protege/Ontology 中将属性定义为两个“条件”的交集 - How to define a property as intersection of two “conditions” in OWL2 / Protege / Ontology 将猫头鹰本体命名为protege - naming owl ontology in protege
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM