How to correctly build a min cardinality restriction?

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

How to correctly build a min cardinality restriction?

Jens Bürger
Dear all,

as given in the attached ontology, I have:

Class "Car" with the indivuals
Porsche
Lincoln
Edsel

Class "Human" with the individuals
Bob
Alice

Object property "owns".

I would like to express that every human needs to own 1 car minimum and
2 cars maximum.

So I modeled:
Alice owns Lincoln.
Alice owns Edsel.

If I additionally add "Alice owns Porsche", then the reasoner (Pellet)
complains that the maxCardinality restriction does not hold.

But when removing, there is no complaint regarding Bob. What do I have
to add so that the minCardinality restriction produces an error because
Bob owns less than 1 car?

Kind regards,
Jens


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

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Jens Bürger
And I forgot the attachement :)

Am 08.08.2018 um 16:46 schrieb Jens Bürger:

> Dear all,
>
> as given in the attached ontology, I have:
>
> Class "Car" with the indivuals
> Porsche
> Lincoln
> Edsel
>
> Class "Human" with the individuals
> Bob
> Alice
>
> Object property "owns".
>
> I would like to express that every human needs to own 1 car minimum and
> 2 cars maximum.
>
> So I modeled:
> Alice owns Lincoln.
> Alice owns Edsel.
>
> If I additionally add "Alice owns Porsche", then the reasoner (Pellet)
> complains that the maxCardinality restriction does not hold.
>
> But when removing, there is no complaint regarding Bob. What do I have
> to add so that the minCardinality restriction produces an error because
> Bob owns less than 1 car?
>
> Kind regards,
> Jens
>
>
>
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user
>

--
Dipl.-Inf. Jens Bürger
University of Koblenz-Landau
Institute for Software Technology
RG Prof. Dr. Jan Jürjens

Office: B110, Campus Koblenz
Phone: +49 261 287-2705
Fax:   +49 261 287-100 2705

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

test9.owl (9K) Download Attachment
smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Michael DeBellis-2
In reply to this post by Jens Bürger
Jens, you are dealing with something that is a common problem for all new users of OWL called the Open World Assumption (OWA). The semantics of most programming languages and KB/DB environments are the opposite: the Closed World Assumption: if some information is not there you assume that the info doesn't exist. Because OWL was designed for the Internet it uses the opposite Open World assumption, just because some info is not currently in the ontology the reasoner won't infer that the info isn't there. It will only do that if it has some axiom from which it can infer the fact. So in your case, even though the ontology doesn't know that Bob has a car, it won't infer that he doesn't. There could be some data source out there that describes which car Bob owns but that info hasn't been included in the ontology yet. 

You might wonder what's the point of min cardinality restrictions then, but keep in mind these kinds of restrictions are for reasoning not so much about validating data. So for example if I had an individual called Rex and the reasoner didn't have enough info to determine what kind of animal Rex was but then it found that Rex owned a car and the minimum cardinality for owns was 1 for Person but 0 for all other animals it would be able to infer that Rex was a Person.  Or if you had a class called Hippy and declared that the min cardinality for Hippy on owns was 0 and you asserted that Bob was both a Person (min owns 1) and a Hippy (min owns 0) the reasoner would tell you there was an inconsistency. 

There are often work arounds for cases like this although off the top of my head I can't think of one for your example, perhaps someone who is more of an expert on DL has some ideas. 

Michael

On Wed, Aug 8, 2018 at 7:46 AM, Jens Bürger <[hidden email]> wrote:
Dear all,

as given in the attached ontology, I have:

Class "Car" with the indivuals
Porsche
Lincoln
Edsel

Class "Human" with the individuals
Bob
Alice

Object property "owns".

I would like to express that every human needs to own 1 car minimum and 2 cars maximum.

So I modeled:
Alice owns Lincoln.
Alice owns Edsel.

