ontocast.link.resolution¶
The resolution graph: every document's identity links, one named graph each.
Three operations keep it in step with the document graphs:
- :func:
add_documents(update): write the links graph of each given document; - :func:
remove_documents: drop the links graphs of the given documents; - :func:
build: recompute every links graph from the stored documents, and drop links graphs whose document is gone.
Each links graph depends only on its document and the catalog's declarations, so adding documents one at a time, in any order, gives the same resolution graph as building it from all of them.
Attributes¶
logger = logging.getLogger(__name__)
module-attribute
¶
Classes¶
ResolutionReport
¶
Bases: BaseModel
What one operation on the resolution graph did.
Source code in ontocast/link/resolution.py
Attributes¶
documents = Field(default=0, description='Documents whose links were written.')
class-attribute
instance-attribute
¶
links = Field(default=0, description='Links written.')
class-attribute
instance-attribute
¶
removed = Field(default=0, description='Links graphs dropped.')
class-attribute
instance-attribute
¶
Functions:¶
add_documents(store, graph_uris, declarations, *, domain, value_classes=frozenset())
async
¶
Write the links graph of each document graph in graph_uris.
A document graph that is not stored has its links graph dropped.
Source code in ontocast/link/resolution.py
build(store, declarations, *, domain, value_classes=frozenset())
async
¶
Recompute the whole resolution graph from the stored document graphs.
Links graphs whose document graph is gone are dropped. Running it twice gives the same store.
Source code in ontocast/link/resolution.py
count_links(links)
¶
document_graphs(store)
async
¶
Every document graph in the facts partition, auxiliary graphs excluded.
Source code in ontocast/link/resolution.py
links_graphs(store)
async
¶
Every identity links graph in the facts partition.
Source code in ontocast/link/resolution.py
remove_documents(store, graph_uris)
async
¶
Drop the links graphs of the document graphs in graph_uris.
Source code in ontocast/link/resolution.py
write_document_links(store, graph_uri, links)
async
¶
Replace the links graph of the document graph_uri with links.