bsie.extractor.base module#

The Extractor classes transform content into triples.

class bsie.extractor.base.Extractor(schema: Schema)#

Bases: ABC

Produce (subject, predicate, value)-triples from some content. The Extractor produces princpal predicates that provide information about the content itself (i.e., triples that include the subject), and may also generate triples with auxiliary predicates if the extracted value is a node itself.

CONTENT_READER: str | None = None#
abstract extract(subject: Node, content: Any, principals: Iterable[Predicate]) Iterator[Tuple[Node, Predicate, Any]]#

Return (node, predicate, value) triples.

property principals: Iterator[Predicate]#

Return the principal predicates, i.e., relations from/to the extraction subject.

property schema: Schema#

Return the extractor’s schema.