If I additionally add "Alice owns Porsche", then the reasoner (Pellet) complains that the maxCardinality restriction does not hold.

But when removing, there is no complaint regarding Bob. What do I have to add so that the minCardinality restriction produces an error because Bob owns less than 1 car?

Kind regards,
Jens


_______________________________________________
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: How to correctly build a min cardinality restriction?

Lorenz Buehmann
In reply to this post by Jens Bürger



On 08.08.2018 16:46, Jens Bürger wrote:
Dear all,

as given in the attached ontology, I have:

Class "Car" with the indivuals
Porsche
Lincoln
Edsel

Class "Human" with the individuals
Bob
Alice

Object property "owns".

I would like to express that every human needs to own 1 car minimum and 2 cars maximum.

So I modeled:
Alice owns Lincoln.
Alice owns Edsel.

If I additionally add "Alice owns Porsche", then the reasoner (Pellet) complains that the maxCardinality restriction does not hold.
well, only if you explicitly stated that Lincoln and Edsel are different. otherwise, Pellet would just infer that both are the same individual

But when removing, there is no complaint regarding Bob. What do I have to add so that the minCardinality restriction produces an error because Bob owns less than 1 car?
In general, OWL axioms are not constraints like in databases. That's something the community is now trying to address by SHACL.
If you remove it (and I guess you mean the facts about Alice) nothing happens because of the Open World Assumption, i.e. the facts might be somewhere else, just unknown.

Kind regards,
Jens



_______________________________________________
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: How to correctly build a min cardinality restriction?

Jens Bürger
In reply to this post by Michael DeBellis-2
Michael and Lorenz,

thanks for your insights.

Am 08.08.2018 um 21:11 schrieb Michael DeBellis:
[…]
> There are often work arounds for cases like this although off the top of
> my head I can't think of one for your example, perhaps someone who is
> more of an expert on DL has some ideas.
I did some research and came across SWRL.


It would be sufficient for me to define a Class CarlessHuman which every
Human is inferred to be a member of, if he has no car, like demonstrated
in the second paragraph of Protégés SWRL FAQ:
https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ#does-swrl-support-negation-as-failure

"It is easy to see that the addition of a car to the ontology could
invalidate this rule's conclusion. Only individuals with an explicit OWL
axiom stating that they have no car can be safely be concluded to be
without a car:

     Person(?p) ^ (hasCar = 0)(?p) -> CarlessPerson(?p)

"

Because Protégé doesn't accept that syntax what I wrote as rule then is:

Human(?x), (owns exactly 0 Car)(?x) -> CarlessHuman(?x)

But it doesn't work either what I find quite suprising because it
exactly is what is given in the example ?

What I find even more astonishing, a rule

Human(?x), (owns exactly 1 Car)(?x) -> OneCarHuman(?x), given

Alice
  Type Human
  owns Lincoln

does not infer Alice to be a OneCarHuman. I already asserted that all
the humans are different from each other and cars also.


Kind regards,
Jens



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

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Lorenz Buehmann



On 09.08.2018 10:38, Jens Bürger wrote:
Michael and Lorenz,

thanks for your insights.

Am 08.08.2018 um 21:11 schrieb Michael DeBellis:
[…]
There are often work arounds for cases like this although off the top of my head I can't think of one for your example, perhaps someone who is more of an expert on DL has some ideas.
I did some research and came across SWRL.


It would be sufficient for me to define a Class CarlessHuman which every Human is inferred to be a member of, if he has no car, like demonstrated in the second paragraph of Protégés SWRL FAQ:
https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ#does-swrl-support-negation-as-failure

"It is easy to see that the addition of a car to the ontology could invalidate this rule's conclusion. Only individuals with an explicit OWL axiom stating that they have no car can be safely be concluded to be without a car:

    Person(?p) ^ (hasCar = 0)(?p) -> CarlessPerson(?p)

"

Because Protégé doesn't accept that syntax what I wrote as rule then is:

