0

I'm new to SQWRL, so I'm doing some tests in a ontology I created in a course.

In that ontology, there's a class named BallpointPen, that has some kinds of ballpoint pens as subclasses; also, there's a class named PenCharacteristic, which has the possible characteristics for pens as individuals.

I want to verify which ballpoint pens (that are subclasses of the class BallpointPen) have the characteristic Refillable (which is an individual of the class PenCharacteristic). For that, I declared the following SQWRL query:

tbox:sca(?x, BallpointPen) ^ hasCharacteristic(?x, Refillable) -> sqwrl:select(?x)

It should point two answers: the classes MyInnovativeBallpointPen and RefillableBallpointPen, but it shows no results. Could someone please help me with this?

Daniel
  • 27
  • 5
  • `hasCharacteristic(?x, Refillable)` seems problematic to me. Do you really have an object property that connects classes and individuals? Or I can't understand you. – Stanislav Kralin Apr 18 '18 at 14:48
  • Yes. There's a object property called hasCharacteristic. The classes MyInnovativeBallpointPen and RefillableBallpointPen (that should have shown up as results of the query) are linked to the individual Refillable through that property. – Daniel Apr 18 '18 at 15:11

1 Answers1

0

After some research, I found out that the query cannot be done, at least not with SQWRL, because it cannot work with classes and instances at the same time. One way to do it would be to turn BallpointPen subclasses (which include the answers to the query I was trying to do) into instances.

The only way to make the query in the way that ontology currently is, is by using DL Query. In the DL Query tab (on Protégé), just type and execute:

BallpointPen and hasCharacteristic value Refillable

This will show the proper results.

Daniel
  • 27
  • 5