docs: fix comment that doesn't describe behavior (#2443) · RDFLib/rdflib@4e42d10 (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Commit 4e42d10
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.
File tree
2 files changed
lines changed
2 files changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -105,7 +105,7 @@ node, not a generator: | ||
105 | 105 | # get any name of bob |
106 | 106 | name = g.value(bob, FOAF.name) |
107 | 107 | # 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) | |
109 | 109 | |
110 | 110 | |
111 | 111 | :class:`~rdflib.graph.Graph` methods for accessing triples |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -115,6 +115,9 @@ pep8-naming = ["-N815"] | ||
115 | 115 | pep8-naming = ["-N802"] |
116 | 116 | [tool.flakeheaven.exceptions."rdflib/plugins/parsers/trix.py"] |
117 | 117 | pep8-naming = ["-N802"] |
118 | +[tool.flakeheaven.exceptions."docs/*.rst"] | |
119 | +pyflakes = ["-F821"] | |
120 | + | |
118 | 121 | |
119 | 122 | [tool.black] |
120 | 123 | required-version = "23.3.0" |