diff options
Diffstat (limited to 'bsie/extractor/generic')
-rw-r--r-- | bsie/extractor/generic/constant.py | 9 | ||||
-rw-r--r-- | bsie/extractor/generic/path.py | 6 | ||||
-rw-r--r-- | bsie/extractor/generic/stat.py | 6 |
3 files changed, 11 insertions, 10 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]]: diff --git a/bsie/extractor/generic/path.py b/bsie/extractor/generic/path.py index e6b901e..2cc592a 100644 --- a/bsie/extractor/generic/path.py +++ b/bsie/extractor/generic/path.py @@ -10,8 +10,8 @@ import typing # bsie imports from bsie.base import extractor -from bsie.utils import node, ns from bsie.utils.bsfs import schema +from bsie.utils import bsfs, node, ns # exports __all__: typing.Sequence[str] = ( @@ -27,10 +27,10 @@ class Path(extractor.Extractor): CONTENT_READER = 'bsie.reader.path.Path' # mapping from predicate to handler function. - _callmap: typing.Dict[schema.Predicate, typing.Callable[[str], typing.Any]] + _callmap: typing.Dict[bsfs.schema.Predicate, typing.Callable[[str], typing.Any]] def __init__(self): - super().__init__(schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + ''' + super().__init__(bsfs.schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + ''' bse:filename rdfs:subClassOf bsfs:Predicate ; rdfs:domain bsfs:Entity ; rdfs:range xsd:string ; diff --git a/bsie/extractor/generic/stat.py b/bsie/extractor/generic/stat.py index 6493d37..dfde7d2 100644 --- a/bsie/extractor/generic/stat.py +++ b/bsie/extractor/generic/stat.py @@ -10,8 +10,8 @@ import typing # bsie imports from bsie.base import extractor -from bsie.utils import node, ns from bsie.utils.bsfs import schema as _schema +from bsie.utils import bsfs, node, ns # exports __all__: typing.Sequence[str] = ( @@ -27,10 +27,10 @@ class Stat(extractor.Extractor): CONTENT_READER = 'bsie.reader.stat.Stat' # mapping from predicate to handler function. - _callmap: typing.Dict[_schema.Predicate, typing.Callable[[os.stat_result], typing.Any]] + _callmap: typing.Dict[bsfs.schema.Predicate, typing.Callable[[os.stat_result], typing.Any]] def __init__(self): - super().__init__(_schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + ''' + super().__init__(bsfs.schema.Schema.from_string(extractor.SCHEMA_PREAMBLE + ''' bse:filesize rdfs:subClassOf bsfs:Predicate ; rdfs:domain bsfs:Entity ; rdfs:range xsd:integer ; |