buildingmotif.ingresses.template#

Classes

TemplateIngress(template, mapper, upstream)

Reads records and attempts to instantiate the given template with each record.

TemplateIngressWithChooser(chooser, mapper, ...)

Reads records and attempts to instantiate a template with each record.

class TemplateIngress(template: Template, mapper: Optional[Callable[[str], str]], upstream: RecordIngressHandler, fill_unused: bool = False, inline: bool = False, require_optional_args: bool = True)[source]#

Reads records and attempts to instantiate the given template with each record. Produces a graph.

If ‘inline’ is True, inlines all templates when they are instantiated.

graph(ns: Namespace) Graph[source]#

Generates an RDF graph with all entities being placed in the given namespace

class TemplateIngressWithChooser(chooser: Callable[[Record], Template], mapper: Optional[Callable[[str], str]], upstream: RecordIngressHandler, inline=False, require_optional_args: bool = True)[source]#

Reads records and attempts to instantiate a template with each record. Uses a ‘chooser’ function to determine which template should be instantiated for each record. Produces a graph.

If ‘inline’ is True, inlines all templates when they are instantiated.

graph(ns: Namespace) Graph[source]#

Generates an RDF graph with all entities being placed in the given namespace