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

Simple implementation of SPARQL queries #1183

Merged
merged 19 commits into from
Oct 10, 2023
Merged

Simple implementation of SPARQL queries #1183

merged 19 commits into from
Oct 10, 2023

Conversation

jamescheney
Copy link
Contributor

@jamescheney jamescheney commented Jul 10, 2023

This is for discussion/testing fo rthe moment. Some problems to potentially resolve before merging:

  • rdf and some other libraries are added as hard Links dependencies. It would be good to have a separate "driver" for the SPARQL querying interface, like for the databases.
  • Currently a single function is exposed which takes three arguments: a "base IRI" (needed only if the result is a graph, AFAICT), the URI of the SPARQL endpoint, and the SPARQL query to actually run. More functions for example to cater to the common case where the base isn't needed, and to allow for different flavors of SPARQL queries, such as ASK (returns boolean) or CONSTRUCT (returns graph), might be nice. Currently only SELECT (return list of variable-value bindings) is supported.
  • The code currently throws away type/structure information about the query results and just converts everything to strings. WE could retain the structure of the returned RDF values/terms in Links instead.

@jamescheney jamescheney marked this pull request as draft July 10, 2023 13:15
most recent version compativle with ocamlformat 0.19.0
@jamescheney
Copy link
Contributor Author

In today's meeting I think we agreed that this can be merged, with the todos above split into a separate issue along with a reminder to avoid/revisit the dependency on LWT when LWT goes away/is subsumed by other capabilities of OCaml 5.

@jamescheney
Copy link
Contributor Author

I think @vcgalpin agreed to try this branch out with some larger Links programs and @wricciot agreed to look over the code.

@jamescheney jamescheney marked this pull request as ready for review August 28, 2023 14:30
Copy link

@vcgalpin vcgalpin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested this branch with two different Links applications which will have exercised various database interactions:

Everything typechecked and showed no errors under execution.
I have not reviewed the code. I can do more specific testing if requested.

Copy link
Member

@wricciot wricciot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
The code is straightforward and ready to be merged. I left some minor comments for places that could use some clarification.

core/lib.ml Outdated Show resolved Hide resolved
core/lib.ml Show resolved Hide resolved
core/lib.ml Show resolved Hide resolved
core/query/sparql.ml Outdated Show resolved Hide resolved
core/lib.ml Outdated Show resolved Hide resolved
@jamescheney
Copy link
Contributor Author

Light is green, trap is clean.

@jamescheney jamescheney merged commit 0b45544 into master Oct 10, 2023
9 checks passed
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