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

Support multiple graphs #460

Open
zonotope opened this issue Apr 29, 2023 · 3 comments
Open

Support multiple graphs #460

zonotope opened this issue Apr 29, 2023 · 3 comments
Assignees
Labels
beta release Required for Beta/Community Release enhancement New feature or request needs specification
Milestone

Comments

@zonotope
Copy link
Contributor

zonotope commented Apr 29, 2023

RDF Datasets can consist of multiple graphs: exactly one default graph, and 0 or more named graphs. Fluree currently only supports the default graph. We should add support for named graphs in both queries and transactions.

See also:

@zonotope zonotope added enhancement New feature or request needs specification beta release Required for Beta/Community Release labels Apr 29, 2023
@zonotope zonotope added this to the 3.0.0-beta1 milestone Apr 29, 2023
@dpetran
Copy link
Contributor

dpetran commented May 30, 2023

Need to decide what the syntax is for

  • creating named graphs
  • querying named graphs

@bplatz
Copy link
Contributor

bplatz commented May 30, 2023

Named graphs in JSON-LD: https://www.w3.org/TR/json-ld11/#named-graphs

@mpoffald mpoffald modified the milestones: 3.0.0-beta1, 3.0.0-beta2 Jun 12, 2023
@bplatz
Copy link
Contributor

bplatz commented Jul 6, 2023

The more I think about this, the more I think we don't allow multiple named graphs inside a single ledger.

I do think that we could allow you to specify multiple graphs in a single JSON-LD transaction, but we treat this as a single atomic transaction across multiple ledgers (which in theory could be distributed). To do this we'd have to introduce a wait/lock at a ledger level and a timeout that would fail the entire transaction unless all specified ledgers successfully updated in a specified time.

As for querying across multiple graphs, I just created a ticket #526 to specify how to do this. In this case FROM can contain multiple ledgers (graphs) that all act as the "default" graph for the query. This is per SPARQL spec. FROM NAMED allows you to narrow parts of the query to a specified graph, excluding anything in the default graph.

Of course querying across multiple graph indexes will be slower than one big index. I think we could offer an optimization where we physicalize multiple graphs into a single index set if multiple graphs will frequently be queried as one, and performance is critical. This could be a user-specified optimization, obviously impacting storage requirements and increasing compute required for indexing.

@zonotope zonotope self-assigned this Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beta release Required for Beta/Community Release enhancement New feature or request needs specification
Projects
None yet
Development

No branches or pull requests

4 participants