ontocast.link.links¶
The link pass: one document's facts graph to its identity links graph.
A pure function of the document graph and the catalog's declarations. It reads nothing else, so a document's links never depend on which documents were linked before it, and the resolution graph built one document at a time equals the one built from all of them at once.
Attributes¶
LINK_KINDS = ('key', 'ifp', 'identifier', 'label')
module-attribute
¶
MATCH = ONTOCAST.Match
module-attribute
¶
MATCHED_TEXT = ONTOCAST.matchedText
module-attribute
¶
MATCH_CLASS = ONTOCAST.matchClass
module-attribute
¶
MATCH_KIND = ONTOCAST.matchKind
module-attribute
¶
MATCH_PROPERTY = ONTOCAST.matchProperty
module-attribute
¶
MATCH_VALUE = ONTOCAST.matchValue
module-attribute
¶
Classes¶
Functions:¶
identity_links_graph_uri(graph_uri)
¶
key_value(term, catalog_terms)
¶
The normalised form of term as a key value, or None when it cannot be one.
A literal counts: strings trimmed and case-folded, typed values in the normal form triple stores converge on. An IRI counts only when the catalog holds it, because a document-local IRI means nothing in another document.
Source code in ontocast/link/links.py
linkable_instances(graph, declarations, value_classes)
¶
The entities of a document graph that can carry links.
A typed IRI subject that is not a catalog term, not a value (R1: values are reached through their entity, never resolved), and not the document node.
Source code in ontocast/link/links.py
links_for(graph, declarations, *, domain, value_classes=frozenset())
¶
The identity links of one document's facts graph.
Each entity gets one skos:closeMatch link per:
owl:hasKeythat applies to its types and whose properties all have key values (one link per combination of values);- value of an
owl:InverseFunctionalProperty; dcterms:identifieron an entity the document node links to (the caller's document metadata), scoped to each of its types;- normalised
rdfs:label/skos:altLabel, when one of its types is under a globally named class.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
RDFGraph
|
One document's facts graph, as written to the store. |
required |
declarations
|
IdentityDeclarations
|
The catalog's identity declarations. |
required |
domain
|
str
|
The deployment domain; match nodes are minted under it. |
required |
value_classes
|
frozenset[str]
|
Classes whose instances are values, never linked. |
frozenset()
|
Returns:
| Name | Type | Description |
|---|---|---|
RDFGraph |
RDFGraph
|
The links graph; empty when nothing is declared or matched. |
Source code in ontocast/link/links.py
match_node_iri(domain, payload)
¶
The match node for payload under domain: the same IRI everywhere.