Difference between revisions of "Subgraph Extents"
Jump to navigation
Jump to search
m (Created page with '== 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 == Domai...') |
|||
(2 intermediate revisions by one other user not shown) | |||
Line 9: | Line 9: | ||
== Domain == | == 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 | + | 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 <R http://www.simantics.org/Layer0-1.0/PartOf, par) | + | * including all resources ''par'' for statements (''r'', p <R http://www.simantics.org/Layer0-1.0/PartOf, ''par'') |
− | * including all containing ordered sets ord from statements (r, ord <R http://www.simantics.org/Layer0-1.0/HasNext, _) where ord is not r. | + | * including all containing ordered sets ''ord'' from statements (''r'', ''ord'' <R http://www.simantics.org/Layer0-1.0/HasNext, _) where ''ord'' is not ''r''. |
If the preceding procedure yielded no parents then the parent set is determined by | If the preceding procedure yielded no parents then the parent set is determined by | ||
− | * including all resources par for statements (par, p <R http://www.simantics.org/Layer0-1.0/IsRelatedTo, r) | + | * including all resources ''par'' for statements (''par'', p <R http://www.simantics.org/Layer0-1.0/IsRelatedTo, ''r'') |
== Extent descriptions == | == Extent descriptions == | ||
Line 22: | Line 22: | ||
The set of statements in a subgraph extent is determined by applying subgraph extent descriptions to the domain resources. The extent descriptions are specified in ontologies and attached to types. An extent description is implemented using the following adapter class | The set of statements in a subgraph extent is determined by applying subgraph extent descriptions to the domain resources. The extent descriptions are specified in ontologies and attached to types. An extent description is implemented using the following adapter class | ||
− | < | + | <pre style="white-space:pre-wrap"> |
+ | public interface SubgraphExtent { | ||
− | + | interface Callback { | |
− | + | void statement(ReadGraph graph, Statement statement) throws DatabaseException; | |
− | + | void value(ReadGraph graph, Resource resource, byte[] value) throws DatabaseException; | |
− | + | } | |
− | |||
− | |||
− | + | Set<Resource> types(ReadGraph graph) throws DatabaseException; | |
− | + | void traverse(ReadGraph graph, Resource resource, Collection<Resource> domain, Callback callback) throws DatabaseException; | |
} | } | ||
− | + | </pre> | |
− | </ | ||
− | |||
== Extent determination procedure == | == Extent determination procedure == | ||
Line 47: | Line 44: | ||
* Determine the set of excluded statements by applying excluded 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 | * Remove the set of excluded statements from the included statement set | ||
+ | |||
+ | [[Category: Database Development]] |
Latest revision as of 15:56, 28 January 2011
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 <R http://www.simantics.org/Layer0-1.0/PartOf, par)
- including all containing ordered sets ord from statements (r, ord <R http://www.simantics.org/Layer0-1.0/HasNext, _) where ord is not r.
If the preceding procedure yielded no parents then the parent set is determined by
- including all resources par for statements (par, p <R http://www.simantics.org/Layer0-1.0/IsRelatedTo, r)
Extent descriptions
The set of statements in a subgraph extent is determined by applying subgraph extent descriptions to the domain resources. The extent descriptions are specified in ontologies and attached to types. An extent description is implemented using the following adapter class
public interface SubgraphExtent { interface Callback { void statement(ReadGraph graph, Statement statement) throws DatabaseException; void value(ReadGraph graph, Resource resource, byte[] value) throws DatabaseException; } Set<Resource> types(ReadGraph graph) throws DatabaseException; void traverse(ReadGraph graph, Resource resource, Collection<Resource> 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