-
Notifications
You must be signed in to change notification settings - Fork 556
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
fix: ConjunctiveGraph.serialize to format as TriG by default (#1674) #2373
base: main
Are you sure you want to change the base?
fix: ConjunctiveGraph.serialize to format as TriG by default (#1674) #2373
Conversation
Link to original issue |
@WhiteGobo thanks for the PR, one potential problem is that this may be considered breaking the public API [ref], and if so, it should go into version 7 which also needs many other changes [ref]. If The best way to establish this is to add a test that would fail without this PR. |
…ault (RDFLib#1674) Created method ConjunctiveGraph.serialize(..., format='trig', ...). Because of typing problems I replaced some annotations in the overloaded methods of rdflib.Graph.serialize, so that in subclasses serialize knows, that it returns type(self) and not Graph. Because Graph.serialize annotations are still incompatible with ConjunctiveGraph.serialize added type: ignore [overriden] to let mypy skip that method.
fa3327c
to
414b060
Compare
Seems fine to me to include the pull request later. As far as i have understood you, the test for ConjunctiveGraph.serialize you mentioned in your comment here and in the comment in the original issue has nothing to do directly with my PR, right? Except that with that test my PR could be directly included. |
No need, will do on merge.
Well yes, not directly related to this, but still quite important. I think there is another bug hiding somewhere with serializing ConjunctiveGraphs using turtle, but I will figure that out. And if the other two conditions hold we can merge as is, I will add tests for it sometime, hopefully this weekend, but best to keep it in a separate PR because we should test it anyway. And then as you said, once that is tested this can go in. |
PRs to V6 is closed until further notice. See this for more details: |
We will be open for PRs again once this is resolved: |
@WhiteGobo still working through some stuff to get to a point where we can merge this, but it will take some time. |
@aucampia dont worry, take your time. Ive seen some of your efforts from the last weeks and that must have been a bunch of extra work. |
@WhiteGobo can you review the conflict here and see if the PR can be readied for merging now? |
Ill get to it till end of the weekend. |
ok conflicts are resolved. Checked tests again for current version. |
@nicholascar should this go into v7.1 release or v8? |
I don't think this breaks the API so it's fine for 7.x and with a 7.1.0 release soon, that seems appropriate. |
Created method ConjunctiveGraph.serialize(..., format='trig', ...).
Because of typing problems I replaced some annotations in the overloaded methods of 'rdflib.Graph.serialize', so that in subclasses serialize knows, that it returns type(self) and not Graph. I have changed this, because in the docs its said, that serialize returns itself and nothing is stated, that a new graph is returned.
Graph.serialize annotations are still incompatible with ConjunctiveGraph.serialize. So added 'type: ignore [overriden]' to let mypy skip that method. I dont understand, what the errorlog of mypy wants to tell me.
Summary of changes
Changed types in graph.serialize
Added rdflib.graph.conjunctiveGraph.serialize as overriden method.
let mypy skip new method.
Checklist
the same change.
CHANGELOG.md
).so maintainers can fix minor issues and keep your PR up to date.