Geosparql across graphs

2 views
Skip to first unread message

s.ar...@geophy.com

unread,
Dec 13, 2016, 7:04:26 AM12/13/16
to Stardog
I am trying to run a geosparql query cross graphs but it does not seems to work right.

Does stardog support this type of query? 

Am I missing anything?

prefix g: <http://geophy.com/>

select * where {
  
  graph  <http://geophy.com/>{
       <http://geophy.data/fm#10> geo:hasGeometry ?a .
   }
 ?hq geo:hasGeometry ?b  .
  
  
 ?a geof:nearby (?b 10 <http://qudt.org/vocab/unit#Kilometer>).
}
 

Michael Grove

unread,
Dec 13, 2016, 7:46:45 AM12/13/16
to stardog
I suspect it's probably your query construction that is the problem. You're getting bindings for ?a from the graph http://geophy.com at the outset, but then later you're using querying w/ ?a and nearby over the default graph. So what binds to ?a in those two cases will be different sets of things and is probably the reason for the empty results.

Cheers,

Mike 
 
 

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+unsubscribe@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Zachary Whitley

unread,
Dec 13, 2016, 7:48:24 AM12/13/16
to sta...@clarkparsia.com
Can you describe "doesn't work right"? Does it return an error or just not the results you were expecting? I'd double check the prefixes, especially the qudt. It's not exactly clear what prefix should be used with qudt. The Stardog docs mention which one was chosen for Stardog. 
--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+u...@clarkparsia.com.

Samur Araujo

unread,
Dec 13, 2016, 9:15:15 AM12/13/16
to sta...@clarkparsia.com
The query never finishes and timeouts.

Here the is another example.

 <http://geophy.data/fm#10> geo:hasGeometry ?a .   
 ?t geo:hasGeometry ?b  .  
 ?a geof:nearby (?b  1  <http://qudt.org/vocab/unit#Meter>).
}


The query run on top of geonames data.

The geometries where created with:

insert {
 ?s geo:hasGeometry ?geometry .
 ?geometry a  sf:Point .
 ?geometry geo:asWKT ?point.

         } where {
 ?s ws:lat ?lat .
 ?s  ws:long ?lon .

 bind(strdt(concat("Point(", str(?lon)," ", str(?lat),")"),geo:wktLiteral )  as ?point) .
 bind(URI(concat("http://geophy.data/lon-lat/", str(?lon),"-", str(?lat) )) as ?geometry) .
}


On 13 December 2016 at 13:48, Zachary Whitley <zachary...@wavestrike.com> wrote:
Can you describe "doesn't work right"? Does it return an error or just not the results you were expecting? I'd double check the prefixes, especially the qudt. It's not exactly clear what prefix should be used with qudt. The Stardog docs mention which one was chosen for Stardog. 

On Dec 13, 2016, at 7:04 AM, s.ar...@geophy.com wrote:

I am trying to run a geosparql query cross graphs but it does not seems to work right.

Does stardog support this type of query? 

Am I missing anything?

prefix g: <http://geophy.com/>

select * where {
  
  graph  <http://geophy.com/>{
       <http://geophy.data/fm#10> geo:hasGeometry ?a .
   }
 ?hq geo:hasGeometry ?b  .
  
  
 ?a geof:nearby (?b 10 <http://qudt.org/vocab/unit#Kilometer>).
}
 

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to the Google Groups "Stardog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stardog+unsubscribe@clarkparsia.com.

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Stardog" group.
To unsubscribe from this topic, visit https://groups.google.com/a/clarkparsia.com/d/topic/stardog/h2sOfaHwG24/unsubscribe.
To unsubscribe from this group and all its topics, send an email to stardog+unsubscribe@clarkparsia.com.



--
Senior Data Scientist 
Geophy 

Nieuwe Plantage 54-55
2611XK  Delft
+31 (0)70 7640725 

1 Fore Street
EC2Y 9DT  London
+44 (0)20 37690760

Samur Araujo

unread,
Dec 13, 2016, 9:16:51 AM12/13/16
to sta...@clarkparsia.com
If I load less data, the query completes correctly, so there is not issue with the query but I guess is a performance issue for stardog.

Could you confirm whether there is an issue on geospatial queries? Any benchmark available? 

Michael Grove

unread,
Dec 14, 2016, 7:04:15 AM12/14/16
to stardog
On Tue, Dec 13, 2016 at 9:15 AM, Samur Araujo <s.ar...@geophy.com> wrote:
The query never finishes and timeouts.

Here the is another example.

prefix g: <http://geophy.com/>

select  * where {
        
 <http://geophy.data/fm#10> geo:hasGeometry ?a .   
 ?t geo:hasGeometry ?b  .  
 ?a geof:nearby (?b  1  <http://qudt.org/vocab/unit#Meter>).
}


This query will iterate over every single spatial feature in the database and see if its within 1m of http://geophy.data/fm#10, that's probably not what you were intending. It explains why with less data the query completes more quickly; fewer things to iterate over. It's more efficient to get all the things w/in 1m of your location than it is to iterate over everything and see if each is nearby.

Cheers,

Mike

Samur Araujo

unread,
Dec 14, 2016, 8:06:05 AM12/14/16
to sta...@clarkparsia.com
Hi Mike, thank you for the explanation.

Are you proposing to the function geof:within instead? if so, how can I transform a point into a geometry using stardog? 

Maybe, could you please give me the right syntax of what you propose?

Best,
Samur

Michael Grove

unread,
Dec 14, 2016, 8:09:51 AM12/14/16
to stardog
On Wed, Dec 14, 2016 at 8:05 AM, Samur Araujo <s.ar...@geophy.com> wrote:
Hi Mike, thank you for the explanation.

Are you proposing to the function geof:within instead? if so, how can I transform a point into a geometry using stardog? 

Maybe, could you please give me the right syntax of what you propose?

Have you tried switching ?a and ?b in the call to nearby?

Samur Araujo

unread,
Dec 14, 2016, 8:33:01 AM12/14/16
to sta...@clarkparsia.com
Yes. Still slow. :(
Reply all
Reply to author
Forward
0 new messages