0

I have defined an object property that requires two individuals. However, Protege do not let me to add these two but only one. The question could be summarised as follows: I have A and B belonging to a class (instances of that class). I have one object property, say proper, I would like to express: proper A, B. Here it is the code I wrote up to know.

@prefix : <http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age> .

<http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age> rdf:type owl:Ontology .

#################################################################
#    Object Properties
#################################################################

###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#Interact2
:Interact2 rdf:type owl:ObjectProperty ,
                    owl:FunctionalProperty ;
           rdfs:domain :Person ;
           rdfs:range :Person .


#################################################################
#    Data properties
#################################################################

###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#Interact
:Interact rdf:type owl:DatatypeProperty .


###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#hasAge
:hasAge rdf:type owl:DatatypeProperty .


#################################################################
#    Classes
#################################################################

###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#Person
:Person rdf:type owl:Class ;
        rdfs:subClassOf [ rdf:type owl:Restriction ;
                          owl:onProperty :Interact2 ;
                          owl:qualifiedCardinality "2"^^xsd:nonNegativeInteger ;
                          owl:onClass :Person
                        ] ,
                        [ rdf:type owl:Restriction ;
                          owl:onProperty :hasAge ;
                          owl:cardinality "1"^^xsd:nonNegativeInteger
                        ] .


#################################################################
#    Individuals
#################################################################

###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#Pallino
:Pallino rdf:type owl:NamedIndividual ,
                  :Person .


###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#Pinco
:Pinco rdf:type owl:NamedIndividual ,
                :Person .


###  http://stackoverflow.com/q/24188632/1281433/people-have-exactly-one-age#Pinco_Pallino
:Pinco_Pallino rdf:type owl:NamedIndividual ,
                        :Person ;
               :Interact2 :Pinco .


###  Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi
Francesco
  • 1
  • 1
  • Ehm, what does not work? Where do you add the property assertion? In Protege, you click on an individual `a` and then just add the property assertion to the other individual `b` which results in `p(a,b)` – UninformedUser Apr 14 '18 at 08:24
  • Yes. But suppose I have three individuals i.e., a, b and c. And I would like to say that a interact with b and c. – Francesco Apr 14 '18 at 12:51
  • And what prevents you from adding a second property assertion?! I don't understand the problem. Do the same twice for `b` and `c` which results in two axioms, i.e. two property assertions `p(a, b)` and `p(a, c)` – UninformedUser Apr 14 '18 at 12:59

0 Answers0