diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-01-13 12:22:34 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-01-13 12:22:34 +0100 |
commit | 60257ed3c2aa6ea2891f362a691bde9d7ef17831 (patch) | |
tree | 20b3226e879cb308552ed2955cdfa10ce79caf85 /bsfs/triple_store | |
parent | 1b7ef16c3795bb7112683662b8c22a774e219269 (diff) | |
download | bsfs-60257ed3c2aa6ea2891f362a691bde9d7ef17831.tar.gz bsfs-60257ed3c2aa6ea2891f362a691bde9d7ef17831.tar.bz2 bsfs-60257ed3c2aa6ea2891f362a691bde9d7ef17831.zip |
schema type comparison across classes
Diffstat (limited to 'bsfs/triple_store')
-rw-r--r-- | bsfs/triple_store/sparql/parse_filter.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/bsfs/triple_store/sparql/parse_filter.py b/bsfs/triple_store/sparql/parse_filter.py index 18a3288..5d8a2d9 100644 --- a/bsfs/triple_store/sparql/parse_filter.py +++ b/bsfs/triple_store/sparql/parse_filter.py @@ -131,15 +131,12 @@ class Filter(): puri, subrng = self._parse_predicate_expression(node_type, pred) # track predicate uris suburi.add(puri) - try: - # check for more generic range - if rng is None or subrng > rng: - rng = subrng - # check range consistency - if not subrng <= rng and not subrng >= rng: - raise errors.ConsistencyError(f'ranges {subrng} and {rng} are not related') - except TypeError as err: # subrng and rng are not comparable - raise errors.ConsistencyError(f'ranges {subrng} and {rng} are not related') from err + # check for more generic range + if rng is None or subrng > rng: + rng = subrng + # check range consistency + if not subrng <= rng and not subrng >= rng: + raise errors.ConsistencyError(f'ranges {subrng} and {rng} are not related') # return joint predicate expression and next range # OneOf guarantees at least one expression, rng is always a bsc.Vertex. # mypy does not realize this, hence we ignore the warning. |