Human(?x), (owns exactly 0 Car)(?x) -> CarlessHuman(?x)

But it doesn't work either what I find quite suprising because it exactly is what is given in the example ?
the rule states that humans with no car are CarlessHumans - but again, Open World Assumption. there might be some car, it's just unknown.
Note, it's standard OWL reasoning when you use Pellet.
The link you showed is from the SWRL API/SWRL Tab - it's totally different. that one uses a rule engine, namely Drools. thus is a different inference algorithm compared to standard tableau based procedure as used by Pellet (JFact, HermiT, etc.)

What I find even more astonishing, a rule

Human(?x), (owns exactly 1 Car)(?x) -> OneCarHuman(?x), given

Alice
 Type Human
 owns Lincoln

does not infer Alice to be a OneCarHuman. I already asserted that all the humans are different from each other and cars also.
Again, the Open World Assumption ... "owns exactly 1 Car" you can't ensure that there are other cars that Alice owns. It's


Kind regards,
Jens




_______________________________________________
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: How to correctly build a min cardinality restriction?

Michael DeBellis-2
In reply to this post by Jens Bürger
Jens, I think what you are now experiencing is due to the current implementation of the SWRLTab in Protege. My understanding is that at this point the SWRLTab doesn't support DL statements such as the ones you described (even though they are part of the spec). That's common of course, it's one thing to have a spec created by a standards group and another for specific tool builder to decide how much of and in what oder to implement the spec. For example, many of the reasoners don't support SWRL builtins, that's why I always use Pellet.  My understanding is that the Protege team will enhance the SWRLTab to support those DL statements sometime in the not too distant future. 

However, there is a work around in the mean time. There are actually two UIs in Protege for writing rules. The more common one used is the SWRLTab. But there is also a Rules pane (a pane is part of a tab, you can arbitrarily add/delete panes to any tab you want). If you go to Window>Views>Ontology views>Rules you will get a new pane that you can put into an existing Protege tab. I usually add it to the DL Query tab but you can put it wherever you want. In that pane you can use DL statements. However, keep in mind that in the Rules view you use a "," to separate statements rather than an "^" so  your rule would look like: 

 Person(?p), (hasCar = 0)(?p) -> CarlessPerson(?p)

I describe this in a bit more detail in my short SWRL Tutorial:


Michael


On Thu, Aug 9, 2018 at 1:38 AM, Jens Bürger <[hidden email]> wrote:
Michael and Lorenz,

thanks for your insights.

Am 08.08.2018 um 21:11 schrieb Michael DeBellis:
[…]
There are often work arounds for cases like this although off the top of my head I can't think of one for your example, perhaps someone who is more of an expert on DL has some ideas.
I did some research and came across SWRL.


It would be sufficient for me to define a Class CarlessHuman which every Human is inferred to be a member of, if he has no car, like demonstrated in the second paragraph of Protégés SWRL FAQ:
https://github.com/protegeproject/swrlapi/wiki/SWRLLanguageFAQ#does-swrl-support-negation-as-failure

"It is easy to see that the addition of a car to the ontology could invalidate this rule's conclusion. Only individuals with an explicit OWL axiom stating that they have no car can be safely be concluded to be without a car:

    Person(?p) ^ (hasCar = 0)(?p) -> CarlessPerson(?p)

"

Because Protégé doesn't accept that syntax what I wrote as rule then is:

Human(?x), (owns exactly 0 Car)(?x) -> CarlessHuman(?x)

But it doesn't work either what I find quite suprising because it exactly is what is given in the example ?

What I find even more astonishing, a rule

Human(?x), (owns exactly 1 Car)(?x) -> OneCarHuman(?x), given

Alice
 Type Human
 owns Lincoln

does not infer Alice to be a OneCarHuman. I already asserted that all the humans are different from each other and cars also.


Kind regards,
Jens



