简体   繁体   中英

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 .
  • Then I create an object property hasEmployer with inverse hasEmployee .
  • Now I also create a class called 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.

So basically I want something called hasEmploymentContract which is a property with domain hasEmployer (an object property) and range EmploymentContract (a class).

Is this possible in OWL? Am I thinking about the problem wrong maybe?

If possible, an implementation using Protege Ontology Editor would also be greatly appreciated.

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 . 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 .

在此输入图像描述

Similar relations can be set up for hasEmployer based on the diagram. In Protege this can be represented as follows:

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. 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. 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/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM