You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Jean-Marc Vanel <je...@gmail.com> on 2021/02/24 08:17:00 UTC
New attempt with GeoSparql API
The Scala code is here;
https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
starting with empty TDB 1; just load 2 dbPedia cities with geo:
coordinates, initialize with
GeoSPARQLConfig.setupSpatialIndex(dataset)
and query with spatial:withinBox .
Alas, the result is empty (see bold line).
Log output :
2021-02-24T08:04:14.609Z [run-main-6] INFO o.a.j.g.c.GeoSPARQLOperations -
Find Mode SRS - Started
2021-02-24T08:04:14.633Z [run-main-6] INFO o.a.j.g.c.GeoSPARQLOperations -
Find Mode SRS - Completed
2021-02-24T08:04:14.634Z [run-main-6] INFO
o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index - Started
2021-02-24T08:04:14.634Z [run-main-6] INFO
o.a.j.geosparql.spatial.SpatialIndex - Geo predicate statements found.
févr. 24, 2021 8:04:14 AM
org.apache.sis.referencing.factory.sql.EPSGFactory <init>
*AVERTISSEMENT: La variable environnementale « SIS_DATA » n’est pas
définie.*2021-02-24T08:04:14.973Z [run-main-6] INFO
o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index - Completed
*?feature*[success] Total time: 5 s, completed 24 févr. 2021 à 08:04:15
If someone wants Java code to try, send me a private mail and I'll write it
:) .
Jean-Marc Vanel
<http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
Chroniques jardin
<http://semantic-forms.cc:1952/history?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle>
Re: New attempt with GeoSparql API
Posted by Marco Neumann <ma...@gmail.com>.
Of course in code we can always mix and match.
but we should also track some of the discussion here:
https://github.com/opengeospatial/ogc-geosparql/milestone/1
I prefer to focus on the basics for Jena but possibly going forward keeping
an eye on 1.2 and 2.0
I think it's Important to take a look at the issues with Apache Jena
GeoSPARQL that Milos has mentioned at the Semantic GeoSpatial Web - Use
Cases Workshop 2021 last week.
maybe we do another follow up session on this to make sure we have
addressed the show stoppers.
On Sat, Feb 27, 2021 at 9:51 AM Jean-Marc Vanel <je...@gmail.com>
wrote:
> About performance, all I can say is that indexing 2 dbPedia cities takes
> 608 ms elapsed time from scratch,
> and re-indexing after loading one more city takes 4 ms .
> This is acceptable, and hopefully the re-indexing time is mostly dependent
> on the increment, not on the overall size of already indexed spatial data.
>
> I'll try GeoSPARQL + Lucene, to see for myself; I see no fundamental reason
> preventing having two different indices on a database (actually altogether
> 16 , the 12 TDB/*.idn plus Lucene plus GeoSparql ).
>
> Time permitting, I also want to try 4.0.0-SNAPSHOT.
>
> Jean-Marc Vanel
> <
> http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> >
> +33
> (0)6 89 16 29 52
>
>
> Le sam. 27 févr. 2021 à 10:14, Marco Neumann <ma...@gmail.com> a
> écrit :
>
> > On Sat, Feb 27, 2021 at 8:48 AM Jean-Marc Vanel <
> jeanmarc.vanel@gmail.com>
> > wrote:
> >
> > > The result is now correct. The missing call is
> > > GeoSPARQLConfig.setupMemoryIndex()
> > > source code updated:
> > >
> > >
> >
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
> > >
> > > NOTES
> > >
> > > - but need to re-index after RDF addition;
> > > - setupMemoryIndex() actually registers special SPARQL
> > predicates,
> > > which is not apparent in method name;
> > > - QUESTIONS:
> > > - how expensive in terms of CPU, elapsed time and storage is
> > > re-indexing?
> > >
> > you will have to test that yourself
> > did you check out the
> >
> > https://github.com/galbiston/geosparql-benchmarking
> >
> > and
> >
> > https://github.com/OpenLinkSoftware/GeoSPARQLBenchmark
> >
> > would be nice to compare them
> >
> >
> > - how to make re-index automatic?
> > >
> >
> > they should be, of course it depends on your conformance requirements
> with
> > OGC Geosparql as well. query rewriting requires inferencing. try the
> > standalone implementations for your tests first,
> >
> >
> > > - is GeoSPARQL indexing compatible with Lucene indexing?
> > >
> >
> > no, the geospatial modul uses a different approach to indexing. The
> lucene
> > index is not directly resusably in the Apache Jena geosparql module. But
> > Andy mentioned a resurrection of our lucene spatial integration with Jena
> > 4.
> >
> > we may approach this integration with a compliance register in mind in
> the
> > future from a OGC GeoSPARQL 1,0 conformance level point of view.
> >
> >
> > >
> > > Jean-Marc Vanel
> > > <
> > >
> >
> http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> > > >
> > > +33
> > > (0)6 89 16 29 52
> > >
> > >
> > > Le mer. 24 févr. 2021 à 09:17, Jean-Marc Vanel <
> jeanmarc.vanel@gmail.com
> > >
> > > a
> > > écrit :
> > >
> > > > The Scala code is here;
> > > >
> > > >
> > >
> >
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
> > > > starting with empty TDB 1; just load 2 dbPedia cities with geo:
> > > > coordinates, initialize with
> > > > GeoSPARQLConfig.setupSpatialIndex(dataset)
> > > > and query with spatial:withinBox .
> > > > Alas, the result is empty (see bold line).
> > > >
> > > > Log output :
> > > > 2021-02-24T08:04:14.609Z [run-main-6] INFO
> > o.a.j.g.c.GeoSPARQLOperations
> > > > - Find Mode SRS - Started
> > > > 2021-02-24T08:04:14.633Z [run-main-6] INFO
> > o.a.j.g.c.GeoSPARQLOperations
> > > > - Find Mode SRS - Completed
> > > > 2021-02-24T08:04:14.634Z [run-main-6] INFO
> > > > o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index -
> > Started
> > > > 2021-02-24T08:04:14.634Z [run-main-6] INFO
> > > > o.a.j.geosparql.spatial.SpatialIndex - Geo predicate statements
> found.
> > > > févr. 24, 2021 8:04:14 AM
> > > > org.apache.sis.referencing.factory.sql.EPSGFactory <init>
> > > >
> > > > *AVERTISSEMENT: La variable environnementale « SIS_DATA » n’est pas
> > > > définie.*2021-02-24T08:04:14.973Z [run-main-6] INFO
> > > > o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index -
> > > Completed
> > > >
> > > > *?feature*[success] Total time: 5 s, completed 24 févr. 2021 à
> 08:04:15
> > > >
> > > > If someone wants Java code to try, send me a private mail and I'll
> > write
> > > > it :) .
> > > >
> > > > Jean-Marc Vanel
> > > > <
> > >
> >
> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> > > >
> > > > +33 (0)6 89 16 29 52
> > > > Twitter: @jmvanel , @jmvanel_fr ; chat: irc://
> > irc.freenode.net#eulergui
> > > > Chroniques jardin
> > > > <
> > >
> >
> http://semantic-forms.cc:1952/history?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle
> > > >
> > > >
> > > >
> > >
> >
> >
> > --
> >
> >
> > ---
> > Marco Neumann
> > KONA
> >
>
--
---
Marco Neumann
KONA
Re: New attempt with GeoSparql API
Posted by Jean-Marc Vanel <je...@gmail.com>.
About performance, all I can say is that indexing 2 dbPedia cities takes
608 ms elapsed time from scratch,
and re-indexing after loading one more city takes 4 ms .
This is acceptable, and hopefully the re-indexing time is mostly dependent
on the increment, not on the overall size of already indexed spatial data.
I'll try GeoSPARQL + Lucene, to see for myself; I see no fundamental reason
preventing having two different indices on a database (actually altogether
16 , the 12 TDB/*.idn plus Lucene plus GeoSparql ).
Time permitting, I also want to try 4.0.0-SNAPSHOT.
Jean-Marc Vanel
<http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
+33
(0)6 89 16 29 52
Le sam. 27 févr. 2021 à 10:14, Marco Neumann <ma...@gmail.com> a
écrit :
> On Sat, Feb 27, 2021 at 8:48 AM Jean-Marc Vanel <je...@gmail.com>
> wrote:
>
> > The result is now correct. The missing call is
> > GeoSPARQLConfig.setupMemoryIndex()
> > source code updated:
> >
> >
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
> >
> > NOTES
> >
> > - but need to re-index after RDF addition;
> > - setupMemoryIndex() actually registers special SPARQL
> predicates,
> > which is not apparent in method name;
> > - QUESTIONS:
> > - how expensive in terms of CPU, elapsed time and storage is
> > re-indexing?
> >
> you will have to test that yourself
> did you check out the
>
> https://github.com/galbiston/geosparql-benchmarking
>
> and
>
> https://github.com/OpenLinkSoftware/GeoSPARQLBenchmark
>
> would be nice to compare them
>
>
> - how to make re-index automatic?
> >
>
> they should be, of course it depends on your conformance requirements with
> OGC Geosparql as well. query rewriting requires inferencing. try the
> standalone implementations for your tests first,
>
>
> > - is GeoSPARQL indexing compatible with Lucene indexing?
> >
>
> no, the geospatial modul uses a different approach to indexing. The lucene
> index is not directly resusably in the Apache Jena geosparql module. But
> Andy mentioned a resurrection of our lucene spatial integration with Jena
> 4.
>
> we may approach this integration with a compliance register in mind in the
> future from a OGC GeoSPARQL 1,0 conformance level point of view.
>
>
> >
> > Jean-Marc Vanel
> > <
> >
> http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> > >
> > +33
> > (0)6 89 16 29 52
> >
> >
> > Le mer. 24 févr. 2021 à 09:17, Jean-Marc Vanel <jeanmarc.vanel@gmail.com
> >
> > a
> > écrit :
> >
> > > The Scala code is here;
> > >
> > >
> >
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
> > > starting with empty TDB 1; just load 2 dbPedia cities with geo:
> > > coordinates, initialize with
> > > GeoSPARQLConfig.setupSpatialIndex(dataset)
> > > and query with spatial:withinBox .
> > > Alas, the result is empty (see bold line).
> > >
> > > Log output :
> > > 2021-02-24T08:04:14.609Z [run-main-6] INFO
> o.a.j.g.c.GeoSPARQLOperations
> > > - Find Mode SRS - Started
> > > 2021-02-24T08:04:14.633Z [run-main-6] INFO
> o.a.j.g.c.GeoSPARQLOperations
> > > - Find Mode SRS - Completed
> > > 2021-02-24T08:04:14.634Z [run-main-6] INFO
> > > o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index -
> Started
> > > 2021-02-24T08:04:14.634Z [run-main-6] INFO
> > > o.a.j.geosparql.spatial.SpatialIndex - Geo predicate statements found.
> > > févr. 24, 2021 8:04:14 AM
> > > org.apache.sis.referencing.factory.sql.EPSGFactory <init>
> > >
> > > *AVERTISSEMENT: La variable environnementale « SIS_DATA » n’est pas
> > > définie.*2021-02-24T08:04:14.973Z [run-main-6] INFO
> > > o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index -
> > Completed
> > >
> > > *?feature*[success] Total time: 5 s, completed 24 févr. 2021 à 08:04:15
> > >
> > > If someone wants Java code to try, send me a private mail and I'll
> write
> > > it :) .
> > >
> > > Jean-Marc Vanel
> > > <
> >
> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> > >
> > > +33 (0)6 89 16 29 52
> > > Twitter: @jmvanel , @jmvanel_fr ; chat: irc://
> irc.freenode.net#eulergui
> > > Chroniques jardin
> > > <
> >
> http://semantic-forms.cc:1952/history?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle
> > >
> > >
> > >
> >
>
>
> --
>
>
> ---
> Marco Neumann
> KONA
>
Re: New attempt with GeoSparql API
Posted by Marco Neumann <ma...@gmail.com>.
On Sat, Feb 27, 2021 at 8:48 AM Jean-Marc Vanel <je...@gmail.com>
wrote:
> The result is now correct. The missing call is
> GeoSPARQLConfig.setupMemoryIndex()
> source code updated:
>
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
>
> NOTES
>
> - but need to re-index after RDF addition;
> - setupMemoryIndex() actually registers special SPARQL predicates,
> which is not apparent in method name;
> - QUESTIONS:
> - how expensive in terms of CPU, elapsed time and storage is
> re-indexing?
>
you will have to test that yourself
did you check out the
https://github.com/galbiston/geosparql-benchmarking
and
https://github.com/OpenLinkSoftware/GeoSPARQLBenchmark
would be nice to compare them
- how to make re-index automatic?
>
they should be, of course it depends on your conformance requirements with
OGC Geosparql as well. query rewriting requires inferencing. try the
standalone implementations for your tests first,
> - is GeoSPARQL indexing compatible with Lucene indexing?
>
no, the geospatial modul uses a different approach to indexing. The lucene
index is not directly resusably in the Apache Jena geosparql module. But
Andy mentioned a resurrection of our lucene spatial integration with Jena
4.
we may approach this integration with a compliance register in mind in the
future from a OGC GeoSPARQL 1,0 conformance level point of view.
>
> Jean-Marc Vanel
> <
> http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> >
> +33
> (0)6 89 16 29 52
>
>
> Le mer. 24 févr. 2021 à 09:17, Jean-Marc Vanel <je...@gmail.com>
> a
> écrit :
>
> > The Scala code is here;
> >
> >
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
> > starting with empty TDB 1; just load 2 dbPedia cities with geo:
> > coordinates, initialize with
> > GeoSPARQLConfig.setupSpatialIndex(dataset)
> > and query with spatial:withinBox .
> > Alas, the result is empty (see bold line).
> >
> > Log output :
> > 2021-02-24T08:04:14.609Z [run-main-6] INFO o.a.j.g.c.GeoSPARQLOperations
> > - Find Mode SRS - Started
> > 2021-02-24T08:04:14.633Z [run-main-6] INFO o.a.j.g.c.GeoSPARQLOperations
> > - Find Mode SRS - Completed
> > 2021-02-24T08:04:14.634Z [run-main-6] INFO
> > o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index - Started
> > 2021-02-24T08:04:14.634Z [run-main-6] INFO
> > o.a.j.geosparql.spatial.SpatialIndex - Geo predicate statements found.
> > févr. 24, 2021 8:04:14 AM
> > org.apache.sis.referencing.factory.sql.EPSGFactory <init>
> >
> > *AVERTISSEMENT: La variable environnementale « SIS_DATA » n’est pas
> > définie.*2021-02-24T08:04:14.973Z [run-main-6] INFO
> > o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index -
> Completed
> >
> > *?feature*[success] Total time: 5 s, completed 24 févr. 2021 à 08:04:15
> >
> > If someone wants Java code to try, send me a private mail and I'll write
> > it :) .
> >
> > Jean-Marc Vanel
> > <
> http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
> >
> > +33 (0)6 89 16 29 52
> > Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
> > Chroniques jardin
> > <
> http://semantic-forms.cc:1952/history?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle
> >
> >
> >
>
--
---
Marco Neumann
KONA
Re: New attempt with GeoSparql API
Posted by Jean-Marc Vanel <je...@gmail.com>.
The result is now correct. The missing call is
GeoSPARQLConfig.setupMemoryIndex()
source code updated:
https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
NOTES
- but need to re-index after RDF addition;
- setupMemoryIndex() actually registers special SPARQL predicates,
which is not apparent in method name;
- QUESTIONS:
- how expensive in terms of CPU, elapsed time and storage is
re-indexing?
- how to make re-index automatic?
- is GeoSPARQL indexing compatible with Lucene indexing?
Jean-Marc Vanel
<http://semantic-forms.cc:9112/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
+33
(0)6 89 16 29 52
Le mer. 24 févr. 2021 à 09:17, Jean-Marc Vanel <je...@gmail.com> a
écrit :
> The Scala code is here;
>
> https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/jena/GeoSPARLtest.scala#L11
> starting with empty TDB 1; just load 2 dbPedia cities with geo:
> coordinates, initialize with
> GeoSPARQLConfig.setupSpatialIndex(dataset)
> and query with spatial:withinBox .
> Alas, the result is empty (see bold line).
>
> Log output :
> 2021-02-24T08:04:14.609Z [run-main-6] INFO o.a.j.g.c.GeoSPARQLOperations
> - Find Mode SRS - Started
> 2021-02-24T08:04:14.633Z [run-main-6] INFO o.a.j.g.c.GeoSPARQLOperations
> - Find Mode SRS - Completed
> 2021-02-24T08:04:14.634Z [run-main-6] INFO
> o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index - Started
> 2021-02-24T08:04:14.634Z [run-main-6] INFO
> o.a.j.geosparql.spatial.SpatialIndex - Geo predicate statements found.
> févr. 24, 2021 8:04:14 AM
> org.apache.sis.referencing.factory.sql.EPSGFactory <init>
>
> *AVERTISSEMENT: La variable environnementale « SIS_DATA » n’est pas
> définie.*2021-02-24T08:04:14.973Z [run-main-6] INFO
> o.a.j.geosparql.spatial.SpatialIndex - Building Spatial Index - Completed
>
> *?feature*[success] Total time: 5 s, completed 24 févr. 2021 à 08:04:15
>
> If someone wants Java code to try, send me a private mail and I'll write
> it :) .
>
> Jean-Marc Vanel
> <http://semantic-forms.cc:1952/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me>
> +33 (0)6 89 16 29 52
> Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui
> Chroniques jardin
> <http://semantic-forms.cc:1952/history?uri=http%3A%2F%2Fdbpedia.org%2Fresource%2FChronicle>
>
>