Skip to content

Commit

Permalink
docs: fix comment that doesn't describe behavior (#2443)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kibubu committed Jun 15, 2023
1 parent 46ff6cf commit 4e42d10
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/intro_to_graphs.rst
Expand Up @@ -105,7 +105,7 @@ node, not a generator:
# get any name of bob
name = g.value(bob, FOAF.name)
# get the one person that knows bob and raise an exception if more are found
mbox = g.value(predicate = FOAF.name, object=bob, any=False)
person = g.value(predicate=FOAF.knows, object=bob, any=False)
:class:`~rdflib.graph.Graph` methods for accessing triples
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Expand Up @@ -115,6 +115,9 @@ pep8-naming = ["-N815"]
pep8-naming = ["-N802"]
[tool.flakeheaven.exceptions."rdflib/plugins/parsers/trix.py"]
pep8-naming = ["-N802"]
[tool.flakeheaven.exceptions."docs/*.rst"]
pyflakes = ["-F821"]


[tool.black]
required-version = "23.3.0"
Expand Down

0 comments on commit 4e42d10

Please sign in to comment.