You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Kenneth Nagin <NA...@il.ibm.com> on 2014/05/04 08:30:01 UTC

jena fuseki sparql query with owl, but results empty

I have installed jena and fuseki and have verified that it works.
I am now trying use verify its owl support but my queries are not 
returning any results.
I have taken the examples from Learning SPARQL chapter 9 RDF Schemas and 
OWL, and Inferencing. 
I've run the examples using the Fuseki console, but they return empty 
results sets.  For instance I upload ex046.ttl, ran the query in ex047.rq, 
but the results are empty.

What am I doing wrong?

# filename: ex046.ttl
@prefix ab:   <http://learningsparql.com/ns/addressbook#> .
@prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .

ab:i0432 
   ab:firstName "Richard" ;
   ab:lastName  "Mutt" ;
   ab:spouse    ab:i9771 . 

ab:i8301
   ab:firstName "Craig" ;
   ab:lastName  "Ellis" ;
   ab:patient   ab:i9771 . 

ab:i9771
   ab:firstName "Cindy" ; 
   ab:lastName  "Marshall" . 

ab:spouse
   rdf:type owl:SymmetricProperty ; 
   rdfs:comment "Identifies someone's spouse" .

ab:patient 
   rdf:type rdf:Property ;
   rdfs:comment "Identifies a doctor's patient" . 

ab:doctor 
   rdf:type rdf:Property ;
   rdfs:comment "Identifies a doctor treating the named resource" ;
   owl:inverseOf ab:patient . 


# filename: ex047.rq
PREFIX ab: <http://learningsparql.com/ns/addressbook#>
SELECT ?doctorFirst ?doctorLast ?spouseFirst ?spouseLast
WHERE 
{
   ?s ab:firstName "Cindy" ;
      ab:lastName "Marshall" ;
      ab:doctor ?doctor ;
      ab:spouse ?spouse . 

?doctor ab:firstName ?doctorFirst ;
        ab:lastName ?doctorLast .

?spouse ab:firstName ?spouseFirst ;
        ab:lastName ?spouseLast .
}

Results:

-------------------------------------------------------
| doctorFirst | doctorLast | spouseFirst | spouseLast |
=======================================================
-------------------------------------------------------


Best Regards,

Kenneth Nagin
Ph: +972-4-8296227
Cell: 054-6976227
Fx: +972-4- 8296114
http://researcher.ibm.com/view.php?person=il-NAGIN



Re: jena fuseki sparql query with owl, but results empty

Posted by Kenneth Nagin <NA...@il.ibm.com>.
Best Regards,

Kenneth Nagin
Ph: +972-4-8296227
Cell: 054-6976227
Fx: +972-4- 8296114
http://researcher.ibm.com/view.php?person=il-NAGIN




Dave Reynolds <da...@gmail.com> wrote on 04/05/2014 11:37:27 AM:

> From: Dave Reynolds <da...@gmail.com>
> To: users@jena.apache.org, 
> Date: 04/05/2014 11:38 AM
> Subject: Re: jena fuseki sparql query with owl, but results empty
> 
> On 04/05/14 07:30, Kenneth Nagin wrote:
> > I have installed jena and fuseki and have verified that it works.
> > I am now trying use verify its owl support but my queries are not
> > returning any results.
> > I have taken the examples from Learning SPARQL chapter 9 RDF Schemas 
and
> > OWL, and Inferencing.
> > I've run the examples using the Fuseki console, but they return empty
> > results sets.  For instance I upload ex046.ttl, ran the query in 
ex047.rq,
> > but the results are empty.
> >
> > What am I doing wrong?
> 
> At a guess you don't have inference enabled.
> 
> I believe you can configure an inference model (with e.g. OWLMicro) 
> using assemblers - you can probably find a recipe on-line or maybe 
> someone more able to drive assemblers can help.
> 
> Dave
> 
Could someone tell me how to configure jena/fuseki to support inferencing?

