本文整理汇总了Java中uk.ac.manchester.cs.owlapi.modularity.ModuleType.BOT属性的典型用法代码示例。如果您正苦于以下问题:Java ModuleType.BOT属性的具体用法?Java ModuleType.BOT怎么用?Java ModuleType.BOT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类uk.ac.manchester.cs.owlapi.modularity.ModuleType
的用法示例。
在下文中一共展示了ModuleType.BOT属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: minimizedTranslate
/**
* Translate the given {@link GafDocument} into an OWL representation of the LEGO model.
* Additionally minimize the lego model and imports into one ontology module.
*
* @param gaf
* @return minimized lego ontology
*/
public OWLOntology minimizedTranslate(GafDocument gaf) {
OWLOntology all = translate(gaf);
final OWLOntologyManager m = all.getOWLOntologyManager();
SyntacticLocalityModuleExtractor sme = new SyntacticLocalityModuleExtractor(m, all, ModuleType.BOT);
Set<OWLEntity> sig = new HashSet<OWLEntity>(all.getIndividualsInSignature());
Set<OWLAxiom> moduleAxioms = sme.extract(sig);
try {
OWLOntology module = m.createOntology(IRI.generateDocumentIRI());
m.addAxioms(module, moduleAxioms);
return module;
} catch (OWLException e) {
throw new RuntimeException("Could not create minimized lego model.", e);
}
}
示例2: createModule
private void createModule(String ontologyId, String moduleName, Set<OWLEntity> signature)
throws OWLOntologyCreationException, IOException, OWLOntologyStorageException
{
// create a new manager, avoid unnecessary change events
final OWLOntologyManager m = OWLManager.createOWLOntologyManager();
// extract module
SyntacticLocalityModuleExtractor sme = new SyntacticLocalityModuleExtractor(m, mooncat.getOntology(), ModuleType.BOT);
Set<OWLAxiom> moduleAxioms = sme.extract(signature);
OWLOntology module = m.createOntology(IRI.generateDocumentIRI());
m.addAxioms(module, moduleAxioms);
// save module
OutputStream moduleOutputStream = null;
try {
moduleOutputStream = getOutputSteam(getModuleFileName(ontologyId, moduleName));
m.saveOntology(module, moduleOutputStream);
}
finally {
IOUtils.closeQuietly(moduleOutputStream);
}
}
示例3: createModule
private static void createModule(String moduleName, Set<OWLEntity> signature, OWLOntology ont)
throws OWLOntologyCreationException, IOException, OWLOntologyStorageException
{
// create a new manager avoid unnecessary change events
final OWLOntologyManager m = OWLManager.createOWLOntologyManager();
// extract module
SyntacticLocalityModuleExtractor sme = new SyntacticLocalityModuleExtractor(m, ont, ModuleType.BOT);
Set<OWLAxiom> moduleAxioms = sme.extract(signature);
OWLOntology module = m.createOntology(IRI.generateDocumentIRI());
m.addAxioms(module, moduleAxioms);
// save module
OutputStream moduleOutputStream = null;
try {
moduleOutputStream = new FileOutputStream(getModuleFile(moduleName));
m.saveOntology(module, moduleOutputStream);
}
finally {
IOUtils.closeQuietly(moduleOutputStream);
}
}
示例4: create
@Override
public InferenceProvider create(ModelContainer model) throws OWLOntologyCreationException, InterruptedException {
OWLOntology ont = model.getAboxOntology();
final OWLOntologyManager m = ont.getOWLOntologyManager();
OWLOntology module = null;
OWLReasoner reasoner = null;
try {
InferenceProvider provider;
synchronized (ont) {
concurrentLock.acquire();
try {
if (useSLME) {
LOG.info("Creating for module: "+model.getModelId());
ModuleType mtype = ModuleType.BOT;
SyntacticLocalityModuleExtractor sme = new SyntacticLocalityModuleExtractor(m, ont, mtype);
Set<OWLEntity> seeds = new HashSet<OWLEntity>(ont.getIndividualsInSignature());
module = ont = sme.extractAsOntology(seeds, IRI.generateDocumentIRI());
LOG.info("Done creating module: "+model.getModelId());
}
reasoner = rf.createReasoner(ont);
provider = MapInferenceProvider.create(reasoner, ont);
}
finally {
concurrentLock.release();
}
}
return provider;
}
finally {
if (reasoner != null) {
reasoner.dispose();
}
if (module != null) {
m.removeOntology(module);
}
}
}
示例5: computeModule
private Set<OWLAxiom> computeModule(Set<OWLAxiom> contraction, EntailmentChecker checker) {
try {
OWLOntologyManager man = OWLManager.createOWLOntologyManager();
OWLOntology ont = man.createOntology(contraction);
SyntacticLocalityModuleExtractor extractor = new SyntacticLocalityModuleExtractor(man, ont, ModuleType.BOT);
return extractor.extract(checker.getEntailmentSignature());
}
catch (OWLOntologyCreationException e) {
throw new OWLRuntimeException(e);
}
}
示例6: preCheckOntology
protected int preCheckOntology(String inConsistentMsg, String unsatisfiableMsg, String unsatisfiableModule) throws OWLException, IOException {
// pre-check: only try to load ontology iff:
// * ontology is consistent
// * no unsatisfiable classes
OWLReasoner currentReasoner = reasoner;
boolean disposeReasoner = false;
try {
if (currentReasoner == null) {
disposeReasoner = true;
currentReasoner = new ElkReasonerFactory().createReasoner(g.getSourceOntology());
}
boolean consistent = currentReasoner.isConsistent();
if (consistent == false) {
LOG.error(inConsistentMsg);
return -1;
}
Set<OWLClass> unsatisfiable = currentReasoner.getUnsatisfiableClasses().getEntitiesMinusBottom();
if (unsatisfiable.isEmpty() == false) {
LOG.error(unsatisfiableMsg);
OWLPrettyPrinter prettyPrinter = getPrettyPrinter();
for (OWLClass owlClass : unsatisfiable) {
LOG.error("Unsatisfiable: "+prettyPrinter.render(owlClass));
}
LOG.info("Creating module for unsatisfiable classes in file: "+unsatisfiableModule);
ModuleType mtype = ModuleType.BOT;
OWLOntologyManager m = g.getManager();
SyntacticLocalityModuleExtractor sme = new SyntacticLocalityModuleExtractor(m, g.getSourceOntology(), mtype );
Set<OWLEntity> seeds = new HashSet<OWLEntity>(unsatisfiable);
Set<OWLAxiom> axioms = sme.extract(seeds);
OWLOntology module = m.createOntology();
m.addAxioms(module, axioms);
File moduleFile = new File(unsatisfiableModule).getCanonicalFile();
m.saveOntology(module, IRI.create(moduleFile));
return -1;
}
}
finally {
if (disposeReasoner && currentReasoner != null) {
currentReasoner.dispose();
}
}
return 0;
}