middleware.namespaces.spec_cache ================================ .. py:module:: middleware.namespaces.spec_cache .. autoapi-nested-parse:: Load bundled and user-supplied RDF vocabulary specifications into read-only graphs. Attributes ---------- .. autoapisummary:: middleware.namespaces.spec_cache.logger Classes ------- .. autoapisummary:: middleware.namespaces.spec_cache.OntologyDescription middleware.namespaces.spec_cache.UserVocabularySource middleware.namespaces.spec_cache.SpecificationCache Module Contents --------------- .. py:data:: logger .. py:class:: OntologyDescription Human-readable metadata for one indexed vocabulary namespace. .. py:attribute:: vocabulary :type: rdflib.URIRef .. py:attribute:: label :type: str .. py:attribute:: description :type: str .. py:attribute:: preferred_namespace_prefix :type: str | None :value: None .. py:attribute:: preferred_namespace_uri :type: str | None :value: None .. py:class:: UserVocabularySource User-supplied ontology graph and optional presentation metadata. .. py:attribute:: graph :type: rdflib.Graph .. py:attribute:: vocabulary :type: rdflib.URIRef .. py:attribute:: label :type: str | None :value: None .. py:attribute:: description :type: str | None :value: None .. py:attribute:: preferred_namespace_prefix :type: str | None :value: None .. py:attribute:: preferred_namespace_uri :type: str | None :value: None .. py:class:: SpecificationCache(*, bundled_namespaces: collections.abc.Sequence[rdflib.URIRef | rdflib.Namespace | type[rdflib.namespace.DefinedNamespace] | str], user_specs: collections.abc.Sequence[UserVocabularySource] = ()) Read-only cache of bundled and injected RDF vocabulary specification graphs. .. py:method:: get_spec(namespace: rdflib.URIRef | rdflib.Namespace | type[rdflib.namespace.DefinedNamespace] | str) -> rdflib.Graph Return the read-only specification graph for ``namespace``. .. py:method:: get_vocabulary(namespace: rdflib.URIRef | rdflib.Namespace | type[rdflib.namespace.DefinedNamespace] | str) -> rdflib_reasoning.middleware.namespaces.spec_index.RDFVocabulary Return the indexed term set built from the specification for ``namespace``. .. py:method:: get_vocabulary_metadata(namespace: rdflib.URIRef | rdflib.Namespace | type[rdflib.namespace.DefinedNamespace] | str) -> OntologyDescription Return presentation metadata for ``namespace``. .. py:method:: has_bundled_resource(namespace: rdflib.URIRef | rdflib.Namespace | type[rdflib.namespace.DefinedNamespace] | str) -> bool :staticmethod: Return whether a bundled specification ships for ``namespace``.