> > # filename: ex046.ttl
> > @prefix ab:   <http://learningsparql.com/ns/addressbook#> .
> > @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> > @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> > @prefix owl:  <http://www.w3.org/2002/07/owl#> .
> >
> > ab:i0432
> >     ab:firstName "Richard" ;
> >     ab:lastName  "Mutt" ;
> >     ab:spouse    ab:i9771 .
> >
> > ab:i8301
> >     ab:firstName "Craig" ;
> >     ab:lastName  "Ellis" ;
> >     ab:patient   ab:i9771 .
> >
> > ab:i9771
> >     ab:firstName "Cindy" ;
> >     ab:lastName  "Marshall" .
> >
> > ab:spouse
> >     rdf:type owl:SymmetricProperty ;
> >     rdfs:comment "Identifies someone's spouse" .
> >
> > ab:patient
> >     rdf:type rdf:Property ;
> >     rdfs:comment "Identifies a doctor's patient" .
> >
> > ab:doctor
> >     rdf:type rdf:Property ;
> >     rdfs:comment "Identifies a doctor treating the named resource" ;
> >     owl:inverseOf ab:patient .
> >
> >
> > # filename: ex047.rq
> > PREFIX ab: <http://learningsparql.com/ns/addressbook#>
> > SELECT ?doctorFirst ?doctorLast ?spouseFirst ?spouseLast
> > WHERE
> > {
> >     ?s ab:firstName "Cindy" ;
> >        ab:lastName "Marshall" ;
> >        ab:doctor ?doctor ;
> >        ab:spouse ?spouse .
> >
> > ?doctor ab:firstName ?doctorFirst ;
> >          ab:lastName ?doctorLast .
> >
> > ?spouse ab:firstName ?spouseFirst ;
> >          ab:lastName ?spouseLast .
> > }
> >
> > Results:
> >
> > -------------------------------------------------------
> > | doctorFirst | doctorLast | spouseFirst | spouseLast |
> > =======================================================
> > -------------------------------------------------------
> >
> >
> > Best Regards,
> >
> > Kenneth Nagin
> > Ph: +972-4-8296227
> > Cell: 054-6976227
> > Fx: +972-4- 8296114
> > http://researcher.ibm.com/view.php?person=il-NAGIN
> >
> >
> >
> 

Re: jena fuseki sparql query with owl, but results empty

Posted by Dave Reynolds <da...@gmail.com>.
On 04/05/14 07:30, Kenneth Nagin wrote:
> I have installed jena and fuseki and have verified that it works.
> I am now trying use verify its owl support but my queries are not
> returning any results.
> I have taken the examples from Learning SPARQL chapter 9 RDF Schemas and
> OWL, and Inferencing.
> I've run the examples using the Fuseki console, but they return empty
> results sets.  For instance I upload ex046.ttl, ran the query in ex047.rq,
> but the results are empty.
>
> What am I doing wrong?

At a guess you don't have inference enabled.

I believe you can configure an inference model (with e.g. OWLMicro) 
using assemblers - you can probably find a recipe on-line or maybe 
someone more able to drive assemblers can help.

Dave

> # filename: ex046.ttl
> @prefix ab:   <http://learningsparql.com/ns/addressbook#> .
> @prefix rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
> @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
> @prefix owl:  <http://www.w3.org/2002/07/owl#> .
>
> ab:i0432
>     ab:firstName "Richard" ;
>     ab:lastName  "Mutt" ;
>     ab:spouse    ab:i9771 .
>
> ab:i8301
>     ab:firstName "Craig" ;
>     ab:lastName  "Ellis" ;
>     ab:patient   ab:i9771 .
>
> ab:i9771
>     ab:firstName "Cindy" ;
>     ab:lastName  "Marshall" .
>
> ab:spouse
>     rdf:type owl:SymmetricProperty ;
>     rdfs:comment "Identifies someone's spouse" .
>
> ab:patient
>     rdf:type rdf:Property ;
>     rdfs:comment "Identifies a doctor's patient" .
>
> ab:doctor
>     rdf:type rdf:Property ;
>     rdfs:comment "Identifies a doctor treating the named resource" ;
>     owl:inverseOf ab:patient .
>
>
> # filename: ex047.rq
> PREFIX ab: <http://learningsparql.com/ns/addressbook#>
> SELECT ?doctorFirst ?doctorLast ?spouseFirst ?spouseLast
> WHERE
> {
>     ?s ab:firstName "Cindy" ;
>        ab:lastName "Marshall" ;
>        ab:doctor ?doctor ;
>        ab:spouse ?spouse .
>
> ?doctor ab:firstName ?doctorFirst ;
>          ab:lastName ?doctorLast .
>
> ?spouse ab:firstName ?spouseFirst ;
>          ab:lastName ?spouseLast .
> }
>
> Results:
>
> -------------------------------------------------------
> | doctorFirst | doctorLast | spouseFirst | spouseLast |
> =======================================================
> -------------------------------------------------------
>
>
> Best Regards,
>
> Kenneth Nagin
> Ph: +972-4-8296227
> Cell: 054-6976227
> Fx: +972-4- 8296114
> http://researcher.ibm.com/view.php?person=il-NAGIN
>
>
>