Skip to content

Commit

Permalink
Merge branch 'RDFLib:master' into fix-for-issue1824
Browse files Browse the repository at this point in the history
  • Loading branch information
Graham Higgins committed May 17, 2022
2 parents 59afbf2 + 3c72ce1 commit 8cf7494
Show file tree
Hide file tree
Showing 63 changed files with 1,608 additions and 401 deletions.
17 changes: 9 additions & 8 deletions pyproject.toml
Expand Up @@ -16,14 +16,15 @@ pyflakes = [
pep8-naming = ["+*"]

[tool.flakeheaven.exceptions."rdflib/plugins/sparql/*"]
pep8-naming = [
"-N802",
"-N803",
"-N806",
"-N812",
"-N816",
"-N801",
]
pep8-naming = ["-N802", "-N803", "-N806", "-N812", "-N816", "-N801"]
[tool.flakeheaven.exceptions."rdflib/namespace/_*"]
pep8-naming = ["-N815"]
[tool.flakeheaven.exceptions."rdflib/extras/infixowl.py"]
pep8-naming = ["-N802", "-N803", "-N806", "-N815"]
[tool.flakeheaven.exceptions."rdflib/plugins/parsers/notation3.py"]
pep8-naming = ["-N802", "-N803", "-N806", "-N816"]
[tool.flakeheaven.exceptions."rdflib/plugins/serializers/turtle.py"]
pep8-naming = ["-N802", "-N806", "-N815"]


[tool.black]
Expand Down
33 changes: 3 additions & 30 deletions rdflib/plugins/serializers/n3.py
Expand Up @@ -23,36 +23,6 @@ def reset(self):
super(N3Serializer, self).reset()
self._stores = {}

def subjectDone(self, subject):
super(N3Serializer, self).subjectDone(subject)
if self.parent:
self.parent.subjectDone(subject)

def isDone(self, subject):
return super(N3Serializer, self).isDone(subject) and (
not self.parent or self.parent.isDone(subject)
)

def startDocument(self):
super(N3Serializer, self).startDocument()
# if not isinstance(self.store, N3Store):
# return
#
# all_list = [self.label(var) for var in
# self.store.get_universals(recurse=False)]
# all_list.sort()
# some_list = [self.label(var) for var in
# self.store.get_existentials(recurse=False)]
# some_list.sort()
#
# for var in all_list:
# self.write('\n'+self.indent()+'@forAll %s. '%var)
# for var in some_list:
# self.write('\n'+self.indent()+'@forSome %s. '%var)
#
# if (len(all_list) + len(some_list)) > 0:
# self.write('\n')

def endDocument(self):
if not self.parent:
super(N3Serializer, self).endDocument()
Expand All @@ -68,6 +38,9 @@ def preprocessTriple(self, triple):
if isinstance(triple[0], Graph):
for t in triple[0]:
self.preprocessTriple(t)
if isinstance(triple[1], Graph):
for t in triple[1]:
self.preprocessTriple(t)
if isinstance(triple[2], Graph):
for t in triple[2]:
self.preprocessTriple(t)
Expand Down
7 changes: 7 additions & 0 deletions rdflib/plugins/sparql/aggregates.py
Expand Up @@ -207,10 +207,17 @@ def __init__(self, aggregation):
def update(self, row, aggregator):
try:
value = _eval(self.expr, row)
# skip UNDEF
if isinstance(value, NotBoundError):
return
self.value.append(value)
if self.distinct:
self.seen.add(value)
# skip UNDEF
# NOTE: It seems like this is not the way undefined values occur, they
# come through not as exceptions but as values. This is left here
# however as it may occur in some cases.
# TODO: Consider removing this.
except NotBoundError:
pass

Expand Down

0 comments on commit 8cf7494

Please sign in to comment.