Sparql and subclasses

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Sparql and subclasses

Marisa Santos Amaro
Hi, dear friends from OWL list !!
 
I have some doubts about SPARQL and RACER running to query a Protege ontology.
1) SPARQL
In the ontology below, SPARQL shows me only asserted instances of first level classes (like I3)and instances of subclasses located  at the second level of hierarchical model,  like I1 and  I2.
- Class A
    > Class A1
    > Class A2  >> I1
- Class B >>  I3
    > Class B1
    > Class B2 >> I2
        > Class B21    >> I4
                              >> I5 
I´d like to get all instances of Class B and of its subclasses, in all levels down, but the following query returns just I2 and I3. The instances I4 and I5 of Class B21 (a second level subclass) are not selected. 
  SELECT   ?z
  WHERE  {?x    rdfs:subClasOf    :ClassB  .
                 {?z    a   ?x}    UNION
                 {?z    a   :ClassB}  }
2) RACER
Running this reasoner, why it do not put asserted instances of ClassB21 as inferred ones of classes ClassB1 and ClassB ? 
 
Thanks for any help.
 
Marisa.

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: Sparql and subclasses

Chema .
Hi Marisa,
 
Probably, sparql engine in protege works with the open model of the ontologies (only classes and instances declared by the user, not inferred by the reasoner), therefore the query do not retrieve the expected result.

A simple solution could be ask, explicitily, for the instances in the query, something as:

1-Obtain all classes we want to retrieve their instances.
2-Union with these classes to  look up their instances
3-It is a bad solution, not scale and the union operation in sparql has a high cost

select ?in
where
{
{ {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  union {?cl rdfs:subClassOf  :Bi}}.
?in rdf:type ?cl
}
                
Another solution ant the good way is close the model, after we can run the query over declared and inferred classes/instances.
I don't know how to close the model in protege, i usually use a simple program created with Java, Jena and Arq to run  this kind of queries.

Bye, Chema

On 4/1/07, Marisa Santos Amaro <[hidden email]> wrote:
Hi, dear friends from OWL list !!
 
I have some doubts about SPARQL and RACER running to query a Protege ontology.
1) SPARQL
In the ontology below, SPARQL shows me only asserted instances of first level classes (like I3)and instances of subclasses located  at the second level of hierarchical model,  like I1 and  I2.
- Class A
    > Class A1
    > Class A2  >> I1
- Class B >>  I3
    > Class B1
    > Class B2 >> I2
        > Class B21    >> I4
                              >> I5 
I´d like to get all instances of Class B and of its subclasses, in all levels down, but the following query returns just I2 and I3. The instances I4 and I5 of Class B21 (a second level subclass) are not selected. 
  SELECT   ?z
  WHERE  {?x    rdfs:subClasOf    :ClassB  .
                 {?z    a   ?x}    UNION
                 {?z    a   :ClassB}  }
2) RACER
Running this reasoner, why it do not put asserted instances of ClassB21 as inferred ones of classes ClassB1 and ClassB ? 
 
Thanks for any help.
 
Marisa.

_______________________________________________
protege-owl mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://mailman.stanford.edu/mailman/listinfo/protege-owl" target="_blank">https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://protege.stanford.edu/doc/faq.html#01a.03" target="_blank">http://protege.stanford.edu/doc/faq.html#01a.03



_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: Sparql and subclasses

Marisa Santos Amaro
Thanks for your suggestion, Chema !!
The "Queries" tab of Protege returns all the instances (the inferred, too), but Sparql actually doesn´t do it. I´ll  try Jena code and check the results.
 
Best regards !!
Marisa.

 
On 4/1/07, Chema . <[hidden email]> wrote:
Hi Marisa,
 
Probably, sparql engine in protege works with the open model of the ontologies (only classes and instances declared by the user, not inferred by the reasoner), therefore the query do not retrieve the expected result.

A simple solution could be ask, explicitily, for the instances in the query, something as:

