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

error 500 on a working query #46

Open
idshklein opened this issue Oct 7, 2024 · 3 comments
Open

error 500 on a working query #46

idshklein opened this issue Oct 7, 2024 · 3 comments

Comments

@idshklein
Copy link

Hi, thanks for this groundbreaking plugin.
I try to run this query :

SELECT ?item ?label ?date ?geo WHERE {
  SERVICE wikibase:box {
    ?item wdt:P625 ?geo.
    bd:serviceParam wikibase:cornerWest "Point(34.2654333839 29.5013261988)"^^geo:wktLiteral;
      wikibase:cornerEast "Point(35.8363969256 33.2774264593)"^^geo:wktLiteral.
  }
  ?item wdt:P585 ?date.
  FILTER(((YEAR(?date)) = 2023 ) && ((MONTH(?date)) = 10 ))
  ?item rdfs:label ?label.
  FILTER((LANG(?label)) = "en")
}

on a wikidata sparql endpoint.
In wikidata query service, it is valid and working link
however, in the plugin, I get error 500.
i cant understand why, your help will be a appreciated.

@situx
Copy link
Collaborator

situx commented Oct 8, 2024

Hello @idshklein
thank you for your bug report.
The plugin adds namespaces in the form of prefixes to SPARQL queries automatically in the background for user convenience.
For Wikidata, your query becomes:

PREFIX geo: <http://www.opengis.net/geosparql#>
PREFIX wd: <http://www.wikidata.org/entity/> 
PREFIX wds: <http://www.wikidata.org/entity/statement/> 
PREFIX wdv: <http://www.wikidata.org/value/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/> 
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/> 
PREFIX pq: <http://www.wikidata.org/prop/qualifier/> 
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX bd: <http://www.bigdata.com/rdf#> 
PREFIX wdref: <http://www.wikidata.org/reference/> 
PREFIX psv: <http://www.wikidata.org/prop/statement/value/> 
PREFIX psn: <http://www.wikidata.org/prop/statement/value-normalized/> 
PREFIX pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX pqn: <http://www.wikidata.org/prop/qualifier/value-normalized/> 
PREFIX pr: <http://www.wikidata.org/prop/reference/> 
PREFIX prv: <http://www.wikidata.org/prop/reference/value/> 
PREFIX prn: <http://www.wikidata.org/prop/reference/value-normalized/> 
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wdata: <http://www.wikidata.org/wiki/Special:EntityData/> 
PREFIX schema: <http://schema.org/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#> 
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX bds: <http://www.bigdata.com/rdf/search#> 
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
PREFIX hint: <http://www.bigdata.com/queryHints#> 
SELECT ?item ?label ?date ?geo WHERE {
  SERVICE wikibase:box {
    ?item wdt:P625 ?geo.
    bd:serviceParam wikibase:cornerWest "Point(34.2654333839 29.5013261988)"^^geo:wktLiteral;
                    wikibase:cornerEast "Point(35.8363969256 33.2774264593)"^^geo:wktLiteral.
  }
  ?item wdt:P585 ?date.
  FILTER(((YEAR(?date)) = 2023 ) && ((MONTH(?date)) = 10 ))
  ?item rdfs:label ?label.
  FILTER((LANG(?label)) = "en")
}

Interestingly, when I execute this query in the Wikidata query editor I get a null pointer exception.
I do not yet understand why, but I will further investigate.

@situx
Copy link
Collaborator

situx commented Oct 8, 2024

It would seem the error is caused by
PREFIX geo: http://www.opengis.net/geosparql#

I see nothing wrong here, maybe a bug in Wikibase?
https://phabricator.wikimedia.org/T376761
All I can do is rename geo: to geosparql: for instance so that the error does not occur anymore and we could report this to Wikibase?

@situx
Copy link
Collaborator

situx commented Oct 9, 2024

Apparently, I made a mistake when specifying namespaces in the plugin configuration and the default configuration is now corrected for the next release 89e04f4

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

2 participants