Skip to content

Commit 4e42d10

Browse files
authored
docs: fix comment that doesn't describe behavior (#2443)
Comment refers to a person that knows bob and the code would return a name, but this would only work if the triple `person foaf:name bob .` is part of the dataset As this is a very uncommon way to model a `foaf:knows` the code was adjusted to match the description.
1 parent 46ff6cf commit 4e42d10

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docs/intro_to_graphs.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ node, not a generator:
105105
# get any name of bob
106106
name = g.value(bob, FOAF.name)
107107
# get the one person that knows bob and raise an exception if more are found
108-
mbox = g.value(predicate = FOAF.name, object=bob, any=False)
108+
person = g.value(predicate=FOAF.knows, object=bob, any=False)
109109
110110
111111
:class:`~rdflib.graph.Graph` methods for accessing triples

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ pep8-naming = ["-N815"]
115115
pep8-naming = ["-N802"]
116116
[tool.flakeheaven.exceptions."rdflib/plugins/parsers/trix.py"]
117117
pep8-naming = ["-N802"]
118+
[tool.flakeheaven.exceptions."docs/*.rst"]
119+
pyflakes = ["-F821"]
120+
118121

119122
[tool.black]
120123
required-version = "23.3.0"

0 commit comments

Comments
 (0)