1-Obtain all classes we want to retrieve their instances.
2-Union with these classes to  look up their instances
3-It is a bad solution, not scale and the union operation in sparql has a high cost

select ?in
where
{
{ {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  union {?cl rdfs:subClassOf  :Bi}}.
?in rdf:type ?cl
}
                
 
Another solution ant the good way is close the model, after we can run the query over declared and inferred classes/instances.
I don't know how to close the model in protege, i usually use a simple program created with Java, Jena and Arq to run  this kind of queries.

Bye, Chema

On 4/1/07, Marisa Santos Amaro <[hidden email]> wrote:
Hi, dear friends from OWL list !!
 
I have some doubts about SPARQL and RACER running to query a Protege ontology.
1) SPARQL
In the ontology below, SPARQL shows me only asserted instances of first level classes (like I3)and instances of subclasses located  at the second level of hierarchical model,  like I1 and  I2.
- Class A
    > Class A1
    > Class A2  >> I1
- Class B >>  I3
    > Class B1
    > Class B2 >> I2
        > Class B21    >> I4
                              >> I5 
I´d like to get all instances of Class B and of its subclasses, in all levels down, but the following query returns just I2 and I3. The instances I4 and I5 of Class B21 (a second level subclass) are not selected. 
  SELECT   ?z
  WHERE  {?x    rdfs:subClasOf    :ClassB  .
                 {?z    a   ?x}    UNION
                 {?z    a   :ClassB}  }
2) RACER
Running this reasoner, why it do not put asserted instances of ClassB21 as inferred ones of classes ClassB1 and ClassB ? 
 
Thanks for any help.
 
Marisa.

_______________________________________________
protege-owl mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://mailman.stanford.edu/mailman/listinfo/protege-owl" target="_blank">https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://protege.stanford.edu/doc/faq.html#01a.03" target="_blank">http://protege.stanford.edu/doc/faq.html#01a.03



_______________________________________________
protege-owl mailing list
[hidden email]
<a onclick="return top.js.OpenExtLink(window,event,this)" href="https://mailman.stanford.edu/mailman/listinfo/protege-owl" target="_blank">https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://protege.stanford.edu/doc/faq.html#01a.03" target="_blank">http://protege.stanford.edu/doc/faq.html#01a.03




--
      Marisa de Oliveira Santos Amaro
             Capitão-de-Fragata ( T )
     Superintendente de Infra-estrutura e
   Serviços de Tecnologia da Informação
Diretoria de Finanças da Marinha - DFM

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: Sparql and subclasses

Rajverma

Hi,

 

is there any manual or information about how to formulate (syntax) the queries in the Queries tab of Protégé?

 

Thanx,

Raj

 


From: [hidden email] [mailto:[hidden email]] On Behalf Of Marisa Santos Amaro
Sent: Montag, 2. April 2007 02:03
To: User support for the Protege-OWL editor
Subject: Re: [protege-owl] Sparql and subclasses

 

Thanks for your suggestion, Chema !!

The "Queries" tab of Protege returns all the instances (the inferred, too), but Sparql actually doesn´t do it. I´ll  try Jena code and check the results.

 

Best regards !!

Marisa.

 

On 4/1/07, Chema . <[hidden email]> wrote:

Hi Marisa,
 
Probably, sparql engine in protege works with the open model of the ontologies (only classes and instances declared by the user, not inferred by the reasoner), therefore the query do not retrieve the expected result.

A simple solution could be ask, explicitily, for the instances in the query, something as:

1-Obtain all classes we want to retrieve their instances.
2-Union with these classes to  look up their instances
3-It is a bad solution, not scale and the union operation in sparql has a high cost