_______________________________________________
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: How to correctly build a min cardinality restriction?

Jens Bürger

Am 09.08.2018 um 18:17 schrieb Michael DeBellis:
[…]
> so  your rule would look like:
>
> Person(?p), (hasCar = 0)(?p) -> CarlessPerson(?p)


Dear Michael,

thanks for your contribution. I already use the Rules tab as described
by you.

My problem by typing in the rule as exemplified by you is that Protégé
(5.2.0) does not accept the syntax, the = to be precise. It expects one
of some, min, max, exactly, ... and so on. That's the reason why I
altered in the first place and came up with:

Person(?p), (hasCar max 0)(?p) -> CarlessPerson(?p)
I also tried other variants, which do not work either:

Person(?p), (hasCar max 0 Car)(?p) -> CarlessPerson(?p)
Person(?p), (hasCar exactly 0 Car)(?p) -> CarlessPerson(?p)

Kind regards,
Jens


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

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Michael DeBellis-2
Jens, Sorry, I didn't read your previous message carefully. If I'm understanding correctly this time, I think the issue is that in the example you started from (the one from the SWRL Faq about negation as failure) you may have been misunderstanding the example. So in this statement:

Person(?p) ^ (hasCar = 0)(?p) -> CarlessPerson(?p)  

My reading of that is that hasCar in this case is now an integer data property, not an object property. So it is an integer that corresponds to the number of cars that the Person owns. In your original example your owns property was an object property pointing to the actual cars that the person owned. I'm guessing that perhaps you are taking "hasCar" to be also an object property. If you make it an integer data property I think it should work as described in the example. I actually have a small Car ontology I created as an example to illustrate something else and I modified it to show this example. 

So I have a subclass in this ontology called Customer and I created a new subclass called CustomerWithOneCar.  I also created a data property called hasNumberOfCars. In this case (this applies to the example in the SWRL FAQ as well) you don't really need to use SWRL, you can just use a defined class. So I created a class called CustomerWithOneCar which is defined as: 

Customer and hasNumberOfCars value  "1"^^xsd:integer

