aboutsummaryrefslogtreecommitdiffstats
path: root/bsfs/schema/schema.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-01-21 22:32:33 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-01-21 22:32:33 +0100
commit9310610a7edf4dcbb934aedcecff1d11348197bb (patch)
treee7d342d8f25ae40e6bdaf33549f7145bb8697f23 /bsfs/schema/schema.py
parentc196d2ce73d8351a18c19bcddd4b06d224e644fc (diff)
downloadbsfs-9310610a7edf4dcbb934aedcecff1d11348197bb.tar.gz
bsfs-9310610a7edf4dcbb934aedcecff1d11348197bb.tar.bz2
bsfs-9310610a7edf4dcbb934aedcecff1d11348197bb.zip
nodes predicate walk sugar
Diffstat (limited to 'bsfs/schema/schema.py')
-rw-r--r--bsfs/schema/schema.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/bsfs/schema/schema.py b/bsfs/schema/schema.py
index 8d9a821..1644926 100644
--- a/bsfs/schema/schema.py
+++ b/bsfs/schema/schema.py
@@ -312,4 +312,8 @@ class Schema():
"""Return the Literal matching the *uri*."""
return self._literals[uri]
+ def predicates_at(self, node: types.Node) -> typing.Iterator[types.Predicate]:
+ """Return predicates that have domain *node* (or superclass thereof)."""
+ return iter(pred for pred in self._predicates.values() if node <= pred.domain)
+
## EOF ##