> Is the above query known to be valid ie has been run elsewhere or is this > just a general spatial join query you are trying to get working ? I got inspired to write the query this way from the tutorial : http://virtuoso.openlinksw.com/tutorials/sparql/SPARQL_Tutorials_Part_10/SPARQL_Tutorials_Part_10.html#(4)
Essentially, my query wants to retrieve cities ?long and ?nlong which are at a distance of 100 k.m. from each other. I am not able to understand as to what should be the syntax for this query (which Virtuoso also supports). Can you please help me with this a bit? On Tue, Feb 23, 2016 at 10:58 PM, Hugh Williams <hwilli...@openlinksw.com> wrote: > Hi Maria, > > Running against the latest Virtuoso open source release I get a slightly > different error running the query against your data: > > SQL> DB.DBA.TTLP_MT (file_to_string_output('./spatialTest.nq'), > '','<http://localhost:8890/DAV/dbpedia>',512); > > Done. -- 13 msec. > SQL> sparql select ?place ?nplace (( bif:st_distance( ?long,?nlong) ) AS > ?distance) WHERE {graph ?g1{?place > <http://www.opengis.net/ont/geosparql#asWKT> ?long} graph ?g4{?nplace > <http://www.opengis.net/ont/geosparql#asWKT> ?nlong}}; > > *** Error 22023: VD [Virtuoso Server]GEO..: Function st_distance() expects a > geometry of type 1 as argument 0, not geometry of type 10242 > at line 2 of Top-Level: > sparql select ?place ?nplace (( bif:st_distance( ?long,?nlong) ) AS > ?distance) WHERE {graph ?g1{?place > <http://www.opengis.net/ont/geosparql#asWKT> ?long} graph ?g4{?nplace > <http://www.opengis.net/ont/geosparql#asWKT> ?nlong}} > SQL> status(''); > REPORT > VARCHAR > _______________________________________________________________________________ > > OpenLink Virtuoso Server > Version 07.20.3216-pthreads for Darwin as of Feb 16 2016 > > > Is the above query known to be valid ie has been run elsewhere or is this > just a general spatial join query you are trying to get working ? > > Best Regards > Hugh Williams > Professional Services > OpenLink Software, Inc. // http://www.openlinksw.com/ > Weblog -- http://www.openlinksw.com/blogs/ > LinkedIn -- http://www.linkedin.com/company/openlink-software/ > Twitter -- http://twitter.com/OpenLink > Google+ -- http://plus.google.com/100570109519069333827/ > Facebook -- http://www.facebook.com/OpenLinkSoftware > Universal Data Access, Integration, and Management Technology Providers > > > > On 23 Feb 2016, at 12:47, Maria Jackson <maria.jackson....@gmail.com> wrote: > > I loaded the following file in Virtuoso (version 07.20.3213): > "<http://geoknow.eu/uk_natural#natural_2371851> > <http://www.opengis.net/ont/geosparql#asWKT> "POLYGON ((77.164230 > 33.187725,77.164188 33.188013,77.164066 33.188336,77.164457 > 33.188676,77.164685 33.188861,77.165012 33.189296,77.165467 > 33.188591,77.165490 33.188213,77.165085 33.188057,77.164811 > 33.187902,77.164230 > 33.187725))"^^<http://www.w3.org/2003/01/geo/wgs84_pos#Geometry> > <http://a/id_1>. > <http://geoknow.eu/uk_natural#natural_2729539> > <http://www.opengis.net/ont/geosparql#asWKT> "POLYGON ((78.748611 > 32.748742,78.748728 32.748925,78.749925 32.749764,78.750246 > 32.749882,78.750630 32.749916,78.750850 32.749906,78.751046 > 32.749875,78.751275 32.749807,78.751502 32.749698,78.751676 > 32.749548,78.751743 32.749407,78.751792 32.749271,78.75778 > 32.749124,78.751735 32.749024,78.751651 32.748885,78.751526 > 32.748773,78.751369 32.748673,78.750919 32.748439,78.750465 > 32.748209,78.750064 32.748093,78.749692 32.748034,78.749341 > 32.748049,78.749006 32.748166,78.748721 32.748348,78.748604 > 32.748523,78.748611 > 32.748742))"^^<http://www.w3.org/2003/01/geo/wgs84_pos#Geometry> > <http://a/id_4>. > <http://geoknow.eu/uk_natural#natural_2817555> > <http://www.opengis.net/ont/geosparql#asWKT> "POLYGON ((2.79723 > -122.934,2.79897 -122.9314,2.797231 > -122.9342))"^^<http://www.w3.org/2003/01/geo/wgs84_pos#Geometry> > <http://a/id_7>." > > using: > DB.DBA.TTLP_MT (file_to_string_output > ('/home/virtuoso/share/virtuoso/vad/spatialTest.nq'), '', > '<http://localhost:8890/DAV/dbpedia>',512); > > After which I ran the following query: > SQL> sparql select ?place ?nplace (( bif:st_distance( ?long,?nlong) ) > AS ?distance) WHERE {graph ?g1{?place > <http://www.opengis.net/ont/geosparql#asWKT> ?long} graph ?g4{?nplace > <http://www.opengis.net/ont/geosparql#asWKT> ?nlong}}; > > Which gave me the following error: > *** Error 22032: [Virtuoso Driver][Virtuoso Server]GEO..: Function > st_distance() expects a geometry as argument 0 > > Can someone please guide me as to where am I going wrong and how I run > spatial join queries in Virtuoso? > > ------------------------------------------------------------------------------ > Site24x7 APM Insight: Get Deep Visibility into Application Performance > APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month > Monitor end-to-end web transactions and take corrective actions now > Troubleshoot faster and improve end-user experience. Signup Now! > http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 > _______________________________________________ > Virtuoso-users mailing list > Virtuoso-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/virtuoso-users > > ------------------------------------------------------------------------------ Site24x7 APM Insight: Get Deep Visibility into Application Performance APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month Monitor end-to-end web transactions and take corrective actions now Troubleshoot faster and improve end-user experience. Signup Now! http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140 _______________________________________________ Virtuoso-users mailing list Virtuoso-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/virtuoso-users