fix wrapper methods for parsing the rdf graph#653
Merged
Conversation
| # code that follows | ||
| value = graph.value(subject=subject, predicate=predicate, object=_object, default=default, any=_any) | ||
| if value and not isinstance(value, (URIRef, Literal, BNode)): | ||
| if value != default and value and not isinstance(value, (URIRef, Literal, BNode)): |
Collaborator
There was a problem hiding this comment.
We need to take a deeper look into what happens here. Probably this should be value is not None instead of just value as value can also be a bool?
Collaborator
Author
There was a problem hiding this comment.
If files_analyzed is set in the correpsonding rdf document the return value would be Literal('true'), so value is a boolean iff default is set to a boolean. However, I think we should better use value is not None to "be on the safe side".
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
6d16199 to
020bd6d
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes two minor issues concerning the wrapper methods introduced in #563.
get_value_from_graphthe value doesn't need to be aURIRef, BNodeorLiteral, so we shouldn't log an error.attribution_textsin a package we should use the wrapper methods to prevent a warning concerning type mismatches.