1

Everyone,

I'm used to Protégé but now, I'm trying to use SWRLTab, a Protégé plugin.

The problem is that I'm really not familiar with the SWRL rule-syntax. Let's have fun with my problem :

I've an well-known ontology, called "pizza". Let's say I've a 4cheesesPizza, subclass of Pizza.

I don't want to write the "hasTopping exactly 4 CheesyTopping" thing in the "Equivalent To" tab of Protégé BUT I want to write it in the SWRL Rule syntax. (yes I know it's stupid, but this is an example and in my real case, write a rule makes sense).

I tried something like Pizza(?p) ^ hasTopping(?p,?t) but next, I'm quite blocked. I don't know what to do.

Moreover, when I launch OWL + SWRL -> Drools , in the Inferred Axioms there's already more than 100 lines, It's unreadable.

If someone has the solution,

Thanks, Clément

Clement B
  • 218
  • 1
  • 4
  • 14
  • 1
    Both, OWL and SWRL work on the Open World Assumption, thus, it doesn't work unless some kind of Closed World Reasoning would be applied. – UninformedUser Feb 03 '18 at 09:10

1 Answers1

1

What you want to do in SWRL is not possible. I.e. SWRL will need to count the number of individuals that are in a hasTopping relation with a specific individual p of type Pizza. SWRL cannot do that, but the OWL reasoner can, hence what you have specified in Protege is the correct way to do it.

As an example for SWRL syntax, assume you have classes ExpensiveTopping and ExpensivePizza you could add a rule in the SWRL tab to determine an expensive pizza:

Pizza(?p) ^ hasTopping(?p,?t) ^ ExpensiveTopping(?t) -> ExpensivePizza(?p).

Henriette Harmse
  • 4,167
  • 1
  • 13
  • 22
  • An OWL reasoner can do that? Really? 1) In OWL there is **no unique names assumption (UNA)**, thus, the individuals would have to be declared as pairwise distinct explicitly via OWL axioms. 2) In OWL we have the **open world assumption (OWA)**, i.e. something like `hasTopping exactly 4 CheesyTopping` can't work that easy because there could be more `hasTopping` relations to `CheesyTopping` which are just not known - that's the idea of OWA. Thus, an OWL reasoner cannot infer that an individual `x` belongs to class `4cheesesPizza` given 4 `hasTopping` relations. – UninformedUser Feb 03 '18 at 09:09
  • Yip, that is correct, though I tried to answer the actual question wrt SWRL. – Henriette Harmse Feb 03 '18 at 09:23
  • I referred to your statement *"SWRL cannot do that,* **but the OWL reasoner can"** - that's a bit too general from my point of view – UninformedUser Feb 03 '18 at 10:30
  • SWRL is an extension of OWL, so everything that OWL can do, SWRL can too. – Antoine Zimmermann Feb 07 '18 at 19:09
  • Thanks for your answer. It works. I wasn't thinking it was like that. Clément – Clement B Feb 08 '18 at 10:18
  • Another question which is nearly on the same subject : Based on Henriette's example, let's say that `ExpensiveTopping` is a class filled by another rule : does it works ? Indeed, it means that we are creating a rule that is calling a class filled by another rule ! (I tried something on my own and it doesn't work : it's bypassing the `ExpensiveTopping(?t)` call. Thanks, Clément – Clement B Feb 09 '18 at 14:46