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

testConjunctiveDefault for sparqlupdatestore fails locally #460

Closed
joernhees opened this issue Feb 25, 2015 · 11 comments
Closed

testConjunctiveDefault for sparqlupdatestore fails locally #460

joernhees opened this issue Feb 25, 2015 · 11 comments
Labels
bug Something isn't working SPARQL store Related to a store.
Milestone

Comments

@joernhees
Copy link
Member

if you run a local sparql store e.g. with fuseki-server --mem --update /ukpp the tests in https://github.com/RDFLib/rdflib/blob/master/test/test_sparqlupdatestore.py will run (and not be skipped as by default on travis).

One of the existing tests in there seems to fail:

FAIL: testConjunctiveDefault (test.test_sparqlupdatestore.TestSparql11)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/joern/coding/git/rdflib/rdflib/test/test_sparqlupdatestore.py", line 86, in testConjunctiveDefault
    'default union graph contains three triples')
AssertionError: 3 != 0 : default union graph contains three triples

Can someone verify?

@joernhees joernhees added bug Something isn't working SPARQL labels Feb 25, 2015
@joernhees joernhees added this to the rdflib 4.2.1 milestone Feb 25, 2015
@joernhees
Copy link
Member Author

@gjhiggins sorry to ping you again, seems you wrote that test as well, maybe you could have a look again...

maybe i should investigate if we can somehow set travis to run these tests as well...

@ghost
Copy link

ghost commented Feb 25, 2015

np.
I'm seeing 9/9 tests passing for test_sparqlupdatestore.py under Python 3.4 and fuseki 1.1.0.
And I agree, it should be feasible to get travis to make available a local instance of fuseki, I shall give it a go.

@joernhees joernhees added the store Related to a store. label Feb 26, 2015
@joernhees
Copy link
Member Author

hmm weird, i was running them with ./run_tests.py test/test_sparqlupdatestore.py on Python 2.7 on the 4.2.1-dev version, but i had 10 tests...

@uholzer
Copy link
Contributor

uholzer commented Mar 1, 2015

I'm pretty sure that the result of this test depends on the SPARQL endpoint. As far as I know, the SPARQL protocol leaves it to the endpoint whether the default graph is the union of all named graphs or whether it is a seperate graph. (There is a way to specify the default graph as the merge of several named graphs, but it does not seem to be possible to have the merge of all graphs.)

@joernhees
Copy link
Member Author

@gromgull told me the same. I think i fixed it over in #466 by running fuseki with --memTDB --set tdb:unionDefaultGraph=true.

@joernhees
Copy link
Member Author

hmm, actually after the tests ran through it seems that ConjunctiveGraph and Dataset need two different behaviors from the endpoint.

@uholzer
Copy link
Contributor

uholzer commented Mar 2, 2015

Yes, I suspect this is the case. Actually, Dataset is better suited to use with SPARQLStore, as it is based on SPARQL's definition of a Dataset. ConjunctiveGraph requires the default graph to be the merge of all graphs, which is not necessary for Dataset. So, I would recommend to use the SPARQL store only with Dataset. Also, the developer should be aware that the behaviour of the default graph of such a Dataset may be different for different endpoints.

@joernhees
Copy link
Member Author

i see at least to possible ways out of this:

  1. we remove the tests for the specific behavior of ConjunctiveGraph (i somehow don't like removing tests)
  2. we just run two local endpoints with different behaviors.

For now i've implemented 2 in #466.

@uholzer, @gjhiggins is that ok / enough or do we need to warn developers?

@uholzer
Copy link
Contributor

uholzer commented Mar 5, 2015

I like the solution you implemented.

Maybe the documentation of SPARQL(Update)Store should include a warning that the behaviour of the default graph depends on the endpoint. Also, I think we should recommend to avoid using it with ConjunctiveGraph for exactly this reason.

@joernhees
Copy link
Member Author

ok, i expanded the docstrings of SPARQLStore & SPARQLUpdateStore a bit, see 3a706e2

i think i'll merge #466 soon...

@uholzer
Copy link
Contributor

uholzer commented Mar 7, 2015

Now it's perfect! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working SPARQL store Related to a store.
Projects
None yet
Development

No branches or pull requests

2 participants