Hello Hugh,

Thanks for your reply, and the references to the documentation of geometry in Virtuoso. Based on what you wrote I suspected that the problem lies with the Coordinate Reference System (CRS). The geometries I want to insert use the Dutch national CRS <http://spatialreference.org/ref/epsg/28992/> (identified by <http://www.opengis.net/def/crs/EPSG/0/28992> in my example). Virtuoso seems to support only one CRS (although it is unclear which one, more on that later).

As a test, I tried to insert the first triple in my file after removing the CRS URI string from the geometry literal. TTLP gave the same error, I guess because the coordinates are out of range for the CRS that Virtuoso uses. I then transformed the coordinates to WGS84. After that, the test triple loaded OK. This is the same result as you had, because you also omitted a CRS specification and used coordinates in the range of WGS84 (-90 to 90 for latitude, -180 to 180 for longitude).

So my question now is: Does Virtuoso support other geometry coordinates next to degrees longitude and latitude? The existence of functions like st_setsrid and st_transform seems to imply this.

About the default CRS that Virtuoso uses, the documentation is unclear about the axis order: should the coordinates be interpreted as longitude, latitude or as latitude, longitude? In GeoSPARQL, the default CRS is http://www.opengis.net/def/crs/OGC/1.3/CRS84, which is WGS84 coordinates in the order longitude, latitude. In Virtuoso, a SRID of 4326 is used, which happens to be a code issued by the EPSG to identify a CRS with WGS84 coordinates in the order latitude, longitude (http://www.epsg-registry.org/ can be used to get CRS details). Judging from the examples in the documentation, Virtuoso's default CRS uses the order longitude, latitude. In that case, the default CRS is the same as default CRS of GeoSPARQL, which is nice. I think it would be a good idea to make that more explicit. Axis order can cause a lot of confusion. Ideally, a CRS is identified by a URI that allows one to look up the details of the CRS, like axis order.

Regards,
Frans


On 2014-03-17 18:23, Hugh Williams wrote:
Hi Frans,

Virtuoso is not fully GeoSPARQL compliant and thus uses its own @prefix virtrdf: 
<http://www.openlinksw.com/schemas/virtrdf#>  virtrdf:Geometry for the RDF 
geometry type, see:

        http://docs.openlinksw.com/virtuoso/rdfsparqlgeospat.html

So you can insert Mutlipolygons etc as:

SQL> ttlp ('@prefix virtrdf: <http://www.openlinksw.com/schemas/virtrdf#> @prefix geo: 
<http://www.w3.org/2003/01/geo/wgs84_pos#> <point> geo:geometry "point(1.2 
22.4)"^^virtrdf:Geometry .','xxx', 'graph');

Done. -- 1 msec.
SQL> ttlp ('@prefix virtrdf: <http://www.openlinksw.com/schemas/virtrdf#> @prefix geo: 
<http://www.w3.org/2003/01/geo/wgs84_pos#> <point> geo:geometry "MULTIPOLYGON(((1 2, 6 1, 9 
3, 3 6, 1 2)), ((4 9, 7 6, 9 8, 4 9)))"^^virtrdf:Geometry .','xxx', 'graph');

Done. -- 2 msec.
SQL>
SQL> sparql select * from <graph> where {?s ?p ?o};
s                                                                               
  p                                                                             
    o
VARCHAR                                                                         
  VARCHAR                                                                       
    VARCHAR
_______________________________________________________________________________

http://xxx/point                                                                
  http://www.w3.org/2003/01/geo/wgs84_pos#geometry                              
    POINT(1.2 22.4)
http://xxx/point                                                                
  http://www.w3.org/2003/01/geo/wgs84_pos#geometry                              
    MULTIPOLYGON(((1.000000 2.000000,6.000000 1.000000,9.000000 
3.000000,3.000000 6.000000,1.000000 2.000000)),((4.000000 9.000000,7.000000 
6.000000,9.000000 8.000000,4.000000 9.000000)))

2 Rows. -- 2 msec.
SQL>

As said the full GeoSPARQL compliance is a work in progress which should soon be 
completed, although actually I found that the 
<http://www.opengis.net/ont/geosparql#wktLiteral> type being used in your 
example also works:

SQL> ttlp ('@prefix virtrdf: <http://www.openlinksw.com/schemas/virtrdf#> @prefix geo: 
<http://www.w3.org/2003/01/geo/wgs84_pos#> <point> geo:geometry "MULTIPOLYGON(((1 2, 6 1, 9 3, 3 6, 
1 2)), ((4 8, 7 6, 9 8, 4 8)))"^^<http://www.opengis.net/ont/geosparql#wktLiteral> .','xxx', 'graph');

Done. -- 2 msec.
SQL> sparql select * from <graph> where {?s ?p ?o};                             
                                                                                         
                                                                   s                     
                                                            p                            
                                                     o
VARCHAR                                                                         
  VARCHAR                                                                       
    VARCHAR
_______________________________________________________________________________

http://xxx/point                                                                
  http://www.w3.org/2003/01/geo/wgs84_pos#geometry                              
    POINT(1.2 22.4)
http://xxx/point                                                                
  http://www.w3.org/2003/01/geo/wgs84_pos#geometry                              
    MULTIPOLYGON(((1.000000 2.000000,6.000000 1.000000,9.000000 
3.000000,3.000000 6.000000,1.000000 2.000000)),((4.000000 9.000000,7.000000 
6.000000,9.000000 8.000000,4.000000 9.000000)))
http://xxx/point                                                                
  http://www.w3.org/2003/01/geo/wgs84_pos#geometry                              
    MULTIPOLYGON(((1.000000 2.000000,6.000000 1.000000,9.000000 
3.000000,3.000000 6.000000,1.000000 2.000000)),((4.000000 8.000000,7.000000 
6.000000,9.000000 8.000000,4.000000 8.000000)))

3 Rows. -- 1 msec.
SQL>

So, I don't get the error you report ie "Error 42000: [Virtuoso Driver][Virtuoso 
Server]RDFGE: rdf box with a geometry rdf type and a non geometry content" , thus 
how exactly are you performing your inserts ? If you can provide a example load that is 
failing that would be best ?

Note, I am using the following build from the git develop/7 branch:

SQL> status('');
REPORT
VARCHAR
_______________________________________________________________________________

OpenLink Virtuoso  Server
Version 07.10.3208-pthreads for Linux as of Mar 11 2014
Started on: 2014-03-17 17:36 GMT+1

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 17 Mar 2014, at 14:30, Frans Knibbe | Geodan <frans.kni...@geodan.nl> wrote:

Hello,

I have just installed Virtuoso Open Source 7.10.3208 and now I am
loading data from n-triples files. This goes well, until I get to the
geographical data. Then I get the following error:

*** Error 42000: [Virtuoso Driver][Virtuoso Server]RDFGE: rdf box with a
geometry rdf type and a non geometry content

The geometries in the file are multipolygons serialized as WKT by PostGIS.

An example of a geometry object:

"<http://www.opengis.net/def/crs/EPSG/0/28992> MULTIPOLYGON(((150874.3
459500,150853.2 459477, {many more
coordinates})))"^^<http://www.opengis.net/ont/geosparql#wktLiteral>

for convenient reading I have replaced a long list of other coordinates
with {many more coordinates}.

What could be the problem in this case? Is it possible to get more
details on the error? From what I could find on the web, multipolygons
are supported in Virtuoso 7.1, as well as GeoSPARQL. The error seems to
indicate that the datatype (geosparql:wktLiteral) is recognized, but
that the literal does not comply.

Thanks in advance,

Frans Knibbe
Geodan









------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


--
--------------------------------------
*Geodan*
President Kennedylaan 1
1079 MB Amsterdam (NL)

T +31 (0)20 - 5711 347
E frans.kni...@geodan.nl
www.geodan.nl <http://www.geodan.nl> | disclaimer <http://www.geodan.nl/disclaimer>
--------------------------------------
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

Reply via email to