Hi Maria,

It looks fine, why are you having a problem with it ?

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 15 Apr 2016, at 05:47, Maria Jackson <maria.jackson....@gmail.com> wrote:
> 
> Dear Hugh,
> 
> Thanks for the information. We used the following query, please verify
> that it is the correct way of querying Virtuoso.
> 
> sparql select ?place ?nplace ?lat1 ?long1 ?lat2 ?long2 WHERE  {graph
> ?g1{?place <http://www.opengis.net/ont/geosparql#hasLatitude> ?lat1}
> graph ?g1{?place <http://www.opengis.net/ont/geosparql#hasLongitude>
> ?long1}  graph ?g4{?nplace
> <http://www.opengis.net/ont/geosparql#hasLatitude> ?lat2} graph
> ?g4{?nplace <http://www.opengis.net/ont/geosparql#hasLongitude>
> ?long2}. 
> FILTER(bif:st_intersects(bif:st_point(xsd:decimal(?long1),xsd:decimal(?lat1)),bif:st_point(xsd:decimal(?long2),xsd:decimal(?lat2)),176.7))};
> 
> 
> 
> 
> On Tue, Apr 12, 2016 at 4:53 PM, Hugh Williams <hwilli...@openlinksw.com> 
> wrote:
>> Hi Maria,
>> 
>> You  should use http://www.openlinksw.com/schemas/virtrdf#Geometry  instead 
>> of http://www.w3.org/2003/01/geo/wgs84_pos#Geometry as the geometry type  in 
>> the datasets being loaded then it will work. Note also that -122.934 is not 
>> a valid Geometry value which should be -90 to 90 , otherwise you get a 
>> message to that effect when trying to load:
>> 
>> SQL> DB.DBA.TTLP_MT (file_to_string_output('./spatialTest2.nq'), 
>> '','<http://localhost:8890/DAV/dbpedia>',512);
>> 
>> *** Error 22023: VD [Virtuoso Server]GEO11: The point coordinates are 
>> spherical degrees and the latitude is out of range -90..90 (near row 1 col 
>> 24 of 'POINT (2.79723 -122.934)')
>> in
>> __xqf_str_parse_to_rdf_box:(BIF),
>> DB.DBA.TTLP_RL_GS_TRIPLE_L([executable]/ttlpv.sql:418),
>> rdf_load_turtle:(BIF),
>> DB.DBA.TTLP_V_GS([executable]/ttlpv.sql:503),
>> DB.DBA.TTLP_V([executable]/ttlpv.sql:562),
>> DB.DBA.TTLP_MT([executable]/sparql.sql:14626),
>> <Top Level>
>> at line 1 of Top-Level:
>> DB.DBA.TTLP_MT (file_to_string_output('./spatialTest2.nq'), 
>> '','<http://localhost:8890/DAV/dbpedia>',512)
>> SQL>
>> 
>> So I changed -122 to -22 then it loaded and could be queried:
>> 
>> SQL> DB.DBA.TTLP_MT (file_to_string_output('./spatialTest2.nq'), 
>> '','<http://localhost:8890/DAV/dbpedia>',512);
>> 
>> Done. -- 10 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}};
>> place                                                                        
>>      nplace                                                                  
>>           distance
>> LONG VARCHAR                                                                 
>>      LONG VARCHAR                                                            
>>           LONG VARCHAR
>> _______________________________________________________________________________
>> 
>> http://geoknow.eu/uk_natural#natural_2817555                                 
>>      http://geoknow.eu/uk_natural#natural_2371851                            
>>           10037.6492893785
>> http://geoknow.eu/uk_natural#natural_2371851                                 
>>      http://geoknow.eu/uk_natural#natural_2371851                            
>>           0
>> http://geoknow.eu/uk_natural#natural_2729539                                 
>>      http://geoknow.eu/uk_natural#natural_2371851                            
>>           155.568494101203
>> http://geoknow.eu/uk_natural#natural_2817555                                 
>>      http://geoknow.eu/uk_natural#natural_2817555                            
>>           0
>> http://geoknow.eu/uk_natural#natural_2371851                                 
>>      http://geoknow.eu/uk_natural#natural_2817555                            
>>           10037.6492893785
>> http://geoknow.eu/uk_natural#natural_2729539                                 
>>      http://geoknow.eu/uk_natural#natural_2817555                            
>>           10146.95393036408
>> http://geoknow.eu/uk_natural#natural_2817555                                 
>>      http://geoknow.eu/uk_natural#natural_2729539                            
>>           10146.95393036408
>> http://geoknow.eu/uk_natural#natural_2371851                                 
>>      http://geoknow.eu/uk_natural#natural_2729539                            
>>           155.568494101203
>> http://geoknow.eu/uk_natural#natural_2729539                                 
>>      http://geoknow.eu/uk_natural#natural_2729539                            
>>           0
>> 
>> 9 Rows. -- 8 msec.
>> SQL>
>> 
>> Finally note we are planning to also support the 
>> http://www.w3.org/2003/01/geo/wgs84_pos#Geometry geometry type for which we 
>> have an internal issue tracker report to implement …
>> 
>> 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 9 Apr 2016, at 15:22, Maria Jackson <maria.jackson....@gmail.com> wrote:
>>> 
>>> Dear Hugh,
>>> 
>>> Thanks for all the information. One of my students tried to load POINT
>>> data in Virtuoso, but ended up getting the following error, can you
>>> please suggest as to where are we going wrong:
>>> 
>>> 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> "POINT (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> "POINT (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> "POINT (2.79723
>>> -122.934)"^^<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}};
>>> 
>>> The error which I am getting is:
>>> *** Error 22032: [Virtuoso Driver][Virtuoso Server]GEO..: Function
>>> st_distance() expects a geometry as argument 0
>>> at line 6 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}}
>>> 
>>> 
>>> 
>>> On Thu, Feb 25, 2016 at 4:34 PM, Hugh Williams <hwilli...@openlinksw.com> 
>>> wrote:
>>>> Hi Maria,
>>>> 
>>>> Development have confirmed that st_distance only works with points and we
>>>> are currently working on integration of the GEOS Library plugin
>>>> (http://trac.osgeo.org/geos/) into Virtuoso which will give distances
>>>> between  other Geometry types, but is work in progress and will probably be
>>>> part of the next Virtuoso open source release. Thus unfortunately we are 
>>>> not
>>>> able to provide a solution currently ...
>>>> 
>>>> 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 25 Feb 2016, at 09:22, Maria Jackson <maria.jackson....@gmail.com> 
>>>> wrote:
>>>> 
>>>> Dear Hugh,
>>>> 
>>>> Thanks a lot for looking into this :)
>>>> 
>>>> As I have a deadline, therefore I would greatly appreciate if the
>>>> development team could reply soon :)
>>>> 
>>>> On Thu, Feb 25, 2016 at 5:44 AM, Hugh Williams <hwilli...@openlinksw.com>
>>>> wrote:
>>>> 
>>>> Hi Maria,
>>>> 
>>>> We are checking this with development as I have found another occurrence of
>>>> this error also and do believe the st_distance() function only works with
>>>> points …
>>>> 
>>>> There are two other functions, haversine_deg_km() &
>>>> dist_from_point_to_line_segment() documented at:
>>>> 
>>>> 
>>>> http://virtuoso.openlinksw.com/dataspace/doc/dav/wiki/Main/VirtGeoSPARQLEnhancementDocs
>>>> 
>>>> but they don’t seem to work either …
>>>> 
>>>> 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
>>>> 
>>>> 
>>>> 
>>>> 
>> 
> 
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
> _______________________________________________
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Attachment: smime.p7s
Description: S/MIME cryptographic signature

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to