select ?in
where
{
{ {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  union {?cl rdfs:subClassOf  :Bi}}.
?in rdf:type ?cl
}

                
 

Another solution ant the good way is close the model, after we can run the query over declared and inferred classes/instances.
I don't know how to close the model in protege, i usually use a simple program created with Java, Jena and Arq to run  this kind of queries.

Bye, Chema

On 4/1/07, Marisa Santos Amaro <[hidden email]> wrote:

Hi, dear friends from OWL list !!

 

I have some doubts about SPARQL and RACER running to query a Protege ontology.

1) SPARQL
In the ontology below, SPARQL shows me only asserted instances of first level classes (like I3)and instances of subclasses located  at the second level of hierarchical model,  like I1 and  I2.

- Class A

    > Class A1

    > Class A2  >> I1

- Class B >>  I3

    > Class B1

    > Class B2 >> I2

        > Class B21    >> I4

                              >> I5 

I´d like to get all instances of Class B and of its subclasses, in all levels down, but the following query returns just I2 and I3. The instances I4 and I5 of Class B21 (a second level subclass) are not selected. 

  SELECT   ?z

  WHERE  {?x    rdfs:subClasOf    :ClassB  .

                 {?z    a   ?x}    UNION

                 {?z    a   :ClassB}  }

2) RACER

Running this reasoner, why it do not put asserted instances of ClassB21 as inferred ones of classes ClassB1 and ClassB ? 

 

Thanks for any help.

 

Marisa.


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03



_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03




--
      Marisa de Oliveira Santos Amaro
             Capitão-de-Fragata ( T )
     Superintendente de Infra-estrutura e
   Serviços de Tecnologia da Informação
Diretoria de Finanças da Marinha - DFM


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: Sparql and subclasses

Martin O'Connor

As of 3.3 beta build 390 there is now a SWRLQueryTab:
http://protege.cim3.net/cgi-bin/wiki.pl?SWRLQueryTab

Using query built-ins, this query can be written in SWRL as:

B(?b) -> query:select(?b)

Martin

Mudunuri, Raj wrote:

> Hi,
>
>  
>
> is there any manual or information about how to formulate (syntax) the
> queries in the Queries tab of Protégé?
>
>  
>
> Thanx,
>
> Raj
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* [hidden email]
> [mailto:[hidden email]] *On Behalf Of
> *Marisa Santos Amaro
> *Sent:* Montag, 2. April 2007 02:03
> *To:* User support for the Protege-OWL editor
> *Subject:* Re: [protege-owl] Sparql and subclasses
>
>  
>
> Thanks for your suggestion, Chema !!
>
> The "Queries" tab of Protege returns all the instances (the inferred,
> too), but Sparql actually doesn´t do it. I´ll  try Jena code and check
> the results.
>
>  
>
> Best regards !!
>
> Marisa.
>
>  
>
> On 4/1/07, *Chema .* <[hidden email] <mailto:[hidden email]>>
> wrote:
>
> Hi Marisa,
>  
> Probably, sparql engine in protege works with the open model of the
> ontologies (only classes and instances declared by the user, not
> inferred by the reasoner), therefore the query do not retrieve the
> expected result.
>
> A simple solution could be ask, explicitily, for the instances in the
> query, something as:
>
> 1-Obtain all classes we want to retrieve their instances.
> 2-Union with these classes to  look up their instances
> 3-It is a bad solution, not scale and the union operation in sparql
> has a high cost
>
> select ?in
> where
> {
> { {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  
> union {?cl rdfs:subClassOf  :Bi}}.
> ?in rdf:type ?cl
> }
>
>                
>  
>
> Another solution ant the good way is close the model, after we can run
> the query over declared and inferred classes/instances.
> I don't know how to close the model in protege, i usually use a simple
> program created with Java, Jena and Arq to run  this kind of queries.
>
> Bye, Chema
>
> On 4/1/07, *Marisa Santos Amaro* < [hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi, dear friends from OWL list !!
>
>      
>
>     I have some doubts about SPARQL and RACER running to query a
>     Protege ontology.
>
>     1) SPARQL
>     In the ontology below, SPARQL shows me only asserted instances of
>     first level classes (like I3)and instances of subclasses located
>      at the second level of hierarchical model,  like I1 and  I2.
>
>     - Class A
>
>         > Class A1
>
>         > Class A2  >> I1
>
>     - Class B >>  I3
>
>         > Class B1
>
>         > Class B2 >> I2
>
>             > Class B21    >> I4
>
>                                   >> I5
>
>     I´d like to get all instances of Class B and of its subclasses, in
>     all levels down, but the following query returns just I2 and I3.
>     The instances I4 and I5 of Class B21 (a second level subclass) are
>     not selected.
>
>       SELECT   ?z
>
>       WHERE  {?x    rdfs:subClasOf    :ClassB  .
>
>                      {?z    a   ?x}    UNION
>
>                      {?z    a   :ClassB}  }
>
>     2) RACER
>
>     Running this reasoner, why it do not put asserted instances of
>     ClassB21 as inferred ones of classes ClassB1 and ClassB ?
>
>      
>
>     Thanks for any help.
>
>      
>
>     Marisa.
>
>
>     _______________________________________________
>     protege-owl mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://mailman.stanford.edu/mailman/listinfo/protege-owl
>     <https://mailman.stanford.edu/mailman/listinfo/protege-owl>
>
>     Instructions for unsubscribing:
>     http://protege.stanford.edu/doc/faq.html#01a.03
>
>
>
> _______________________________________________
> protege-owl mailing list
> [hidden email] <mailto:[hidden email]>
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
>
>
>
> --
>       Marisa de Oliveira Santos Amaro
>              Capitão-de-Fragata ( T )
>      Superintendente de Infra-estrutura e
>    Serviços de Tecnologia da Informação
> Diretoria de Finanças da Marinha - DFM
>
>------------------------------------------------------------------------
>
>_______________________________________________
>protege-owl mailing list
>[hidden email]
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>  
>

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: Sparql and subclasses

