Search code examples
owlprotege

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.


Solution

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

    enter image description here

    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