Skip to content

PREFIX statements in queries

ghrgriner edited this page Sep 15, 2026 · 2 revisions

Users may notice that some example queries provided at the DBnary online access page use PREFIX statements, and some do not. Nevertheless, the ones without PREFIX statements seem to work just fine. Why is that?

For example, compare the queries 'Counting all available translations to French' and 'Counting translations to Bambara by source language' at the above link.

Answer

A PREFIX statement is required to declare the namespace of a prefix unless a global default namespace for the prefix has been defined in the database software (here, OpenLink Virtuoso). These defaults simplify the query syntax so that users don't have to retype common prefixes with each query.

The list of default prefixes configured for the database can be retrieved from this particular software by adding '?nsdecl' to the endpoint, i.e. https://kaiko.getalp.org/sparql?nsdecl. Clicking the link reveals that the lexvo and dbnary prefixes explicitly defined in the 'Counting all available translations to French' query also have defaults assigned.

Clone this wiki locally