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

Add option to keep query prefixes #186

Open
vitalis-wiens opened this issue Mar 7, 2025 · 0 comments
Open

Add option to keep query prefixes #186

vitalis-wiens opened this issue Mar 7, 2025 · 0 comments
Assignees

Comments

@vitalis-wiens
Copy link

The current implementation supports to generate either all registered prefixes or only used prefixes from the query body. However, several database vendors provide means to add optimization hints for the execution of the sparql query via Prefix definition.

For Example when configuring the Parser in the following way

var parser = new SparqlParser({
      prefixes: {
        schema: "https://schema.org/",
        owl: "http://www.w3.org/2002/07/owl#"
      }
    });

and having the following query

PREFIX db_opt: <https://db.control.param_10> 
SELECT * WHERE {
  ?s a owl:Class
}

The available options will either print all three prefix definitions (schema, owl, db_opt) or only owl.

We would like to keep the Prefix that is in the Prefix definition of the query and use only the used Prefixes of the query body.

This should result in a query for database vendor should look as follows:

PREFIX db_opt: <https://db.control.param_10> 
PREFIX owl: <http://www.w3.org/2002/07/owl#>
?SELECT * WHERE {
  ?s a owl:Class
}
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