JMiller

Martin,

Can you summarize the reason(s) for using SWRL for queries, instead of SPARQL?

Jim Miller
Sr Software Engineer II
Raytheon IIS, Garland
972.205.4233 office



"Martin O'Connor" <[hidden email]>
Sent by: [hidden email]

04/02/2007 12:47 PM

Please respond to
User support for the Protege-OWL editor        <[hidden email]>

To
User support for the Protege-OWL editor <[hidden email]>
cc
Subject
Re: [protege-owl] Sparql and subclasses






As of 3.3 beta build 390 there is now a SWRLQueryTab:
http://protege.cim3.net/cgi-bin/wiki.pl?SWRLQueryTab

Using query built-ins, this query can be written in SWRL as:

B(?b) -> query:select(?b)

Martin

Mudunuri, Raj wrote:

> Hi,
>
>  
>
> is there any manual or information about how to formulate (syntax) the
> queries in the Queries tab of Protégé?
>
>  
>
> Thanx,
>
> Raj
>
>  
>
> ------------------------------------------------------------------------
>
> *From:* [hidden email]
> [mailto:[hidden email]] *On Behalf Of
> *Marisa Santos Amaro
> *Sent:* Montag, 2. April 2007 02:03
> *To:* User support for the Protege-OWL editor
> *Subject:* Re: [protege-owl] Sparql and subclasses
>
>  
>
> Thanks for your suggestion, Chema !!
>
> The "Queries" tab of Protege returns all the instances (the inferred,
> too), but Sparql actually doesn´t do it. I´ll  try Jena code and check
> the results.
>
>  
>
> Best regards !!
>
> Marisa.
>
>  
>
> On 4/1/07, *Chema .* <[hidden email] <mailto:[hidden email]>>
> wrote:
>
> Hi Marisa,
>  
> Probably, sparql engine in protege works with the open model of the
> ontologies (only classes and instances declared by the user, not
> inferred by the reasoner), therefore the query do not retrieve the
> expected result.
>
> A simple solution could be ask, explicitily, for the instances in the
> query, something as:
>
> 1-Obtain all classes we want to retrieve their instances.
> 2-Union with these classes to  look up their instances
> 3-It is a bad solution, not scale and the union operation in sparql
> has a high cost
>
> select ?in
> where
> {
> { {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  
> union {?cl rdfs:subClassOf  :Bi}}.
> ?in rdf:type ?cl
> }
>
>                
>  
>
> Another solution ant the good way is close the model, after we can run
> the query over declared and inferred classes/instances.
> I don't know how to close the model in protege, i usually use a simple
> program created with Java, Jena and Arq to run  this kind of queries.
>
> Bye, Chema
>
> On 4/1/07, *Marisa Santos Amaro* < [hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi, dear friends from OWL list !!
>
>      
>
>     I have some doubts about SPARQL and RACER running to query a
>     Protege ontology.
>
>     1) SPARQL
>     In the ontology below, SPARQL shows me only asserted instances of
>     first level classes (like I3)and instances of subclasses located
>      at the second level of hierarchical model,  like I1 and  I2.
>
>     - Class A
>
>         > Class A1
>
>         > Class A2  >> I1
>
>     - Class B >>  I3
>
>         > Class B1
>
>         > Class B2 >> I2
>
>             > Class B21    >> I4
>
>                                   >> I5
>
>     I´d like to get all instances of Class B and of its subclasses, in
>     all levels down, but the following query returns just I2 and I3.
>     The instances I4 and I5 of Class B21 (a second level subclass) are
>     not selected.
>
>       SELECT   ?z
>
>       WHERE  {?x    rdfs:subClasOf    :ClassB  .
>
>                      {?z    a   ?x}    UNION
>
>                      {?z    a   :ClassB}  }
>
>     2) RACER
>
>     Running this reasoner, why it do not put asserted instances of
>     ClassB21 as inferred ones of classes ClassB1 and ClassB ?
>
>      
>
>     Thanks for any help.
>
>      
>
>     Marisa.
>
>
>     _______________________________________________
>     protege-owl mailing list
>     [hidden email] <mailto:[hidden email]>
>     https://mailman.stanford.edu/mailman/listinfo/protege-owl
>     <https://mailman.stanford.edu/mailman/listinfo/protege-owl>
>
>     Instructions for unsubscribing:
>     http://protege.stanford.edu/doc/faq.html#01a.03
>
>
>
> _______________________________________________
> protege-owl mailing list
> [hidden email] <mailto:[hidden email]>
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
>
>
>
> --
>       Marisa de Oliveira Santos Amaro
>              Capitão-de-Fragata ( T )
>      Superintendente de Infra-estrutura e
>    Serviços de Tecnologia da Informação
> Diretoria de Finanças da Marinha - DFM
>
>------------------------------------------------------------------------
>
>_______________________________________________
>protege-owl mailing list
>[hidden email]
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>  
>

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03


