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

pass prefixes to org-babel-sparql--current-curies #76

Open
VladimirAlexiev opened this issue Apr 10, 2024 · 0 comments
Open

pass prefixes to org-babel-sparql--current-curies #76

VladimirAlexiev opened this issue Apr 10, 2024 · 0 comments

Comments

@VladimirAlexiev
Copy link
Collaborator

VladimirAlexiev commented Apr 10, 2024

@johanwk @ljos
ob-sparql.el: org-babel-execute:sparql sets a variable org-babel-sparql--current-curies:

(org-babel-sparql--current-curies (append org-link-abbrev-alist-local org-link-abbrev-alist))

That variable is then used in org-babel-sparql-convert-to-table to shorten URLs returned in query results. org-link-abbrev-alist-local is defined as

Buffer-local version of ‘org-link-abbrev-alist’, which see. The value of this is taken from the LINK keywords.

But in the case of SPARQL there's a more obvious list of CURIEs: the prefixes declared in the query.
So it would be better to extract these prefixes and pass them to org-babel-sparql--current-curies.
They can be extracted as \1, \2 by iterating a regex like this:

prefix:\s*(\w+):\s*<([^ >]+)>

This will work nicely in conjunction with #74

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

1 participant