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

Sum of conjunctive graphs is not conjunctive graph #652

Closed
wrobell opened this issue Sep 14, 2016 · 5 comments
Closed

Sum of conjunctive graphs is not conjunctive graph #652

wrobell opened this issue Sep 14, 2016 · 5 comments
Labels
breaking change This involves or proposes breaking RDFLib's public API. bug Something isn't working concept: RDF dataset Relates to the RDF datasets concept. discussion good first issue Good for newcomers id-as-cntxt tracking related issues

Comments

@wrobell
Copy link

wrobell commented Sep 14, 2016

Sum of conjunctive graphs is not conjunctive graph

>>> g1 = ConjunctiveGraph()
>>> g2 = ConjunctiveGraph()
>>> type(g1 + g2)
rdflib.graph.Graph

Is it a bug?

Workaround

>>> graph = ConjunctiveGraph()
>>> graph += g1
>>> graph += g2
>>> type(graph)
rdflib.graph.ConjunctiveGraph
@joernhees
Copy link
Member

hmm, i agree that this is somewhat surprising, but i can see why it's more "careful" than returning a ConjunctiveGraph: ConjunctiveGraphs represent their default graph as BNode if not specified otherwise. Adding any two ConjunctiveGraphs will now have two such "default graphs"... which one is the default then?

@gromgull gromgull added this to the rdflib 5.0.0 milestone Jan 12, 2017
@gromgull
Copy link
Member

Maybe generate a new BNode for the new graph?

@joernhees
Copy link
Member

would it be correct to move the triples from the former 2 default graphs to that new BNode default graph?

@white-gecko white-gecko modified the milestones: rdflib 5.0.0, rdflib 5.1.0 Apr 6, 2020
@white-gecko white-gecko modified the milestones: rdflib 5.1.0, rdflib 6.0.0 May 1, 2020
@ghost ghost added the id-as-cntxt tracking related issues label Dec 24, 2021
@aucampia aucampia added bug Something isn't working concept: RDF dataset Relates to the RDF datasets concept. good first issue Good for newcomers breaking change This involves or proposes breaking RDFLib's public API. labels May 19, 2023
@mielvds
Copy link
Contributor

mielvds commented Aug 30, 2023

With some time left, I added a test case in #2557. I cannot reproduce the above, so maybe it's fixed by now?

aucampia pushed a commit that referenced this issue Aug 30, 2023
This change adds tests for the return type of the `+`, `-`, `*`, and `^`
operators on `ConjunctiveGraph` objects.

- Closes <#652>
@aucampia
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking change This involves or proposes breaking RDFLib's public API. bug Something isn't working concept: RDF dataset Relates to the RDF datasets concept. discussion good first issue Good for newcomers id-as-cntxt tracking related issues
Projects
None yet
Development

No branches or pull requests

6 participants