_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
Reply | Threaded
Open this post in threaded view
|

Re: Sparql and subclasses

Martin O'Connor

First I should start with the important caveat that SPARQL has been
available for several years and is supported on multiple platforms.
SWRL's query extensions have just been released and are supported only
in Protege-OWL 3.3 beta.

That said, I would suggest several reasons for using SWRL queries over
SPARQL queries:

. One of the primary characteristics of OWL DL is its guarantees of
formal soundness. SWRL retains these guarantees. SWRL's increased
expressivity does lead to undecidability of inference. However, any
inferences that are made are formally sound. OWL DL's inference is
decidable - but the worst case decidability performance guarantee is
pretty bad; and while inference with SWRL may be theoretically
undecidable, in practice almost all inferences terminate in a reasonable
amount of time. The distinction between the two may not necessarily mean
much in the real world.

With SPARQL these formal guarantees are mostly lost:

    . SPARQL is an RDF query language, not an OWL query language. SPARQL
knows nothing about OWL restrictions, or the distinction between object
and datatype properties, for example, and by default completely ignores
these during execution. It can work with OWL because OWL concepts are
often (though not necessarily) stored as RDF triples.

    . What's worse, SPARQL does not even have formally sound semantics
in terms of RDF. There has been a lot of recent work in coming up with
formal semantics for SPARQL (see [1], for example) but in general there
are no guarantees about the soundness of results returned by a SPARQL
query even on an RDF ontology.

    . SPARQL is a query language, not a rule language. It is designed
