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

Add test for issue #2011 #2107

Merged
merged 3 commits into from
Sep 4, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/test_sparql/test_sparql.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,36 @@ def test_sparql_bnodelist():
prepareQuery("select * where { ?s ?p ( [] [ ?p2 ?o2 ] [] ) . }")


@pytest.mark.xfail
def test_sparql_polist():
"""

syntax tests for equivalence object and predicate-object lists

"""

g = Graph()
g.parse(
data="""
@prefix : <urn:ns1:> .
:s :p [ :v 1 ], [ :v 2].
""",
format="n3",
aucampia marked this conversation as resolved.
Show resolved Hide resolved
)

qres1 = g.query("PREFIX : <urn:ns1:> select * where { ?s :p [ ], [ ] . }")
qres2 = g.query("PREFIX : <urn:ns1:> select * where { ?s :p [ ]; :p [ ] . }")
assert len(qres1) == len(qres2)

qres3 = g.query(
"PREFIX : <urn:ns1:> select ?v1 ?v2 where { ?s :p [ :v ?v1 ], [ :v ?v2] . }"
)
qres4 = g.query(
"PREFIX : <urn:ns1:> select ?v1 ?v2 where { ?s :p [ :v ?v1 ]; :p [ :v ?v2 ] . }"
)
assert len(qres3) == len(qres4)


def test_complex_sparql_construct():

g = Graph()
Expand Down