Skip to content

Sparql query wrapper - #511

Merged
bovlb merged 32 commits into
developfrom
sparql-query
Nov 1, 2024
Merged

bovlb merged 32 commits into
developfrom
sparql-query

Conversation

@bovlb

@bovlb bovlb commented Oct 22, 2024 •

Copy link
Copy Markdown
Contributor

Basic support for querying ApertureDB using SPARQL.

Suggested usage:

from aperturedb.sparql import SPARQL

sparql = SPARQL(client)
query = """..."""
df = sparql.to_dataframe(sparql.query(query))

Requires pip install rdflib.

As part of adding tests, I created a test load of the Cookbook data, which is independently a good thing for us to have. This required me to add clip and rdflib to the [dev] dependencies, which might be controversial. I also adapted the interface of transformers so that they can take a client argument instead of calling create_constructor() directly. This appears to be the first tests we have that use transformers.

@vishakha041

Copy link
Copy Markdown
Contributor

It seems Nolan wants to see this wrapper whenever its public. He was curious when it came up.

Comment thread aperturedb/SPARQL.py Resolved
Comment thread aperturedb/SPARQL.py Resolved
Comment thread aperturedb/SPARQL.py Resolved
@bovlb
bovlb marked this pull request as ready for review October 31, 2024 22:22
@bovlb
bovlb requested a review from gsaluja9 November 1, 2024 15:50
Comment thread pyproject.toml Resolved
Comment thread test/conftest.py Resolved
Comment thread aperturedb/transformers/transformer.py Resolved

@gsaluja9 gsaluja9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

neat! Thx for the conftest update

@bovlb
bovlb merged commit 7d0f842 into develop Nov 1, 2024
@bovlb
bovlb deleted the sparql-query branch November 1, 2024 20:29
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.

4 participants