Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objets not displayed #15

Open
NicoLaval opened this issue Sep 12, 2024 · 10 comments
Open

Objets not displayed #15

NicoLaval opened this issue Sep 12, 2024 · 10 comments

Comments

@NicoLaval
Copy link

Hi,

First, thanks a lot for building a so nice stack as Qlever.

I have a qlever instance and I try to display geo Multipolygons with petrimaps.
Because of my strange predicates in my sample data, I updated cache queries.

When I run:

SELECT ?area ?geometry  WHERE {
  ?area <http://data.ign.fr/def/geometrie#geometry>/<http://www.opengis.net/ont/geosparql#asWKT> ?geometry .
}

Results seem to be close to those produced on your demo instance with this query:

PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX osmkey: <https://www.openstreetmap.org/wiki/Key:>
PREFIX ogc: <http://www.opengis.net/rdf#>
PREFIX osmrel: <https://www.openstreetmap.org/relation/>
SELECT ?osm_id ?hasgeometry WHERE {
  osmrel:1960198 ogc:sfContains ?osm_id .
  ?osm_id geo:hasGeometry/geo:asWKT ?hasgeometry .
  ?osm_id osmkey:building ?building .
}

The only difference is that your polygons are tagged by wktliteral type. I didn't find reference to that in the source code, so I guess it's not me issue.

When I run my query in petrimaps, count query in cache seems to be good:

map-ign-1  | PREFIX ign: <http://data.ign.fr/def/geometrie#> SELECT (COUNT(?geometry) as ?count) WHERE {  ?osm_id ign:geometry ?geometry }
map-ign-1  | [2024-09-12 09:13:10.323] INFO : [GEOMCACHE] Total request size: 141296

When I paste my simple query in URL params, results are presents:

map-ign-1  | [2024-09-12 09:13:10.975] INFO : [GEOMCACHE] Query is PREFIX ign: <http://data.ign.fr/def/geometrie#> SELECT ?geometry WHERE { ?osm_id ign:geometry ?geometry } INTERNAL SORT BY ?geometry
map-ign-1  | [2024-09-12 09:13:10.975] INFO : [GEOMCACHE] Binary ID query URL is https://qlever-server-ign.lab.sspcloud.fr/?send=18446744073709551615&query=PREFIX%20ign%3A%20%3Chttp%3A%2F%2Fdata.ign.fr%2Fdef%2Fgeometrie%23%3E%20SELECT%20%3Fgeometry%20WHERE%20%7B%20%3Fosm_id%20ign%3Ageometry%20%3Fgeometry%20%7D%20INTERNAL%20SORT%20BY%20%3Fgeometry%20LIMIT%2018446744073709551615%20OFFSET%200
map-ign-1  | [2024-09-12 09:13:11.090] INFO : [GEOMCACHE] @ row 0 (0.00%, 0 points, 0 (open) polygons)
map-ign-1  | [2024-09-12 09:13:11.252] INFO : [GEOMCACHE] Received 141296 rows

But I got 0 object:

map-ign-1  | [2024-09-12 09:13:11.259] INFO : [REQUESTOR] Requesting IDs for query SELECT ?a ?shape WHERE {
map-ign-1  |   ?a <http://data.ign.fr/def/geometrie#geometry> ?geometry .
map-ign-1  |   ?geometry <http://www.opengis.net/ont/geosparql#asWKT> ?shape
map-ign-1  | }
map-ign-1  | [2024-09-12 09:13:11.913] INFO : [REQUESTOR] Done, have 141274 ids in total.
map-ign-1  | [2024-09-12 09:13:11.913] INFO : [REQUESTOR] Sorting results by qlever ID...
map-ign-1  | [2024-09-12 09:13:11.922] INFO : [REQUESTOR] ... done
map-ign-1  | [2024-09-12 09:13:11.922] INFO : [REQUESTOR] Retrieving geoms from cache...
map-ign-1  | [2024-09-12 09:13:11.923] INFO : [REQUESTOR] ... done, got 0 objects.

