wiki:adapters_composite

Version 6 (modified by lqu, 18 years ago) (diff)

--

TracNav?

Ontology Adapter: Composite

Developer: Lizhen Qu

Description

This adapter services as a wrapper of the other ontology, especially it makes possible to contract and expand subgraphs. There are implementations in this package of all the interfaces from de.dfki.km.phaselib.model.ontology in order to wrap every frame of a ontology. If a frame is wrapped by a wrapper class, it should behave like the being wrapped frame from a point view of the implemented interface. That means, the returned values from the methods belonging to the interface are semantically equal. Objects of CompositeCls, which contract or expand a subgraph, do not obey the rule, because they are semantically different.

The most important classes are OntologyWrapper and CompositeCls. OntologyWrapper utilizes a static method to wrap every frame of the given ontology. CompositeCls provides the contract and expand functionalities. After contracting, the name of the new class is given by alphabetically concatenating all names of the classes from the original subgraph. The URL begins with prefix http://km.dfki.de/phaselib/adapters/composite/, followed by the new class name. If the same datatype properties are found in different classes, they are all added to the new class. After contracting, the domain of properites are changed to the new class, any references to the original classes of the subgraph will be redirected to the new class.

Characteristics

The overhead at the wrapping phase is huge, because every frame will be wrapped into a new class.

Evaluation/Performance

TODO

Specification

Intitialisation

The ontology adapter class is

de.dfki.km.phaselib.adapters.compoosite.OntologyWrapper

Initialisation: Using static method OntologyWrapper.init() to encapsulate an existing ontology.

CompositeOntology ont = OntologyWrapper.init(otherOntology);

Usage

Contracting and Expanding: CompositeCls provides utilities to contract or expand a subgraph. Contract: A subgraph is represented as a set of wrapped classes. After contracting, the contracted class is a wrapped class representing the original class set.

CompositeCls compositedCls = CompositeCls.composite(subgraph);

Expand: After expanding, the original class set is returned.

Collection<Cls> subgraph = compositedCls.expand();

Parameters

TODO

Dependencies

Log4j - for logging

License Issues

TODO