ternary relations

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ternary relations

Rajverma

Hi,

 

I have a problem with modelling issue… attached is an ontology that tries to model an aspect of car racing… suppose that I have the following concepts:

 

Lap

Participant

            Ferarri

            Mercedes

            Toyota

Position

 

where Position is a class with nominals {First Second Third}, and roles:

 

hasParticipant

gotPosition

 

The following are the individuals:

 

Lap (Lap1, Lap2, Lap3)

Ferarri (Schumi)

Mercedes (Ralf)

Toyota (Montaya)

 

Now, I want to model the scenario where different individual laps have different participants with different winning positions… for example, Lap1 has Schumi and Ralf as participants, AND Schumi took the position First and Ralf took the position Second… so far so good… but when I select Ralf for Lap 2 his position is already fixed (Second) because of the property between the concepts Participant and Position… so I can’t select different positions for different laps for the same participant… is there a way to do it?

 

Thanx,

Raj


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 

f1.pprj (284K) Download Attachment
f1.owl (3K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: ternary relations

Thomas Russ
To model ternary (or any relation with arity greater than 2) you will  
have to reify (make an object for) the relationship.  See <http://
www.w3.org/TR/swbp-n-aryRelations/>

On Jun 20, 2007, at 1:16 PM, Mudunuri, Raj wrote:

> Hi,
>
>
>
> I have a problem with modelling issue… attached is an ontology that  
> tries to model an aspect of car racing… suppose that I have the  
> following concepts:
>
> Lap
>
> Participant
>
>             Ferarri
>
>             Mercedes
>
>             Toyota
>
> Position
>
>
>
> where Position is a class with nominals {First Second Third}, and  
> roles:
>
>
>
> hasParticipant
>
> gotPosition
>
>
>
> The following are the individuals:
>
>
>
> Lap (Lap1, Lap2, Lap3)
>
> Ferarri (Schumi)
>
> Mercedes (Ralf)
>
> Toyota (Montaya)
>
>
>
> Now, I want to model the scenario where different individual laps  
> have different participants with different winning positions… for  
> example, Lap1 has Schumi and Ralf as participants, AND Schumi took  
> the position First and Ralf took the position Second… so far so  
> good… but when I select Ralf for Lap 2 his position is already  
> fixed (Second) because of the property between the concepts  
> Participant and Position… so I can’t select different positions for  
> different laps for the same participant… is there a way to do it?
You need to model this differently.  Add a FinishingPosition class  
and have each lap refer to several of these.

For example:
   FinishingPosition
      - hasParticipant
      - gotPosition

   Lap
      - finisher:  FinishingPosition
      - hasParticipant

You then create
    lap1 --finisher--> fp1  --hasParticipant--> Schumi
                            --gotPosition-->    First
         --finisher--> fp2  --hasParticipant--> Ralf
                            --gotPosition-->    Second
         --hasParticipant--> Schumi
         --hasParticipant--> Ralf

    lap2 --finisher--> fp3  --hasParticipant-->  Ralf
                            --gotPosition-->     <whatever you want>



_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: ternary relations

Doug Holmes
In reply to this post by Rajverma
Hello Raj,
You might find a useful pattern at http://www.w3.org/TR/swbp-n-aryRelations/
Doug
On Jun 20, 2007, at 1:16 PM, Mudunuri, Raj wrote:

Hi,

 

I have a problem with modelling issue… attached is an ontology that tries to model an aspect of car racing… suppose that I have the following concepts:

 

Lap

Participant

            Ferarri

            Mercedes

            Toyota

Position

 

where Position is a class with nominals {First Second Third}, and roles:

 

hasParticipant

gotPosition

 

The following are the individuals:

 

Lap (Lap1, Lap2, Lap3)

Ferarri (Schumi)

Mercedes (Ralf)

Toyota (Montaya)

 

Now, I want to model the scenario where different individual laps have different participants with different winning positions… for example, Lap1 has Schumi and Ralf as participants, AND Schumi took the position First and Ralf took the position Second… so far so good… but when I select Ralf for Lap 2 his position is already fixed (Second) because of the property between the concepts Participant and Position… so I can’t select different positions for different laps for the same participant… is there a way to do it?

 

Thanx,

Raj

<f1.pprj>
<f1.owl>
_______________________________________________
protege-owl mailing list

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: ternary relations

Michael Fellmann
In reply to this post by Rajverma

Hello Raj,

it is very straight forward to model an n-ary relation as a separate class.
Regarding your example, you might introduce a new class LapPosition. Each
individual of that class then represents a position of a Participant in a
Lap.  

In Turtle Syntax:

@prefix f:  <http://f1.example.org/races.owl#> .

f:LapPosition
      rdf:type owl:Class ;

f:isAssignedToLap
      rdf:type owl:ObjectProperty , owl:FunctionalProperty ;
      rdfs:domain f:LapPosition ;
      rdfs:range f:Lap .

f:hasPositionNumber
      rdf:type owl:DatatypeProperty , owl:FunctionalProperty ;
      rdfs:domain f:LapPosition ;
      rdfs:range xsd:int .

f:hasPositionOwner
      rdf:type owl:ObjectProperty , owl:FunctionalProperty ;
      rdfs:domain f:LapPosition ;
      rdfs:range f:Participant .

f:lap1pos2
      rdf:type f:LapPosition ;
      f:hasPositionNumber
              "2"^^xsd:int ;
      f:hasPositionOwner
              f:Rolf ;
      f:isAssignedToLap
              f:Lap_1 .

With this, you can easily retrieve a list of laps with their participants
and positions.

SPARQL query:

SELECT ?lap ?participant ?pos
WHERE { ?lap rdf:type f:Lap .
               ?lp f:isAssignedToLap ?lap .
               ?lp f:hasPositionOwner ?participant .
               ?lp f:hasPositionNumber ?pos  }


RESULT:

Lap_1 Schumi 1
Lap_1 Rolf 2
Lap_2 Rolf 1


In general, a good starting point for dealing with n-ary relations is
http://www.w3.org/TR/swbp-n-aryRelations/


Best,
Michael.



> Date: Wed, 20 Jun 2007 22:16:30 +0200
> From: "Mudunuri, Raj" <[hidden email]>
> Subject: [protege-owl] ternary relations
> To: "User support for the Protege-OWL editor"
>         <[hidden email]>
> Message-ID:
>  
> <[hidden email]-leipz
> ig.de>
>        
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
>
>
> I have a problem with modelling issue... attached is an ontology that
> tries to model an aspect of car racing... suppose that I have the
> following concepts:
>
>
>
> Lap
>
> Participant
>
>             Ferarri
>
>             Mercedes
>
>             Toyota
>
> Position
>
>
>
> where Position is a class with nominals {First Second Third}, and roles:
>
>
>
> hasParticipant
>
> gotPosition
>
>
>
> The following are the individuals:
>
>
>
> Lap (Lap1, Lap2, Lap3)
>
> Ferarri (Schumi)
>
> Mercedes (Ralf)
>
> Toyota (Montaya)
>
>
>
> Now, I want to model the scenario where different individual laps have
> different participants with different winning positions... for
> example,
> Lap1 has Schumi and Ralf as participants, AND Schumi took the position
> First and Ralf took the position Second... so far so good... but when
> I select Ralf for Lap 2 his position is already fixed (Second) because
> of the property between the concepts Participant and Position... so I
> can't select different positions for different laps for the same
> participant... is there a way to do it?
>
>
>
> Thanx,
>
> Raj
>



_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03