is properly formatted and I suggest someone revise the documentation. as you pointed out you need something after hasCar such as "max" or "min" or "exactly" if you are going to then compare it to a number. The only way that rule makes sense to me is if hasCar is a data property with an integer value.
However, I think the most important issue is that you may be misunderstanding what the SWRL documentation meant. Forget about SWRL for a minute because you could just use that same DL to create a defined class:
CarLessPerson Equivalent To Person and hasCar max 0
If you then expect that any instance of Person that has no values for hasCar will be classified as a CarLessPerson that is not what will happen because of the Open World Assumption (OWA). That's an essential difference between OWL and other languages. Unless there is some axiom that explicitly states that some Person has 0 cars then the reasoner won't assume it's true just because at this point the ontology doesn't include the info on what Car(s) the Person has. The default assumption is that there may always be some additional info out there that isn't in the ontology. Since the goal is to provide a semantic layer for the Internet that was the design decision.
The other issue is that the SWRL Tab as currently implemented doesn't support embedding DL syntax into rules. That is part of the standard it's just the SWRL tab doesn't support that part of the standard yet. That's common in tools, there is often a gap between what a standard created by a committee of lots of people defines and how much of it any particular tool implements. Also, personally I can understand why this hasn't yet been included in the SWRL tab because I've been using SWRL for a while and I've never come up against a situation where I needed DL in a rule that I couldn't put on a defined class just as easily and get the same result.
If you want to use DL in rules there is another UI you can use called the Rules pane. You have to explicitly add it to some Tab because it's not part of the UI by default. In that pane you use "," instead of "^" so your rule would look like:
Person(?p), (hasCar max 0)(?p) ->CarlessPerson(?p)
I included the example just for completeness. Also, while I'm at it, a common source of confusion in the SWRL tab are those Drools buttons. Here is a brief tutorial for all new SWRL users on what you need to know about Drools:
Ignore it. End of Tutorial.
Drools is very useful for some people. But for new SWRL users you won't need to use it or even know what it does and it is better to use the Pellet reasoner and then just run the reasoner and it will fire your rules for you as well as all the other things it does.
On Fri, Jul 19, 2019 at 12:13 PM Лещева Ирина Анатольевна <[hidden email]> wrote:
have found that it should be possible to write a SWRL-rule like this: