Hi Hoan,

The following amended version of the rdf_geo_fill() function, could be used to 
create the geometry indexes on a specific graph:

create procedure rdf_geo_fill_single_onegraph (IN onegraph VARCHAR)
{
  declare giid any;
  giid := iri_to_id (onegraph);
  for select "s", "long", "lat" from (sparql define output:valmode "LONG" 
select ?s ?long ?lat where {
  graph ?:giid { ?s geo:long ?long . ?s geo:lat ?lat}}) f option (any order)  do
    {
      "lat" := num_or_null ("lat");
      "long" := num_or_null ("long");
      if (isnumeric ("lat") and isnumeric ("long"))
        insert into rdf_quad (g, s, p, o) values (giid, "s", iri_to_id 
('http://www.w3.org/2003/01/geo/wgs84_pos#geometry'),
            rdf_geo_add (rdf_box (st_point ("long", "lat"), 256, 257, 0, 1)));
    }

}
;

Note this function is for single server, different one would be required for 
cluster. 

Will make a documentation tip about this as it seems a useful function ...

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 10 Mar 2014, at 12:19, Nguyen Mau Quoc Hoan <nmqh...@gmail.com> wrote:

> Hi everyone,
> 
> This question is related to Virtuoso geometry functions, RDF_GEO_FILL(), 
> which will create geometry index based on (latitude, longitude) properties. 
> However, according to the documentation 
> (http://docs.openlinksw.com/virtuoso/rdfsparqlgeospat.html#rdfsparqlgeospatcrg),
>  this function will be  inefficient if there are large numbers of geometries. 
> That is the problem we are facing now. I wonder if there is a way to execute 
> this function on specific graph so we can limit the number of triples this 
> function has to read through? 
> 
> If that is not possible, is that OK if I manually create the "geo:geometry" 
> property for the data before inserting it into Virtuoso?
> 
> Best Regards,
> Hoan
> ------------------------------------------------------------------------------
> 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

------------------------------------------------------------------------------
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