Search code examples
namespacessparqlwikidata-query-servicewikibase

Wikibase Query Service GUI configuration with namespaces


I'm trying to set up the Wikibase Query Service GUI https://github.com/wikimedia/wikidata-query-gui with a Jena-Fuseki backend.

I've edited the custom-config.json file and have populated the prefixes section with the prefixes I am using:

   "prefixes": {

   "rdf"      : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
   "rdfs"     : "http://www.w3.org/2000/01/rdf-schema#",
   "xs"       : "http://www.w3.org/2001/XMLSchema#",
   "owl"      : "http://www.w3.org/2002/07/owl#",
   "link"     : "http://www.w3.org/2007/ont/link#",
   "cnt"      : "http://www.w3.org/2011/content#", ...
   
   }

I can see the namespace prefixes have been picked up in the browser console wikibase.queryService.RdfNamespaces, however when I submit a query they are not used (the query fails), nor are they displayed under the Prefixes icon. When I click the Format Query diamond icon, the prefixes in the editor just disappear and NO namespace prefixes are used for the query at all (again, causing the query to fail!)

Any advice with the GUI configuration, particularly its handling of namespace prefixes would be hugely appreciated. Thanks!


Solution

  • I believe the query is always submitted as it appears in the user interface – the GUI assumes that the backend knows the default prefixes. For the same reason, the Format Query button removes the default prefixes, since they should not be needed (as far as the GUI knows).

    Also, the config only extends the RdfNamespaces.ALL_PREFIXES – it can override existing prefixes, but not remove them, and it also doesn’t affect the RdfNamespaces.STANDARD_PREFIXES, which are used by the “add standard prefixes” button.

    There’s probably some room for improvement in this area (or, to be honest, in the GUI code’s support for non-Wikidata setups in general) – but on the other hand, I’m not sure if using the GUI with non-Blazegraph backends is intended to be supported at all. (For example, the GUI also makes suggestions with SERVICE wikibase:label or wikibase:decodeUri, which are specific to the WDQS fork of Blazegraph.)