buildingmotif.ingresses.base#

Classes

GraphIngressHandler(bm)

Generates a Graph from an underlying metadata source or RecordIngressHandler

IngressHandler()

Abstract superclass for Record/Graph ingress handlers

Record(rtype, fields)

Represents a piece of metadata from some metadata ingress

RecordIngressHandler(bm)

Generates Record instances from an underlying metadata source

class Record(rtype: str, fields: dict)[source]#

Represents a piece of metadata from some metadata ingress

rtype: str#
fields: dict#
class IngressHandler[source]#

Abstract superclass for Record/Graph ingress handlers

class RecordIngressHandler(bm: BuildingMOTIF)[source]#

Generates Record instances from an underlying metadata source

property records: List[Record]#

Generates (then caches) a list of Records from an underlying data source

dump(path: PathLike)[source]#

Takes the contents of the records of this handler and writes them to a JSON file

Parameters:

path (PathLike) – path to write output file to

dumps() str[source]#

Takes the contents of the records of this handler and writes them to a string

classmethod load(path: PathLike)[source]#

Takes a file generated by ‘dump’ and creates a new ingress handler with those records

classmethod loads(s: str)[source]#

Takes the string output by ‘dumps’ and creates a new ingress handler with those records

class GraphIngressHandler(bm: BuildingMOTIF)[source]#

Generates a Graph from an underlying metadata source or RecordIngressHandler

graph(ns: Namespace) Graph[source]#

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