What is the purpose of SWRL rules?
Asked Answered
C

2

16

Can anybody explain the purpose of SWRL rules. As far as I have understood, SWRL rules are same as stored procedures in SQL. I have made a few rules, but don't know how to utilize them in my application through query. I don't know whether I am thinking in the right way the SWRL rules are meant for, or not. Please show me the correct way of using them.

Look at this rule:

Patient(?x) ^ hasValue_heartrate(?x, >160) -> Sick(?x)

In my ontology I have Patient class, but no Sick class & not even hasValue_heartrate property. So should I have to create these? Or how can I use above rule in my ontology?

Cereal answered 26/3, 2011 at 8:24 Comment(0)
G
11

Rules are a way of expressing additional things that can be inferred from your dataset. Some inferences can be gleaned from the ontology model itself, but others may not be expressible in the ontology language (usually OWL) and require a more functional representation. You should note that SWRL never quite became a standard and its usage is beginning to be discouraged. See the question latest best support for SWRL at answers.semanticweb.com

Edit:

You should consider instead using SPIN. To quote this thread:

now that SPIN is a W3C submission, it has reached the same standard status as SWRL. Furthermore, SPIN has key advantages to SWRL:

  • It uses SPARQL - a standard supported by every RDF store
  • Unlike SWRL, SPIN is an active effort. SWRL has been made obsolete by RIF while SPIN is complementary to RIF

RIF is an in-progress W3C effort, which once standardized would deprecate SWRL. SPIN is a W3C Team Submission, an inference engine called TopSpin exists within Top Braid Composer.

The answers.semanticweb.com community may be of more help.

Getup answered 26/3, 2011 at 16:28 Comment(1)
Edit 2: You should consider instead using SHACL. For the reasons above + spinrdf.org/spin-shacl.htmlDey
D
5

SWRL can be seen as an extension to OWL. Semantically it layers nicely on top of OWL and is normally used for statements that OWL cannot express. Syntactically it does not layer that nicely on top of OWL because it introduces a completely new syntax (note e.g. the explicit variables). However, some people prefer SWRL's syntax to OWL's and use SWRL even for statements that could be successfully expressed in OWL (e.g. your example axiom is expressible in OWL as well).

To understand the differenced between OWL and SWRL read e.g.

I would definitely encourage you to use SWRL. ;)

(Whether or not you have to explicitly "create" or "declare" a class before referring to it probably depends on your ontology editor or reasoning tools.)

Dylane answered 29/3, 2011 at 9:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.