diff options
Diffstat (limited to 'bsie/extractor/generic/constant.py')
-rw-r--r-- | bsie/extractor/generic/constant.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bsie/extractor/generic/constant.py b/bsie/extractor/generic/constant.py index 7da792a..f9e3415 100644 --- a/bsie/extractor/generic/constant.py +++ b/bsie/extractor/generic/constant.py @@ -11,6 +11,7 @@ import typing from bsie.base import extractor from bsie.utils.bsfs import URI, schema as _schema from bsie.utils.node import Node +from bsie.utils import bsfs, node # exports __all__: typing.Sequence[str] = ( @@ -26,14 +27,14 @@ class Constant(extractor.Extractor): CONTENT_READER = None # predicate/value pairs to be produced. - _tuples: typing.Tuple[typing.Tuple[_schema.Predicate, typing.Any], ...] + _tuples: typing.Tuple[typing.Tuple[bsfs.schema.Predicate, typing.Any], ...] def __init__( self, schema: str, - tuples: typing.Iterable[typing.Tuple[URI, typing.Any]], + tuples: typing.Iterable[typing.Tuple[bsfs.URI, typing.Any]], ): - super().__init__(_schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + schema)) + super().__init__(bsfs.schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + schema)) # NOTE: Raises a KeyError if the predicate is not part of the schema self._tuples = tuple((self.schema.predicate(p_uri), value) for p_uri, value in tuples) # FIXME: use schema instance for value checking @@ -47,7 +48,7 @@ class Constant(extractor.Extractor): def extract( self, - subject: Node, + subject: node.Node, content: None, predicates: typing.Iterable[_schema.Predicate], ) -> typing.Iterator[typing.Tuple[Node, _schema.Predicate, typing.Any]]: |