Two object properties with one having transistive characteristic.

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

Two object properties with one having transistive characteristic.

IWilliams
I have two classes:
Instruction

I would like to create two object properties for Instruction, so that:
1) nextInstruction (Instruction --> Instruction): this should be only for
the immediate instruction
2) dependsOnInstruction (Instruction --> Instruction): this should be only
for all the instructions that came before the current Instruction.

I want to dependsOnInstruction sub-property of nextInstruction, where
dependsOnInstruction has a transitive property.

*For example:*
Instruction1
Instruction2
Instruction3
Instruction4
Instruction5

But when I assert:

nextInstruction for Instruction1 is Instruction2 and no other instruction.

dependsOnInstruction for Instruction3 is Instruction2 and Instruction1.

I get inferred:
nextInstruction for Instruction1 to be Instruction2, Instruction3,
Instruction4, Instruction5.

I dont know why I am getting the inferred to be this, since I did have
nextInstrction to be transitive.








--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Two object properties with one having transistive characteristic.

Michael DeBellis-2
This is another example where it would be a lot easier to debug if you could just include your owl file. But I think the issue may be with this:

>I want to dependsOnInstruction sub-property of nextInstruction 

At first I thought the only issue was just that you had this backward and that it should be nextInstruction is a sub-property of dependsOnInstruction.  

If P2 is a sub-property of P1 then every pair of values in P2 is also in P1 but not vice versa. The example I always like to use is hasParent and hasMother. hasMother can be modeled as a sub-property of hasParent because if x hasMother m then x hasParent m but not vice versa (there would also be the sub-property of hasParent called hasFather). 

So if you say that dependsOnInstruction  is a sub-property of nextInstruction then you are saying every pair such as <Instruction1, Instruction2> that is in the relation (property) dependsOnInstruction  is also in the relation nextInstruction,

However, I think there may be another issue. I would think dependsOnInstruction would be all the instructions that need to come BEFORE the specific instruction. If that's the case you may have two issues, first mixing up which one is the sub-property and then using something that should be an inverse relation. 

So if your instruction series is I1 -> I2 ->I3  

I would think that I3 dependsOnInstruction  I2 and I1. So the way I would model that (if you look at my SWRL process modelling tutorial I think I did something like that and my example was inspired by my looking at one of the collection ontologies) is that you have two inverse properties: nextInstruction and previousInstruction. previousInstruction is the inverse property to nextInstruction. previousInstruction should be a sub-property to dependsOnInstruction and nextInstruction could be a sub-property of some other property such as perhaps subsequentInstruction (which will be the inverse of dependsOnInstruction). 

I'm not sure I'm getting that right it's so easy (especially if you are Dyslexic like I am) to get these things mixed up, it's why I almost find it easier to model them in Protege than to write down what the model should be but I think that is correct. As I said, I think I do something similar in my process modeling tutorial which can be found here: https://symbolicshacker.blogspot.com/2017/06/swrl-process-modeling-tutorial.html  

Hope that helps.

Michael



On Sat, Jun 22, 2019 at 9:10 AM IWilliams <[hidden email]> wrote:
I have two classes:
Instruction

I would like to create two object properties for Instruction, so that:
1) nextInstruction (Instruction --> Instruction): this should be only for
the immediate instruction
2) dependsOnInstruction (Instruction --> Instruction): this should be only
for all the instructions that came before the current Instruction.

I want to dependsOnInstruction sub-property of nextInstruction, where
dependsOnInstruction has a transitive property.

*For example:*
Instruction1
Instruction2
Instruction3
Instruction4
Instruction5

But when I assert:

nextInstruction for Instruction1 is Instruction2 and no other instruction.

dependsOnInstruction for Instruction3 is Instruction2 and Instruction1.

I get inferred:
nextInstruction for Instruction1 to be Instruction2, Instruction3,
Instruction4, Instruction5.

I dont know why I am getting the inferred to be this, since I did have
nextInstrction to be transitive.








--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Two object properties with one having transistive characteristic.

Dave McComb-2
In reply to this post by IWilliams
Subproperties look like subclasses in Object Oriented, where attributes inherit down, but I often find it best to think of things inheriting up.

you want to say that nextInstruction implies dependsOnInstruction, and not the other way around.

so if you make nextInstruction a sub property of dependsOnInstruction when you assert NI the DOI will be inferred.

If you then put transitive only on DOI you will get what you want.  The transitivity attribute does not flow down. It is only on the DOI

You are thinking, from OO, that  DOI specializes NI.  But that isn’t how it works.  You should think about what things get inferred.  

The assertion of a property implies (and therefore the reasoner will supply) that the super properties also hold.  

