-
Notifications
You must be signed in to change notification settings - Fork 556
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid raising unrelated AttributeError ... (#2013)
from attempting to access language and datatype attributes of non-Literal objects Added `isinstance` check to avoid AttributeErrors being raised by attempting to access `language` and `datatype`attribs of non-Literal objects being passed back up the call stack resulting from SPARQL BIND failures/errors.
- Loading branch information
Showing
2 changed files
with
11 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from rdflib import Graph | ||
|
||
|
||
def test_sparql_error_implicit_bind(): | ||
[r for r in Graph().query('SELECT (concat("", sha1(?x)) AS ?y) WHERE {}')] | ||
|
||
|
||
def test_sparql_error_explicit_bind(): | ||
[r for r in Graph().query("SELECT ?v ?p ?m WHERE {?v ?p ?m BIND (sha1(?x) AS ?m)}")] |