As you can see JaneDoe now gets classified by the reasoner as a  CustomerWithOneCar because I explicitly set her  hasNumberOfCars to 1 (where as JohnSmith is not classified that way even though he has one car as well because I haven't explicitly set the integer value for his data property). 

I'm guessing this isn't what you want.  What I think you want is to automatically infer the number of cars someone owns. That's an example of the kind of thing that is difficult to do with the reasoner due to the OWA (there could always be other cars out there). One way around it is to use the Linked List pattern, there are various re-usable ontologies that implement the list pattern.  Here is one of them that gives you collections such as sets and bags: https://lov.linkeddata.es/dataset/lov/vocabs/coll 

If you have all the cars in a linked list you can traverse the list and count up the number of cars. I actually had the List ontology in mind when I did my SWRL process modeling tutorial, the way I recursively add the durations for each task is somewhat similar. I was going to use the List ontology but I thought it made the example too complex for an intro tutorial. 

If you are thinking "this sure seems like a f&@$ing pain just to count the number of values of a property" you aren't alone. There have been several times I had an idea to model something which would have been very simple and elegant only to get half way through it and hit the brick wall of the OWA. There are good reasons to have it though given the domain that OWL is intended for. 

I posted a question about this on a Google forum devoted to ontologies and there was a long discussion about the OWA and why there isn't a way to just "turn it off" for a specific class or ontology. This is probably way more than you care about but just FYI: https://groups.google.com/forum/#!topic/ontolog-forum/znrDKlWXBT4

Hope I'm understanding things this time and that this sheds some light on it. 

Michael

On Thu, Aug 9, 2018 at 10:26 AM, Jens Bürger <[hidden email]> wrote:

Am 09.08.2018 um 18:17 schrieb Michael DeBellis:
[…]
so  your rule would look like:

Person(?p), (hasCar = 0)(?p) -> CarlessPerson(?p)


Dear Michael,

thanks for your contribution. I already use the Rules tab as described by you.

My problem by typing in the rule as exemplified by you is that Protégé (5.2.0) does not accept the syntax, the = to be precise. It expects one of some, min, max, exactly, ... and so on. That's the reason why I altered in the first place and came up with:

Person(?p), (hasCar max 0)(?p) -> CarlessPerson(?p)
I also tried other variants, which do not work either:

Person(?p), (hasCar max 0 Car)(?p) -> CarlessPerson(?p)
Person(?p), (hasCar exactly 0 Car)(?p) -> CarlessPerson(?p)

Kind regards,
Jens


_______________________________________________
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

CarExample.owl (34K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Jens Bürger
In reply to this post by Lorenz Buehmann
Am 09.08.2018 um 11:09 schrieb Lorenz Buehmann:
[…]
> The link you showed is from the SWRL API/SWRL Tab - it's totally
> different. that one uses a rule engine, namely Drools. thus is a
> different inference algorithm compared to standard tableau based
> procedure as used by Pellet (JFact, HermiT, etc.)

That's no problem for me, as long as it helps me reaching my goal :)


> Again, the Open World Assumption ... "owns exactly 1 Car" you can't
> ensure that there are other cars that Alice owns.

Then I don't understand why expressions like these are possible. In
other words: what would be an example of such an expression where it has
an actual effect?

Regarding my problem: is there a way I can achieve to somehow grasp the
set of Humans that don't own a car?

I already read about local closed world reasoning, which (sh/c)ould help
me, but as far as I see TrOWL is the only reasoner supporting this.
Unfortunately, it is technically outdated, the Protégé plugin is
compatible with Protégé 4.3 and OWL-API 3. This is critical for me
because I also work with ONT-API which requires OWL-API 5.x.

However, I tried it, too. It works by annotating classes with a
annotation property "close"
(http://trowl.org/documentation/using-local-closed-world-reasoning-in-trowl/).
However, I tried different versions and combinations of it, either
nothing happens when I assume the reasoning to do something, or the
ontology is said to be inconsistend but in every case no explanation was
displayed.

Kind regards,

Jens


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

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Lorenz Buehmann
In reply to this post by Michael DeBellis-2

As far as I understood, he is not using the SWRLTab (clicking on "Run") but the standard OWL reasoner. In that case, the Open World Assumption holds. Using the SWRLTab means to run the Drools engine to perform OWL RL reasoning based on rules.


On 09.08.2018 20:58, Michael DeBellis wrote:
Jens, Sorry, I didn't read your previous message carefully. If I'm understanding correctly this time, I think the issue is that in the example you started from (the one from the SWRL Faq about negation as failure) you may have been misunderstanding the example. So in this statement:

Person(?p) ^ (hasCar = 0)(?p) -> CarlessPerson(?p)  

My reading of that is that hasCar in this case is now an integer data property, not an object property. So it is an integer that corresponds to the number of cars that the Person owns. In your original example your owns property was an object property pointing to the actual cars that the person owned. I'm guessing that perhaps you are taking "hasCar" to be also an object property. If you make it an integer data property I think it should work as described in the example. I actually have a small Car ontology I created as an example to illustrate something else and I modified it to show this example. 

So I have a subclass in this ontology called Customer and I created a new subclass called CustomerWithOneCar.  I also created a data property called hasNumberOfCars. In this case (this applies to the example in the SWRL FAQ as well) you don't really need to use SWRL, you can just use a defined class. So I created a class called CustomerWithOneCar which is defined as: 

Customer and hasNumberOfCars value  "1"^^xsd:integer

As you can see JaneDoe now gets classified by the reasoner as a  CustomerWithOneCar because I explicitly set her  hasNumberOfCars to 1 (where as JohnSmith is not classified that way even though he has one car as well because I haven't explicitly set the integer value for his data property). 

I'm guessing this isn't what you want.  What I think you want is to automatically infer the number of cars someone owns. That's an example of the kind of thing that is difficult to do with the reasoner due to the OWA (there could always be other cars out there). One way around it is to use the Linked List pattern, there are various re-usable ontologies that implement the list pattern.  Here is one of them that gives you collections such as sets and bags: https://lov.linkeddata.es/dataset/lov/vocabs/coll 

If you have all the cars in a linked list you can traverse the list and count up the number of cars. I actually had the List ontology in mind when I did my SWRL process modeling tutorial, the way I recursively add the durations for each task is somewhat similar. I was going to use the List ontology but I thought it made the example too complex for an intro tutorial. 

If you are thinking "this sure seems like a f&@$ing pain just to count the number of values of a property" you aren't alone. There have been several times I had an idea to model something which would have been very simple and elegant only to get half way through it and hit the brick wall of the OWA. There are good reasons to have it though given the domain that OWL is intended for. 

I posted a question about this on a Google forum devoted to ontologies and there was a long discussion about the OWA and why there isn't a way to just "turn it off" for a specific class or ontology. This is probably way more than you care about but just FYI: https://groups.google.com/forum/#!topic/ontolog-forum/znrDKlWXBT4

Hope I'm understanding things this time and that this sheds some light on it. 

Michael

On Thu, Aug 9, 2018 at 10:26 AM, Jens Bürger <[hidden email]> wrote:

Am 09.08.2018 um 18:17 schrieb Michael DeBellis:
[…]
so  your rule would look like:

Person(?p), (hasCar = 0)(?p) -> CarlessPerson(?p)


Dear Michael,

thanks for your contribution. I already use the Rules tab as described by you.

My problem by typing in the rule as exemplified by you is that Protégé (5.2.0) does not accept the syntax, the = to be precise. It expects one of some, min, max, exactly, ... and so on. That's the reason why I altered in the first place and came up with:

Person(?p), (hasCar max 0)(?p) -> CarlessPerson(?p)
I also tried other variants, which do not work either:

Person(?p), (hasCar max 0 Car)(?p) -> CarlessPerson(?p)
Person(?p), (hasCar exactly 0 Car)(?p) -> CarlessPerson(?p)

Kind regards,
Jens


_______________________________________________
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


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

Re: How to correctly build a min cardinality restriction?

Jens Bürger
In reply to this post by Michael DeBellis-2
Am 09.08.2018 um 20:58 schrieb Michael DeBellis:
> Jens, Sorry, I didn't read your previous message carefully. If I'm
> understanding correctly this time, I think the issue is that in the
> example you started from (the one from the SWRL Faq about negation as
> failure) you may have been misunderstanding the example. So in this
> statement:
>
> Person(?p) ^ (hasCar = 0)(?p) -> CarlessPerson(?p)

Oh boy, you are right!
I was so focused on my specific problem and the resemblance to my
problem that I fully ignored that the reason for the not accepted = is
that "hasCar" in the SWRL example is an integer property.

[…]
> I'm guessing this isn't what you want.

Right.

> What I think you want is to
> automatically infer the number of cars someone owns.

Getting the *number* is not that important, but somehow grasp all humans
that don't own a car is what I try to achieve.

I want to use this because my approach wants to assure that every human
owns at least one car.

[…]

> Hope I'm understanding things this time and that this sheds some light
> on it.

Thanks again, it actually did shed some light, while the problem then
remains unsolved so far.

Thinking about your list idea: would this not require additional (even
manual) work?
I'd like to solve the problem as "natural" way as possible. As soon as I
have to drop this requirement because every OWL-own way fails because of
OWA, I can e.g. just do some SPARQL queries.

Kind regards, Jens


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

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Jens Bürger
In reply to this post by Lorenz Buehmann
Am 10.08.2018 um 08:07 schrieb Lorenz Buehmann:
> As far as I understood, he is not using the SWRLTab (clicking on "Run")
> but the standard OWL reasoner. In that case, the Open World Assumption
> holds. Using the SWRLTab means to run the Drools engine to perform OWL
> RL reasoning based on rules.

You understood it right!

I am actually using the "Rules" view of Protégé, not the SWRLTab. So, I
apparently currently let the selected reasoner (in my case Pellet) do
work over the rules.

The thing is: When I write the following rule into the "Rules" view of
Protégé:
Rule: Human(?x), (not (HumanWithCar))(?x) -> CarlessHuman(?x)

opening it in the SWRLTab it is displayed as:

test:Human(?x) ^ [Anonymous class expressions not implemented](?x) ->
test:CarlessHuman(?x)


And if I try to write it in the SWRLTab as follows:

test:Human(?x) ^ (not test:HumanWithCar)(?x) -> test:CarlessHuman(?x)

it is not accepted with the error:
"NOT may be used only in a class or property expression"

what I don't understand, I think that's exactly what the second
expression is?

I found this thread of this mailing list from last year, regarding the
exact same problem:
http://protege-project.136.n4.nabble.com/Question-about-writing-classical-negation-in-SWRLTab-td4669083.html

Interestingy, the recommendation of Michael DeBellis was to use the
"Rules" view instead %-)

So, from my point of view it sums up to the following:

A rule like

Human(?x), (not HumanWithCar)(?x) -> CarlessHuman(?x)

can be expressed in Protégés Rule view, but has no effect because the
rules are worked through by the reasoner, which has OWA.

In the SWRLTab, the rules are not worked through by a reasoner but by
"Drools" instead. But apparently, while SWRL in principal supports
negation like this, it is currently not supported by the implementation
behind SWRLTab, giving a (confusing) error message.

Is this correct so far?

Kind regards,
Jens


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

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to correctly build a min cardinality restriction?

Martin O'Connor-2


On Aug 10, 2018, at 1:55 AM, Jens Bürger <[hidden email]> wrote:
The thing is: When I write the following rule into the "Rules" view of Protégé:
Rule: Human(?x), (not (HumanWithCar))(?x) -> CarlessHuman(?x)

opening it in the SWRLTab it is displayed as:

test:Human(?x) ^ [Anonymous class expressions not implemented](?x) -> test:CarlessHuman(?x)

The SWRLAPI (which is the API used by the SWRLTab) does not support class expressions in rules.  

It is a hole I’d like to plug but, unfortunately, there is no timeline for its implementation.

In the SWRLTab, the rules are not worked through by a reasoner but by "Drools" instead.

This is not correct. The SWRLAPI implements a reasoner that supports the OWL 2 RL language profile [1]. 

A brief description of OWL language profiles from that paper:

"The OWL 2 W3C Recommendation includes several language profiles. These profiles are restricted subsets of OWL that trade some expressivity to provide more desirable computational guarantees. Primarily, these profiles restrict the types of OWL constructs that can be used in an ontology or place syntactic restrictions on how those constructs can be used. Three profiles are provided: OWL 2 EL, which is designed for ontologies that contain a large number of classes or properties; OWL 2 QL, which is aimed primarily at query answering; and OWL 2 RL, which is aimed at applications that require quite a bit of the expressivity provided by OWL 2 DL but also require scalable reasoning. Many real world ontologies do not use the full set of features provides by OWL 2 DL and often fall into one or more of these profiles."

All OWL profiles adopt the open world assumption. There is no closed world OWL language profile. The open world assumption is pretty much baked into OWL.

Drools is an implementation detail - reasoning semantics in the SWRLAPI are driven by the OWL 2 RL specification. (In fact, an earlier implementation of the SWRLAPI also used the Jess rule engine. Both Jess and Drools implementations provided identical reasoning semantics.)

Martin


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