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

enable querying of an RDF file #75

Open
VladimirAlexiev opened this issue Mar 28, 2024 · 4 comments
Open

enable querying of an RDF file #75

VladimirAlexiev opened this issue Mar 28, 2024 · 4 comments

Comments

@VladimirAlexiev
Copy link
Collaborator

sparql-mode queries SPARQL endpoints that is specified with variables like this;

(setq
 sparql-default-base-url "..." ;; org-babel-execute:sparql gets endpoint from param :url
 sparql-prompt-base-url t ; this really means endpoint
 sparql-default-format "text/csv" ;; org-babel-execute:sparql gets from param :format
)
(put 'sparql-base-url 'safe-local-variable 'stringp)

However, it's also interesting to query an RDF file. Eg during development of an ontology, you can extract the class hierarchy this way.
Two tools that allow this:

@VladimirAlexiev
Copy link
Collaborator Author

We could use advice but it's better to fork sparql-mode and add this and other additions (eg sparql vs update vs tarql derived modes, syntax checking with flycheck, etc.
A crucial question is how to pass org-babel parameters to the query tool (see params :url and :format in the first code block).

@johanwk
Copy link

johanwk commented Apr 1, 2024

I'm not sure whether I understand completely. With the variant org-babel-execute:sparql in ELOT, :url is reused for a filename (in the sense of, if it doesn't look like a url, assume it's a filename). Maybe this should be required to be a file:/// url? It appears to me to make sense that we don't need another header parameter, but can reuse :url.

Regarding :format, there's a use of this in the ELOT elot-robot-execute-query to request either csv or ttl from ROBOT. Should that be done differently?

@VladimirAlexiev
Copy link
Collaborator Author

VladimirAlexiev commented Apr 10, 2024

Hi @johanwk !

So I think you should use a new keyword eg :data (which is a file in a triple or quad format, i.e. can populate multiple graphs).
In the future we may think of exploiting the namedGraph options of arq or robot.

Please reopen johanwk/elot#27

@johanwk
Copy link

johanwk commented Apr 10, 2024

I can only say I agree with all of your points here. I chose shortcuts in order to progress ELOT. sparql-mode should do much better, I just don't want to wait for it.

Will reopen :)

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