zazuko / vscode-sparql-notebook

Visual Studio Code SPARQL Notebook Extension
https://marketplace.visualstudio.com/items?itemName=Zazuko.sparql-notebook
Other
26 stars 8 forks source link

[wish] Configure different endpoint per cell #3

Closed kvistgaard closed 2 years ago

BenjaminHofstetter commented 2 years ago

This is indeed a good idea.

Why do we need "Endpoint per cell"?

What is not good right now:

These two issues are somehow the same just another point of view.

Technical problems

Possible solution

We can provide a special configuration comment within a SPARQL query. Similar to Stardog query hints e.g. #pragma group.joins.

We have to distinguish two cases. The unauthenticated and the authenticated case. For unauthenticated cases we just need a query hint with the SPARQL endpoint URL e.g. #sparql-notebook.endpoint=https://dbpedia.org/sparql

Advantages

Disadvantages

Then we have to maintain the connections separate to the endpoint. That is not nice. And there is a relation between the notebook connection names in notebook cells and configured connections. And all users have to use the same name. That is very inconvenient and we cannot assume all Users use the same name for the same connection. It has too many downsides to do it like this.

We may ask for credentials to create temporal connection objects before executing the query.

We don't have to focus on the authenticated case

At the moment we can focus on the simple case where we just need a SPARQL Endpoint. Let's see how it feels.

BenjaminHofstetter commented 2 years ago

For inspiration https://github.com/blazegraph/database/wiki/QueryHints

kvistgaard commented 2 years ago

What about this: for open endpoints to give the endpoint URL in the SPARQL query as a comment?

BenjaminHofstetter commented 2 years ago

This is exactly how i see it

BenjaminHofstetter commented 2 years ago

@kvistgaard what do you think about that...

#
# *endpoint https://query.wikidata.org/bigdata/namespace/wdq/sparql
#
PREFIX schema: <http://schema.org/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>

SELECT DISTINCT ?ms ?msLabel ?hos ?hosLabel 

WHERE {
  ?ms wdt:P463 wd:Q458;
      wdt:P35 ?hos .
      SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ktk commented 2 years ago

But there is still a default one if it's not specified?

BenjaminHofstetter commented 2 years ago

@ktk Yes.

BenjaminHofstetter commented 2 years ago

in version 0.0.10

# add the endpoint in a comment like this
# [endpoint=https://lindas.admin.ch/query]
#
SELECT....