Skip to content

Commit

Permalink
Add failing unit test for RDFLib#1336
Browse files Browse the repository at this point in the history
  • Loading branch information
aucampia committed Jun 20, 2021
1 parent a32f48b commit 873da0c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/test_sparql_parser.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from rdflib import Graph, Literal
from rdflib.namespace import Namespace
from rdflib.plugins.sparql.parser import parseUpdate
import unittest


class SPARQLParserTests(unittest.TestCase):
@unittest.expectedFailure
def test_large_insert(self) -> None:
resource_count = 50
EGV = Namespace("http://example.org/vocab#")
EGI = Namespace("http://example.org/instance#")
prop0, prop1, prop2 = EGV["prop0"], EGV["prop1"], EGV["prop2"]
g0 = Graph()
for index in range(resource_count):
resource = EGI[f"resource{index}"]
g0.add((resource, prop0, Literal(index)))
g0.add((resource, prop1, Literal("example resource")))
g0.add((resource, prop2, Literal(f"resource #{index}")))

g0ntriples = g0.serialize(format="ntriples")
# g1 = Graph()

parseUpdate(f"INSERT DATA {{ {g0ntriples!s} }}")


if __name__ == "__main__":
unittest.main()

0 comments on commit 873da0c

Please sign in to comment.