Hello dear Virtuoso-users!

I am a newbie in Virtuoso, and I am seeking for your advises since I didn't 
manage to solve my problem with the Virtuoso documentation I considered 
relevant. So probably you may point out what I am doing wrong or where I could 
look for more detail. I would appreciate any help!

I am using Virtuoso Open Source Edition v.6.1( from debian packages). I am 
using its native quad store to store my RDF files and to post queries against 
its SPARQL-endpoint to mash-up data from my files with the data from external 
data sets. My Virtuoso instance is running locally.

I was following tutorials [1], [2] and 16.2 Section [3] from the Virutoso 
documentation to construct queries which would retrieve data from my local 
graphs and DBpedia. I was also looking at the example queries from [4]. But 
still I think I am missing something regarding what different "grab-" pragmas 
do.

For example, in my data sets I have statistical data about cities and I set up 
"owl:sameAs" links to the DBpedia cities. I want to be able to retrieve 
"geo:lat" and "geo:long" values for my cities from DBpedia.

I tried the following pragmas:

 1) "grab-var":

define input:grab-var "dbpediaConcept"

2) "same-as" + "grab-follow-predicate"

define input:same-as "yes"
define input:grab-follow-predicate geo:lat
define input:grab-follow-predicate geo:long

3) "grab:all"

define input:grab-all "yes"

And the query itself is:
select distinct ?myConcept ?lat ?long
where
{?myConcept owl:sameAs ?dbpediaConcept .

 ?dbpediaConcept <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ;
                                   
<http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long . 
}

But with these queries I returned only subset of "myConcept". The simplest 
explanation is that "owl:sameAs" links were set up wrong. But I checked 
them...and I run the same federated query which did return all the data from 
my data sets bounded with the DBpedia data:

select * where
{  
   SERVICE <http://dbpedia.org/sparql>

   {?x <http://www.w3.org/2003/01/geo/wgs84_pos#lat> ?lat ;
         <http://www.w3.org/2003/01/geo/wgs84_pos#long> ?long .}

   ?myConcept owl:sameAs ?x .
}

I believe I am missing some other pragmas in my extended SPARQL queries or I am 
using them wrong? I would greatly appreciate if you could advise me what I am 
doing wrong... 

Thank you,
Tatiana

[1] 
http://www.openlinksw.co.uk/virtuoso/Whitepapers/html/VirtSpongerWhitePaper.html#AncSPARQL1
[2] 
http://www.openlinksw.co.uk/virtuoso/Whitepapers/html/VirtSpongerWhitePaper.html#AncSPARQL2
[3] http://docs.openlinksw.com/virtuoso/rdfiridereferencing.html
[4] 
http://virtuoso.openlinksw.com/presentations/SPARQL_Tutorials/SPARQL_Tutorials_Part_7/SPARQL_Tutorials_Part_7.html#(24)

Reply via email to