Previous topic  Top  Next topic  Print this Topic
 

Materialization with the API

 

The following code shows how to set up a new ontology manager with some materialization options:

Properties properties = new Properties();

properties.setProperty(IConfig.MAT_UPDATABLE_KEY, IConfig.ON);

properties.setProperty(IConfig.MAT_STRATEGY_KEY, IConfig.MAT_STRATEGY_RFS);

properties.setProperty(IConfig.MAT_UPDATE_STRATEGY _KEY,

                      IConfig.MAT_UPDATE_STRATEGY_TRIGGERED);

OntologyManager manager = KAON2Manager.newOntologyManager(properties);

Then you can access the materialization manager by calling

MaterializationManager matManager = manager.getMaterializationManager();

This manager allows you to add rules to the materialization, to update the materialization etc:

matManager.materializeRule(myOntology, myRule, true); // materialize rule

matManager.materializeRule(myOntology, myRule, false); // remove from materialization

matManager.isRuleMaterialized(myOntology, myRule); // check materialization of rule

It is also possible to materialize standard axioms:

matManager.materializeStandardAxiom(StandardAxiom.flogicSubclassTransitivity);