X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=docs%2FDeveloper%2FDatabase%2FSubgraphExtents.md;fp=docs%2FDeveloper%2FDatabase%2FSubgraphExtents.md;h=6ae1b454a680934212ba75384f95985de0d9a010;hb=a9ec58f08ccc02e65b1cab6aedff25e0cf3c6444;hp=0000000000000000000000000000000000000000;hpb=5998374f7e179cfaf451c220216adc18c823047f;p=simantics%2Fplatform.git diff --git a/docs/Developer/Database/SubgraphExtents.md b/docs/Developer/Database/SubgraphExtents.md new file mode 100644 index 000000000..6ae1b454a --- /dev/null +++ b/docs/Developer/Database/SubgraphExtents.md @@ -0,0 +1,45 @@ +## Overview + +A subgraph extent is a set of statements bound by a given set of root resources. Subgraph extents are needed in + +* Copy-paste +* Import and export +* Delete + +## Domain + +A subgraph extent domain is the set of resources for which all parent resources are included in the root set. The set of parents for resource *r* are found by + +* including all resources `par` for statements `(r, p types(ReadGraph graph) throws DatabaseException; + void traverse(ReadGraph graph, Resource resource, Collection domain, Callback callback) throws DatabaseException; + +} +~~~ + +## Extent determination procedure + +* Determine the domain set by walking `IsRelatedTo` from root set and the discovered domain. +* Determine the set of extent descriptions found from root set dependencies (ontologies). +* Divide the set of available extent descriptions into included and excluded sets. +* Determine the set of (potentially) included statements by applying included extent descriptions on the domain set +* Determine the set of excluded statements by applying excluded extent descriptions on the domain set +* Remove the set of excluded statements from the included statement set