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

[WIP] Variable (with example) support #26

Draft
sib-swiss:master
base: master
Choose a base branch
from

Conversation

egonw
Copy link

Working out an idea for Scholia.

@JervenBolleman JervenBolleman changed the title [WIP] Variable (with examle) support [WIP] Variable (with example) support Nov 21, 2024
@JervenBolleman
Copy link
Collaborator

The idea is fine. However, this would mean that the template strings would not be valid queries by themselves. This is not a direction we wish to go into. However, that does not mean I am against including this in the code base.

Copy link
Author

This is not a direction we wish to go into.

What did you have in mind for Scholia?

One option we can do instead, is to record the SPARQL query as specific, but having the example QID itself the "template" variable, which gets translated into {{ q }} for Scholia.

Another option is to have all relevant metadata in SPARQL comments in the existing Scholia SPARQL queries, and use that as primary information source.

@JervenBolleman
Copy link
Collaborator

Well scholia uses ninja as templating language, which means the template is not yet a SPARQL query.

What we are thinking about is more like we have a complete SPARQL query with certain variables and then use a VALUES clause at the end or other bindings to make this happen.

e.g. we have a simple query to find all people with pets.

SELECT *
{ ?person ex:hasPet ?pet }

which is a query on it's own.

Then the query to find my pet's would be

SELECT *
{ex:JervenBolleman ex:hasPet ?pet }

and to find people whom have a cool goldfish as pet would be

SELECT *
{?people ex:hasPet ex:coolGoldFish }

we think that the last two queries could be expressed as a version of a templated starting query.

So we would express the queries like :

template an existing query is suggesting a binding which changes the original query prior bindings, and offers suggestions to them. The original query remains a pure SPARQL query and we end up defining how values are pre-bound into them. With most effort spend on selecting examples, limit's and the shapes that the example need to fit into make the templated query into them.

@vemonet
Copy link
Member

vemonet commented Nov 29, 2024

@egonw we already have a discussion in the sparql-examples repository about this kind of variables in template queries sib-swiss#32

The idea is that every query is a working query

But some query could get a list of potential values for a variable.

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

Successfully merging this pull request may close these issues.

3 participants