-
Notifications
You must be signed in to change notification settings - Fork 565
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
Identifier as context #1505
Closed
Closed
Identifier as context #1505
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The basics look quite good - serialization of default graph and contexts looks sane and as expected. |
# Conflicts: # rdflib/graph.py
# Conflicts: # rdflib/graph.py
Got too scrappy to be useful in this state, close and reopen when more coherent. |
This pull request was closed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes # A few issues
Proposed Changes
A rebase of the rebased PR #958 “Move Store API to work with identifiers, not graphs”
This is a Draft PR because the rebased #958 is basically just the start, a number of issues remain unresolved, even with the changes contained in these commits.
This change is the latest in series of changes initiated in 2012 with #167 and reignited in 2013 by #301 (and friends). The subtle differences between the way Dataset and ConjunctiveGraph models work has been discussed at length in various issue threads, in an attempt to get an overview, I collated all the early discussions in a gist
If there are any misperceptions about the relative complexity of the exercise, gromgull summarised the, ahem, context in #307 including the assertion:
“For SPARQL, it is often interesting to on-the-fly define a new DataSet, i.e. selecting some subset of graphs from another DataSet, or even from several datasets. It would be nice to be able to do this without copying all the triples.”
but was moved to observe four years later in #698:
“A combination of https://github.com/RDFLib/rdflib/blob/master/rdflib/graph.py#L1698 and https://github.com/RDFLib/rdflib/blob/master/rdflib/graph.py#L2028 means you can pass an existing graph into the dataset. This will then be added directly. But there is no guarantee this new graph has the same store, and the triples will not be copied over. This is chaos, but wasn't flagged earlier since it's chaos all the way down :)”
The issues list contains around a couple of dozen issues related to the whole "identifier as context" business. I'm gradually working my way through them, discovering whether they remain extant or whether this PR fixes them.
My modus operandi is to create a test to check (in
test_dataset_anomaly_wip.py
) and when I've characterised the issue, migrate it totest_dataset_anomalies.py
with annotations. I've also created a separate test which implements all the current Dataset docstringstest_identifier_as_context.py
Example: Issue #939, “rdflib 4.2.2: ConjunctiveGraph.parse() return a Graph object” is fixed by the changes in this PR, as attested by
test_issue939_parse_return_inconsistent_type
A note to reviewers - in order to get the tests to pass without extensive skipping, I've been obliged to make a couple of changes in addition to the rebased PR and for those I have provided a rationale, prefixed with
DEVNOTE
. I had to add three failing named-graph-related DAWG tests to the skippedtests list - SPARQL update CLEAR remains an issue atm.