diff options
author | Matthias Baumgartner <dev@igsor.net> | 2023-01-12 10:26:30 +0100 |
---|---|---|
committer | Matthias Baumgartner <dev@igsor.net> | 2023-01-12 10:26:30 +0100 |
commit | b0ff4ed674ad78bf113c3cc0c2ccd187ccb91048 (patch) | |
tree | adfc97349cac6a6856970c5e1dc187c2ed8f878c /bsfs/query/validator.py | |
parent | 7e7284d5fc01c0a081aa79d67736f51069864a7d (diff) | |
download | bsfs-b0ff4ed674ad78bf113c3cc0c2ccd187ccb91048.tar.gz bsfs-b0ff4ed674ad78bf113c3cc0c2ccd187ccb91048.tar.bz2 bsfs-b0ff4ed674ad78bf113c3cc0c2ccd187ccb91048.zip |
number literal adaptions
Diffstat (limited to 'bsfs/query/validator.py')
-rw-r--r-- | bsfs/query/validator.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/bsfs/query/validator.py b/bsfs/query/validator.py index b04a9bf..75b51ca 100644 --- a/bsfs/query/validator.py +++ b/bsfs/query/validator.py @@ -182,8 +182,7 @@ class Filter(): if not type_ <= dom: raise errors.ConsistencyError(f'expected type {dom}, found {type_}') # node.count is a numerical expression - # FIXME: We have to ensure that ns.xsd.integer is always known in the schema! - self._parse_filter_expression(self.schema.literal(ns.xsd.integer), node.count) + self._parse_filter_expression(self.schema.literal(ns.bsfs.Number), node.count) ## conditions @@ -211,6 +210,9 @@ class Filter(): # type exists in the schema if type_ not in self.schema.literals(): raise errors.ConsistencyError(f'literal {type_} is not in the schema') + # type must be a numerical + if not type_ <= self.schema.literal(ns.bsfs.Number): + raise errors.ConsistencyError(f'expected a number type, found {type_}') # FIXME: Check if node.value corresponds to type_ |