Hi
I want to share my experience.
I'm currently managing geolocalized objects (actually scooters with
GPS+GPRS devices), in TDB (through semantic_forms).
I have, among other statistics & data analysis, to compute path length.
The typical data is like this:
{
"@context": "https://deductions.github.io/drivers.context.jsonld",
"@id": "point:/imei:766/2017-05-31T03:45:08.000",
"mobile": "imei:766",
"lat": "48.837467",
"long": "2.3338766",
"date": "2017-05-31T03:45:08.000",
"speed": "0.0",
"altitude": "66.0",
"precedingPoint": "point:/imei:766/2017-05-31T03:45:00.000"
}
(the imei have been anonymized).
I tried at first to use SPARQL queries to compute path length, using
geoloc:precedingPoint triples :
https://github.com/Cruis-R/geo-reports/tree/master/src/sparql
But even short queries took 5 minutes. It seems to be related to use of
long iterative path (^ geoloc:precedingPoint )+ in SPARQL.
So I did the task with the API (through Banana-RDF compatibilty layer) :
and it worked satisfactorily.
https://github.com/jmvanel/semantic_forms/blob/master/scala/forms/src/main/scala/deductions/runtime/sparql_cache/algos/GeoPath.scala
Writing the code, I discovered that instead of the listed list formed by
the geoloc:precedingPoint triples, I could use the timestamps to sort the
timestamped points and achieve the same result.
Any comments welcome :)
--
Jean-Marc Vanel
http://www.semantic-forms.cc:9111/display?displayuri=http://jmvanel.free.fr/jmv.rdf%23me
Déductions SARL - Consulting, services, training,
Rule-based programming, Semantic Web
+33 (0)6 89 16 29 52
Twitter: @jmvanel , @jmvanel_fr ; chat: irc://irc.freenode.net#eulergui