本文整理匯總了Java中org.semanticweb.owlapi.model.OWLOntology.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLOntology.equals方法的具體用法?Java OWLOntology.equals怎麽用?Java OWLOntology.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.semanticweb.owlapi.model.OWLOntology
的用法示例。
在下文中一共展示了OWLOntology.equals方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addNewDissubsumptions
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private void addNewDissubsumptions() {
OWLOntology negOntology = view.getSelectedOntologyNeg();
if (negOntology.equals(UelModel.EMPTY_ONTOLOGY)) {
negOntology = model.createOntology();
updateView();
view.setSelectedOntologyNeg(negOntology);
}
Set<OWLAxiom> newAxioms = refineController.getDissubsumptions();
for (OWLAxiom axiom : newAxioms) {
if (!(axiom instanceof OWLSubClassOfAxiom)) {
throw new IllegalStateException("Expected new dissubsumptions to be encoded as OWLSubClassOfAxioms.");
}
if (negOntology.containsAxiom(axiom)) {
throw new IllegalStateException("The negative goal already contains the following axiom: " + axiom);
}
negOntology.getOWLOntologyManager().addAxiom(negOntology, axiom);
}
undoStack.push(newAxioms);
}
示例2: addSupportOntologiesFromImportsClosure
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
/**
* Each ontology in the import closure of the source ontology
* (and the import closure of each existing support ontology, if
* doForAllSupportOntologies is true) is added to
* the list of support ontologies
*
* @param doForAllSupportOntologies
*/
public void addSupportOntologiesFromImportsClosure(boolean doForAllSupportOntologies) {
Set<OWLOntology> ios = new HashSet<OWLOntology>();
ios.add(sourceOntology);
if (doForAllSupportOntologies) {
ios.addAll(getSupportOntologySet());
}
for (OWLOntology so : ios) {
for (OWLOntology o : so.getImportsClosure()) {
if (o.equals(sourceOntology))
continue;
addSupportOntology(o);
}
}
}
示例3: mergeImportClosure
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public void mergeImportClosure(boolean isRemovedImportsDeclarations) throws OWLOntologyCreationException {
OWLOntologyManager manager = getManager();
Set<OWLOntology> imports = sourceOntology.getImportsClosure();
for (OWLOntology o : imports) {
if (o.equals(sourceOntology))
continue;
String comment = "Includes "+summarizeOntology(o);
LOG.info(comment);
addCommentToOntology(sourceOntology, comment);
manager.addAxioms(sourceOntology, o.getAxioms());
}
Set<OWLImportsDeclaration> oids = sourceOntology.getImportsDeclarations();
for (OWLImportsDeclaration oid : oids) {
RemoveImport ri = new RemoveImport(sourceOntology, oid);
getManager().applyChange(ri);
}
}
示例4: mergeSpecificImport
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
/**
* Merge a specific ontology from the import closure into the main ontology.
* Removes the import statement.
*
* @param ontologyIRI id of the ontology to merge
* @throws OWLOntologyCreationException
*/
public void mergeSpecificImport(IRI ontologyIRI) throws OWLOntologyCreationException {
OWLOntologyManager manager = getManager();
Set<OWLOntology> imports = sourceOntology.getImportsClosure();
for (OWLOntology o : imports) {
if (o.equals(sourceOntology))
continue;
Optional<IRI> currentIRI = o.getOntologyID().getOntologyIRI();
if (currentIRI.isPresent() && currentIRI.get().equals(ontologyIRI)) {
String comment = "Includes "+summarizeOntology(o);
LOG.info(comment);
addCommentToOntology(sourceOntology, comment);
manager.addAxioms(sourceOntology, o.getAxioms());
}
}
Set<OWLImportsDeclaration> oids = sourceOntology.getImportsDeclarations();
for (OWLImportsDeclaration oid : oids) {
if (ontologyIRI.equals(oid.getIRI())) {
RemoveImport ri = new RemoveImport(sourceOntology, oid);
getManager().applyChange(ri);
}
}
}
示例5: ontologiesChanged
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
@Override
public void ontologiesChanged(List<? extends OWLOntologyChange> changes) {
Set<OWLOntology> importClosure = null;
for (OWLOntologyChange change : changes) {
OWLOntology changedOntology = change.getOntology();
if (!changedOntology.equals(owlOntology_)) {
if (importClosure == null) {
importClosure = owlOntology_.getImportsClosure();
}
if (!importClosure.contains(changedOntology)) {
LOGGER_.trace(
"Ignoring the change not applicable to the current ontology: {}"
+ change);
continue;
}
}
if (!change.isAxiomChange()) {
LOGGER_.trace(
"Non-axiom change: {}\n The ontology will be reloaded.",
change);
// cannot handle non-axiom changes incrementally
ontologyReloadRequired_ = true;
} else {
bufferedChangesLoader_.registerChange(change);
}
}
if (!isBufferingMode_)
flush();
}
示例6: OntologySetMetadata
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public OntologySetMetadata(OWLOntology ont) {
ontologies = new HashSet<OntologyMetadata>();
for (OWLOntology io : ont.getImportsClosure()) {
OntologyMetadata om = new OntologyMetadata(io);
ontologies.add(om);
if (io.equals(ont)) {
om.isRoot = true;
}
}
}
示例7: reasonLeavingOneOut
import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public void reasonLeavingOneOut(OWLOntology leaveOutOntology) throws OWLOntologyCreationException {
OWLOntologyManager m = getManager();
OWLOntology ont2 = m.createOntology();
LOG.info("LEAVE ONE OUT: "+leaveOutOntology);
for (OWLOntology io : ontology.getImportsClosure()) {
if (io.equals(leaveOutOntology)) {
LOG.info("SKIPPING:"+io);
continue;
}
m.addAxioms(ont2, io.getAxioms());
}
OWLReasoner reasoner = rf.createReasoner(ont2);
for (OWLEdge e : edges) {
if (!e.isJustified) {
// there is no point checking unjustified edges;
// these are edges that when removed cannot be re-inferred using the entire ontology set.
// as reasoning is monotonic, removing imports cannot bring it back.
continue;
}
//LOG.info("Testing "+e);
if (!isEdgeEntailed(e, ont2, reasoner)) {
IRI req = leaveOutOntology.getOntologyID().getOntologyIRI().orNull();
LOG.info(e + " requires "+req);
e.requires.add(req);
}
}
reasoner.dispose();
}