bsfs.graph.resolve module#

class bsfs.graph.resolve.Filter(schema)#

Bases: object

Rewrites the query to replace bsfs.graph.nodes.Nodes instances with the respective URI. Does only limited type checking and schema validation. Use bsfs.schema.validate.Filter to do so.

Example:

input: Any(ns.bse.tag, Is(Nodes(…))) output: Any(ns.bse.tag, Or(Is(…), Is(…), …)))

>>> tags = graph.node(ns.bsn.Tag, 'http://example.com/me/tag#1234')
>>> graph.get(ns.bsn.Entity, ast.filter.Any(ns.bse.tag, ast.filter.Is(tags)))
resolve(root_type: Node, node: FilterExpression | None)#

Resolve Nodes instances of a node query starting at root_type.