graflo.data_source.rdf_identity¶
Identity of RDF nodes that have no stable IRI of their own.
- A blank node is keyed on a digest of its outgoing triples, so one content gets one key on every read, whatever label the parser or the endpoint gave it.
- IRIs joined by
owl:sameAsform a component, and its smallest IRI stands for every member.
Nothing here depends on an RDF library: terms arrive as :class:Term.
Attributes¶
BLANK_PREFIX = '_:'
module-attribute
¶
OWL_SAME_AS = 'http://www.w3.org/2002/07/owl#sameAs'
module-attribute
¶
Outgoing = Callable[[str], Iterable[tuple[str, Term]]]
module-attribute
¶
XSD_STRING = 'http://www.w3.org/2001/XMLSchema#string'
module-attribute
¶
Classes¶
BlankNodeKeys
¶
Content keys for blank nodes.
The key is a digest of the node's outgoing triples. A blank-node object counts by its own key, so a nested structure is keyed as a whole. A reference back to a node on the way down counts by how far back it points, which ends a cycle without naming a label.
Two blank nodes with the same content have the same key.
Source code in graflo/data_source/rdf_identity.py
Methods:¶
__init__(outgoing)
¶
Source code in graflo/data_source/rdf_identity.py
key(label)
¶
The key of the blank node label.
Source code in graflo/data_source/rdf_identity.py
SameAs
¶
Components of owl:sameAs statements between IRIs.
Source code in graflo/data_source/rdf_identity.py
Methods:¶
__bool__()
¶
__init__(pairs)
¶
Source code in graflo/data_source/rdf_identity.py
canonical(iri)
¶
members(iri)
¶
Every IRI of the component of iri, sorted; [iri] when it is alone.
Term
¶
Bases: NamedTuple
An RDF term, independent of the library that read it.
value is the IRI, the blank-node label, or the literal's lexical form.
Source code in graflo/data_source/rdf_identity.py
Functions:¶
term_text(term)
¶
One spelling per IRI or literal; a plain literal is an xsd:string.