> On Jun 22, 2019, at 10:10 AM, IWilliams <[hidden email]> wrote:
>
> I have two classes:
> Instruction
>
> I would like to create two object properties for Instruction, so that:
> 1) nextInstruction (Instruction --> Instruction): this should be only for
> the immediate instruction
> 2) dependsOnInstruction (Instruction --> Instruction): this should be only
> for all the instructions that came before the current Instruction.
>
> I want to dependsOnInstruction sub-property of nextInstruction, where
> dependsOnInstruction has a transitive property.
>
> *For example:*
> Instruction1
> Instruction2
> Instruction3
> Instruction4
> Instruction5
>
> But when I assert:
>
> nextInstruction for Instruction1 is Instruction2 and no other instruction.
>
> dependsOnInstruction for Instruction3 is Instruction2 and Instruction1.
>
> I get inferred:
> nextInstruction for Instruction1 to be Instruction2, Instruction3,
> Instruction4, Instruction5.
>
> I dont know why I am getting the inferred to be this, since I did have
> nextInstrction to be transitive.
>
>
>
>
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Two object properties with one having transistive characteristic.

Dave McComb-2
In reply to this post by IWilliams
Subproperties look like subclasses in Object Oriented, where attributes inherit down, but I often find it best to think of things inheriting up.

you want to say that nextInstruction implies dependsOnInstruction, and not the other way around.

so if you make nextInstruction a sub property of dependsOnInstruction when you asser

> On Jun 22, 2019, at 10:10 AM, IWilliams <[hidden email]> wrote:
>
> I have two classes:
> Instruction
>
> I would like to create two object properties for Instruction, so that:
> 1) nextInstruction (Instruction --> Instruction): this should be only for
> the immediate instruction
> 2) dependsOnInstruction (Instruction --> Instruction): this should be only
> for all the instructions that came before the current Instruction.
>
> I want to dependsOnInstruction sub-property of nextInstruction, where
> dependsOnInstruction has a transitive property.
>
> *For example:*
> Instruction1
> Instruction2
> Instruction3
> Instruction4
> Instruction5
>
> But when I assert:
>
> nextInstruction for Instruction1 is Instruction2 and no other instruction.
>
> dependsOnInstruction for Instruction3 is Instruction2 and Instruction1.
>
> I get inferred:
> nextInstruction for Instruction1 to be Instruction2, Instruction3,
> Instruction4, Instruction5.
>
> I dont know why I am getting the inferred to be this, since I did have
> nextInstrction to be transitive.
>
>
>
>
>
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Two object properties with one having transistive characteristic.

IWilliams
In reply to this post by Michael DeBellis-2
Hi Michael,

You suggestion seems to do the job. Can you suggest any reading materials
that I can use to fully understand more about OWL/ontology?



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Two object properties with one having transistive characteristic.

Michael DeBellis-2
First, if you haven't already done it,  I would recommend doing the Pizza tutorial. I'm not sure what the current best link for it is but if you look on the Protege site you should find it. I think it may be a bit out of date. To the best of my knowledge it hasn't been updated in a long time so parts of the UI or instructions have minor inconcistencies with the latest Protege UI. But you can usually reason them out (e.g., where the tutorial says add "foo" to the Superclasses field of some class instead the field is now called Subclasses of. If you get stuck feel free to ask a question to the list. 

Second, I would recommend the Manchester FHKB tutorial. It gets rather involved and I didn't make it all the way through to the very end but even making it 3/4 ways through that tutorial is very useful. One of the biggest differences between OWL and standard OOP is the way properties are modeled and FHKB does a great job of not just explaining this in negative terms (i.e., how they aren't like standard OOP properties) but in positive terms (some of the very cool things you can do with OWL properties you can't do with standard OO properties). 

If you are interested in SWRL you might want to check out my SWRL tutorial: https://symbolicshacker.blogspot.com/2017/06/swrl-process-modeling-tutorial.html  Note: on that page I also include a PDF document that is an overview of set theory. I highly recommend reading that document or something similar if you haven't had or don't remember an intro class on logic and set theory. One of the things that IMO gives OWL so much power is that it is essentially an implementation of set theory and a subset of First Order Logic and understanding those basic concepts helps you get the most out of OWL. 

The books Programming the Semantic Web and Semantic Web Programming are both good. They cover many things besides OWL but you really need to understand those things (e.g., RDF, SPARQL, how to access OWL objects in programming languages) if you are going to get the most power out of OWL. The code examples are out of date but for coding it's often better to do the tutorials associated with the various tools anyway but both books do a good job of explaining the concepts. 

I'm working on a new blog and if I ever finish it, I plan to post a few articles on best practices in OWL and SWRL. Keep an eye on the Protege list, I'll post a short message if I finish that. 

Also, I just posted this link in another message but a long as I'm at it,  I recommend this article to understand how things are different between standard OOP and OWL: https://www.w3.org/2001/sw/BestPractices/SE/ODSD/


There is also a good book that goes very deep into the theory behind OWL. If you are into logic and understand things like model theory you would love this book. If you don't care about that stuff (and you don't need that level of logic to use OWL for most things) you would probably be bored with it. That book is called Foundations of Semantic Web Technology by Pascal Hitzler et. al. 

Hope that helps.

Michael

On Wed, Aug 21, 2019 at 7:20 PM IWilliams <[hidden email]> wrote:
Hi Michael,

You suggestion seems to do the job. Can you suggest any reading materials
that I can use to fully understand more about OWL/ontology?



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-User-f4659818.html
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

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