Do you have any idea of the mistake?

@NicoLaval
Copy link
Author

Update.

Always 0 object displayed, but when I export as GeoJson I have my data.

@patrickbr
Copy link
Member

Could you try again with the latest master? We just fixed an issue with the WKT parser.

(The GeoJSON export passes the data through from QLever, so was not affected by this).

@NicoLaval
Copy link
Author

Sorry, I didn't succeed to build docker image now:

ERROR: failed to solve: process "/bin/sh -c mkdir build && cd build && cmake .. && make -j8" did not complete successfully: exit code: 1

@ludovicm67
Copy link

Sorry, I didn't succeed to build docker image now:

ERROR: failed to solve: process "/bin/sh -c mkdir build && cd build && cmake .. && make -j8" did not complete successfully: exit code: 1

@NicoLaval I think that the comment here would be useful for you: #18 (comment)

@coret
Copy link

coret commented Dec 11, 2024

I installed qlever-petrimaps today and experience the same issue as @NicoLaval (including correct geoJSON export):

[2024-12-11 12:19:37.904] INFO : Starting server...
[2024-12-11 12:19:37.905] INFO : Max memory is 121.484 GB...
[2024-12-11 12:19:37.906] INFO : Listening on port 9090
[2024-12-11 12:19:40.021] INFO : [SERVER] Queried backend is http://localhost:8888
[2024-12-11 12:19:40.021] INFO : [SERVER] Query is:
PREFIX geo: <http://www.opengis.net/ont/geosparql#> PREFIX gtm: <https://www.goudatijdmachine.nl/def#> SELECT ?uri ?hasgeometry WHERE { ?uri a gtm:Pand ; geo:hasGeometry/geo:asWKT ?hasgeometry . FILTER(CONTAINS(STR(?hasgeometry),"POLYGON")) }
[2024-12-11 12:19:40.037] INFO : Index hash is '_1_#.52868362.4726543.248.16346979'
[2024-12-11 12:19:40.037] INFO : [GEOMCACHE] Count query to obtain the number of geometries:
PREFIX geo: <http://www.opengis.net/ont/geosparql#> SELECT (COUNT(?geometry) AS ?count) WHERE { SELECT ?geometry WHERE { ?subject geo:asWKT ?geometry } INTERNAL SORT BY ?geometry }
[2024-12-11 12:19:40.122] INFO : [GEOMCACHE] Total request size: 75899
[2024-12-11 12:19:40.122] INFO : [GEOMCACHE] Query is:
PREFIX geo: <http://www.opengis.net/ont/geosparql#> SELECT ?geometry WHERE { ?subject geo:asWKT ?geometry } INTERNAL SORT BY ?geometry
[2024-12-11 12:19:40.330] INFO : Received 75899 rows
[2024-12-11 12:19:40.330] INFO : [GEOMCACHE] Building vectors...
[2024-12-11 12:19:40.331] INFO : [GEOMCACHE] Done
[2024-12-11 12:19:40.331] INFO : [GEOMCACHE] Received 59523 unique geoms (0 geometry duplicates transferred)
[2024-12-11 12:19:40.331] INFO : [GEOMCACHE] Received 37059 points and 22801 lines
[2024-12-11 12:19:40.331] INFO : [GEOMCACHE] Query is PREFIX geo: <http://www.opengis.net/ont/geosparql#> SELECT ?geometry WHERE { ?subject geo:asWKT ?geometry } INTERNAL SORT BY ?geometry
[2024-12-11 12:19:40.402] INFO : [GEOMCACHE] Received 75899 rows
[2024-12-11 12:19:40.402] INFO : [GEOMCACHE] Done
[2024-12-11 12:19:40.402] INFO : [GEOMCACHE] Sorting results by qlever ID...
[2024-12-11 12:19:40.402] INFO : [GEOMCACHE] ... done
[2024-12-11 12:19:40.402] INFO : [REQUESTOR] Requesting IDs for query PREFIX geo: <http://www.opengis.net/ont/geosparql#> PREFIX gtm: <https://www.goudatijdmachine.nl/def#> SELECT ?uri ?hasgeometry WHERE { ?uri a gtm:Pand ; geo:hasGeometry/geo:asWKT ?hasgeometry . FILTER(CONTAINS(STR(?hasgeometry),"POLYGON")) }
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] Done, have 2907 ids in total.
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] Sorting results by qlever ID...
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] ... done
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] Retrieving geoms from cache...
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] ... done, got 2907 objects.
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] Retrieving points dynamically from query...
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] ... done, got 0 points.
[2024-12-11 12:19:40.422] INFO : [REQUESTOR] Calculating bounding box of result...
[2024-12-11 12:19:40.423] INFO : [REQUESTOR] ... done
[2024-12-11 12:19:40.424] INFO : [REQUESTOR] Point BBox: <none>
[2024-12-11 12:19:40.424] INFO : [REQUESTOR] Line BBox: <none>
[2024-12-11 12:19:40.424] INFO : [REQUESTOR] Building grid...
[2024-12-11 12:19:40.424] INFO : [REQUESTOR] (0x0 cell point grid)
[2024-12-11 12:19:40.424] INFO : [REQUESTOR] (0x0 cell line grid)
[2024-12-11 12:19:40.424] INFO : [REQUESTOR] ...done
[2024-12-11 12:19:40.463] INFO : [SERVER] Begin heat for session 1986611749
[2024-12-11 12:19:40.463] INFO : [SERVER] Query resolution: 156532
[2024-12-11 12:19:40.463] INFO : [SERVER] Virt cell size: 391329
[2024-12-11 12:19:40.463] INFO : [SERVER] Num virt cells: 1
[2024-12-11 12:19:40.467] INFO : [SERVER] Adding points to heatmap...
[2024-12-11 12:19:40.467] INFO : [SERVER] ...done
[2024-12-11 12:19:40.467] INFO : [SERVER] Rendering heatmap...
[2024-12-11 12:19:40.467] INFO : [SERVER] ...done
[2024-12-11 12:19:40.467] INFO : [SERVER] Generating PNG...
[2024-12-11 12:19:40.468] INFO : [SERVER] ...done

