Rita; I'm not aware of any comparisons of SPARQL and SWRL.  You might
check W3C sources.  Please note that SWRL never made it past a W3C's
submission (http://www.w3.org/Submission/SWRL/) and is a consideration
of the current RIF working group.  SWRL is not a W3C recommendation.
Composer does support SWRL - see > Developing Ontologies > Semantic
Web Standards > SWRL.

There are not any queries "that can be expressed in SQWRL but not in
SPARQL".  The main difference is that SWRL is designed to understand
OWL semantics.  This can easily be replicated in SPARQL by running the
query over triples inferred by an RDFS or OWL reasoner.  In addition,
SPARQL queries can be created to make the inferences.

I don't know about the example you cite, but let's take this one:

Class A
Class B subclassof A
Individual z type B

... and you want to get that the type of Z is both A and B.  This can
be done with SPARQL:

Method 1: Run inferences and query. In Composer, turn on "Use
Currently Configured Inferences" in the SPARQL view and execute the
query:
SELECT *
WHERE {?i rdf:type A}

Method 2: Run a query to find all individuals subsumed by A :
SELECT *
WHERE {?cls rdfs:subClassOf* unnamed2:ClassA .
 ?i rdf:type ?cls}

An advantage here is that inferences do not need to be executed.  The
query computes the subclass "inference" from the data.

In general SPARQL will be more expressive because it is a query
language, not an inference language for RDFS/OWL.  Since RDFS and OWL
are a small part of the possible data structures one may want to use,
any general query language will be more general.  SWRL does allow for
triple patterns, but lacks other features for querying triples, such
as OPTIONAL, FILTER, UNION, etc.  SPARQL 1.1 adds more, such as
aggregates and updating the data.

-- Scott


On Jun 2, 11:21 am, Rita Marnau <[email protected]> wrote:
> Hi everyone,
>
> for my thesis I compare different technologies to realize constraint
> checking for ontologies.
> I am currently interested between the difference between SPARQL and
> SWRL/SQWRL.
> In the FAQ (http://spinrdf.org/faq.html) it is said that " SPIN is more
> expressive than SWRL, because SPARQL has various features such as UNIONs
> and FILTER expressions"
>
> In the Protege Mailinglist, the opposite is affirmed.
> (https://mailman.stanford.edu/pipermail/protege-owl/2009-September/012...)
> "SPARQL can be used to query OWL ontologies if they are serialized as  
> RDF triples but has no understanding of the semantics associated/ /with
> those triples/."
> /Martin O'Connor gives an example that can be expressed in SQWRL but not
> in SPARQL.
>
> Now, I am lost. Is there a good reference for the comparison between
> SPARQL/SWRL/SQWRL ?
> Have you an example for the statement, that SPARQL is more expressive
> than SWRL ?
>
> Thanks a lot.
>
> Rita

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en

Reply via email to