middleware.namespaces.spec_index

Indexed RDF vocabulary term records derived from specification graphs.

Classes

VocabularyTerm

One indexed RDF vocabulary term with label, definition, and kind.

RDFVocabulary

Term sets for one vocabulary namespace, grouped by normalized term kind.

Module Contents

class middleware.namespaces.spec_index.VocabularyTerm(/, **data: Any)

Bases: pydantic.BaseModel

One indexed RDF vocabulary term with label, definition, and kind.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

uri: axiom.common.N3IRIRef
label: str
definition: str
termType: middleware.namespaces.common.VocabularyTermType
class middleware.namespaces.spec_index.RDFVocabulary(/, **data: Any)

Bases: pydantic.BaseModel

Term sets for one vocabulary namespace, grouped by normalized term kind.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

namespace: axiom.common.N3IRIRef
classes: collections.abc.Set[VocabularyTerm]
datatypes: collections.abc.Set[VocabularyTerm]
individuals: collections.abc.Set[VocabularyTerm]
properties: collections.abc.Set[VocabularyTerm]
property all_terms: collections.abc.Set[VocabularyTerm]

Return every indexed term across classes, datatypes, individuals, and properties.

get_term(uri: rdflib.URIRef) → VocabularyTerm

Return the indexed term for uri.

contains_term(uri: rdflib.URIRef) → bool

Return whether uri is indexed in this vocabulary.

classmethod from_graph(namespace: type[rdflib.Namespace] | type[rdflib.namespace.DefinedNamespace], graph: rdflib.Graph) → RDFVocabulary
classmethod from_graph(namespace: rdflib.Namespace | rdflib.namespace.DefinedNamespace, graph: rdflib.Graph) → RDFVocabulary
classmethod from_graph(namespace: rdflib.URIRef | str, graph: rdflib.Graph) → RDFVocabulary

Build an indexed vocabulary from graph for namespace.