@patrickbr
Copy link
Member

@coret, is the dataset you are using available somewhere?

@patrickbr
Copy link
Member

And could you post the WKT of a single random result row of your query?

@coret
Copy link

coret commented Dec 13, 2024

@patrickbr yes, but qlever is only internally available (I tested the petrimaps on qlever of course), the exact same dataset is externally available via https://www.goudatijdmachine.nl/sparql/sparql and SPARQL endpoint https://www.goudatijdmachine.nl/sparql/repositories/gtm

Random WKT triple:

@prefix geo: <http://www.opengis.net/ont/geosparql#> .

<https://www.goudatijdmachine.nl/omeka/api/items/21610>
  ...
  geo:asWKT "POLYGON ((4.7098868 52.0126737, 4.7097469 52.0126295, 4.7097248 52.0126562, 4.709883 52.0127131, 4.7098868 52.0126737))"^^geo:wktLiteral ;
  ... .

@patrickbr
Copy link
Member

patrickbr commented Dec 13, 2024

Hm, there are multiple datasets under the URL you provided. Could you describe exactly which dataset you created and how, so I can download something that can be fed into the QLever index builder?

@coret
Copy link

coret commented Dec 14, 2024

My qlever instance is now online available via https://qlever.coret.org
A shortcut to the query configured to get the WKT's from https://qlever.coret.org is available via https://api.triplydb.com/s/Ni4_Oy21V

NB: The complete dataset (459MB) can be downloaded via https://www.goudatijdmachine.nl/omeka/files/goudatijdmachine.nt.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants