Using library from JAVA code

There are three steps in order to make pattern-based ontology transformation.

//Optional using part-of-speech tagger
boolean POStagger=true;

//preparatory phase: initialization
OntologyPatternDetection detection = new OntologyPatternDetectionImpl();
String ontology="";
OntologyTransformation<OWLOntology> transformation = new OntologyTransformationImpl(ontology);
TransformationPattern tp1 = new TransformationPatternImpl("");
InstructionGenerator ig = new InstructionGeneratorImpl(tp1,POStagger);

//1st phase: pattern detection
//getting first item in the case of only one selection for transformation
String bindingPlaceholders = detection.queryPatternNamingAspect(tp1, ontology, false, true).get(0);

//2nd phase: instruction generation
//in general generatedInstructions is additive operation

//3rd phase: transformation of the ontology

The ontology is saved in /tmp directory if ontology is on a remote host or as renamed variant of the ontology in the same directory.

ondrej 2013-05-10