primarily to pull knowledge out of an ontology. SWRL is primarily a rule
language and allows inferred knowledge to be placed back into an
ontology - in  addition to now querying that ontology. While SPARQL has
a CONSTRUCT keyword that can be used to effectively place inferred
knowledge in an ontology, it is far from elegant. And because of its
unclear semantics, such inferences may not be sound. Ensuring sound
inference (that does not introduce nonmonotonoicity, for example) is a
basic requirement of any OWL DL based rule language.

. SWRL queries are usually far more concise than equivalent SPARQL
queries; cf. the example in this thread.

. With built-ins SWRL is extensible [2].

. SWRL rules are saved in an OWL ontology and can be considered to be
logically a part of their associated ontology. SPARQL queries are
usually saved in flat files have no formally specified link to the
ontology over which they are written.

. SWRL can work in conjunction with reasoners in an automatic and
formally sound way [3].

. A lot of current semantic web rule research is focusing on increasing
the expressivity of SWRL-like rule and query languages while retaining
formal guarantees. SWRL can exploit these extension (cf. DL-safe SWRL
rules in [3] for example). Given SPARQL's unclear core semantics, its
ability to use these extensions is not so obvious.

Martin

[1] http://arxiv.org/abs/cs.DB/0605124
[2] http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTabBuiltInLibraries
[3] http://kaon2.semanticweb.org/


James A Miller wrote:

>
> Martin,
>
> Can you summarize the reason(s) for using SWRL for queries, instead of
> SPARQL?
>
> Jim Miller
> Sr Software Engineer II
> Raytheon IIS, Garland
> 972.205.4233 office
>
>
>
> *"Martin O'Connor" <[hidden email]>*
> Sent by: [hidden email]
>
> 04/02/2007 12:47 PM
> Please respond to
> User support for the Protege-OWL editor      
>  <[hidden email]>
>
>
>
> To
> User support for the Protege-OWL editor
> <[hidden email]>
> cc
>
> Subject
> Re: [protege-owl] Sparql and subclasses
>
>
>
>
>
>
>
>
>
>
> As of 3.3 beta build 390 there is now a SWRLQueryTab:
> http://protege.cim3.net/cgi-bin/wiki.pl?SWRLQueryTab
>
> Using query built-ins, this query can be written in SWRL as:
>
> B(?b) -> query:select(?b)
>
> Martin
>
> Mudunuri, Raj wrote:
>
> > Hi,
> >
> >  
> >
> > is there any manual or information about how to formulate (syntax) the
> > queries in the Queries tab of Protégé?
> >
> >  
> >
> > Thanx,
> >
> > Raj
> >
> >  
> >
> > ------------------------------------------------------------------------
> >
> > *From:* [hidden email]
> > [mailto:[hidden email]] *On Behalf Of
> > *Marisa Santos Amaro
> > *Sent:* Montag, 2. April 2007 02:03
> > *To:* User support for the Protege-OWL editor
> > *Subject:* Re: [protege-owl] Sparql and subclasses
> >
> >  
> >
> > Thanks for your suggestion, Chema !!
> >
> > The "Queries" tab of Protege returns all the instances (the inferred,
> > too), but Sparql actually doesn´t do it. I´ll  try Jena code and check
> > the results.
> >
> >  
> >
> > Best regards !!
> >
> > Marisa.
> >
> >  
> >
> > On 4/1/07, *Chema .* <[hidden email] <mailto:[hidden email]>>
> > wrote:
> >
> > Hi Marisa,
> >  
> > Probably, sparql engine in protege works with the open model of the
> > ontologies (only classes and instances declared by the user, not
> > inferred by the reasoner), therefore the query do not retrieve the
> > expected result.
> >
> > A simple solution could be ask, explicitily, for the instances in the
> > query, something as:
> >
> > 1-Obtain all classes we want to retrieve their instances.
> > 2-Union with these classes to  look up their instances
> > 3-It is a bad solution, not scale and the union operation in sparql
> > has a high cost
> >
> > select ?in
> > where
> > {
> > { {?cl   rdfs:subClassOf    :B0 } union {?cl rdfs:subClassOf  :B1}  
> > union {?cl rdfs:subClassOf  :Bi}}.
> > ?in rdf:type ?cl
> > }
> >
> >                
> >  
> >
> > Another solution ant the good way is close the model, after we can run
> > the query over declared and inferred classes/instances.
> > I don't know how to close the model in protege, i usually use a simple
> > program created with Java, Jena and Arq to run  this kind of queries.
> >
> > Bye, Chema
> >
> > On 4/1/07, *Marisa Santos Amaro* < [hidden email]
> > <mailto:[hidden email]>> wrote:
> >
> >     Hi, dear friends from OWL list !!
> >
> >      
> >
> >     I have some doubts about SPARQL and RACER running to query a
> >     Protege ontology.
> >
> >     1) SPARQL
> >     In the ontology below, SPARQL shows me only asserted instances of
> >     first level classes (like I3)and instances of subclasses located
> >      at the second level of hierarchical model,  like I1 and  I2.
> >
> >     - Class A
> >
> >         > Class A1
> >
> >         > Class A2  >> I1
> >
> >     - Class B >>  I3
> >
> >         > Class B1
> >
> >         > Class B2 >> I2
> >
> >             > Class B21    >> I4
> >
> >                                   >> I5
> >
> >     I´d like to get all instances of Class B and of its subclasses, in
> >     all levels down, but the following query returns just I2 and I3.
> >     The instances I4 and I5 of Class B21 (a second level subclass) are
> >     not selected.
> >
> >       SELECT   ?z
> >
> >       WHERE  {?x    rdfs:subClasOf    :ClassB  .
> >
> >                      {?z    a   ?x}    UNION
> >
> >                      {?z    a   :ClassB}  }
> >
> >     2) RACER
> >
> >     Running this reasoner, why it do not put asserted instances of
> >     ClassB21 as inferred ones of classes ClassB1 and ClassB ?
> >
> >      
> >
> >     Thanks for any help.
> >
> >      
> >
> >     Marisa.
> >
> >
> >     _______________________________________________
> >     protege-owl mailing list
> >     [hidden email]
> <mailto:[hidden email]>
> >     https://mailman.stanford.edu/mailman/listinfo/protege-owl
> >     <https://mailman.stanford.edu/mailman/listinfo/protege-owl>
> >
> >     Instructions for unsubscribing:
> >     http://protege.stanford.edu/doc/faq.html#01a.03
> >
> >
> >
> > _______________________________________________
> > protege-owl mailing list
> > [hidden email] <mailto:[hidden email]>
> > https://mailman.stanford.edu/mailman/listinfo/protege-owl
> >
> > Instructions for unsubscribing:
> > http://protege.stanford.edu/doc/faq.html#01a.03
> >
> >
> >
> >
> > --
> >       Marisa de Oliveira Santos Amaro
> >              Capitão-de-Fragata ( T )
> >      Superintendente de Infra-estrutura e
> >    Serviços de Tecnologia da Informação
> > Diretoria de Finanças da Marinha - DFM
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >protege-owl mailing list
> >[hidden email]
> >https://mailman.stanford.edu/mailman/listinfo/protege-owl
> >
> >Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
> >  
> >
>
> _______________________________________________
> protege-owl mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>
>------------------------------------------------------------------------
>
>_______________________________________________
>protege-owl mailing list
>[hidden email]
>https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
>Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>  
>

_______________________________________________
protege-owl mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03