當前位置: 首頁>>代碼示例>>Java>>正文


Java OWLOntology.getObjectPropertyAssertionAxioms方法代碼示例

本文整理匯總了Java中org.semanticweb.owlapi.model.OWLOntology.getObjectPropertyAssertionAxioms方法的典型用法代碼示例。如果您正苦於以下問題:Java OWLOntology.getObjectPropertyAssertionAxioms方法的具體用法?Java OWLOntology.getObjectPropertyAssertionAxioms怎麽用?Java OWLOntology.getObjectPropertyAssertionAxioms使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.semanticweb.owlapi.model.OWLOntology的用法示例。


在下文中一共展示了OWLOntology.getObjectPropertyAssertionAxioms方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getExpressions

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
private Set<OWLObjectSomeValuesFrom> getExpressions(OWLNamedIndividual i, OWLOntology model) {
	Set<OWLObjectSomeValuesFrom> result = new HashSet<OWLObjectSomeValuesFrom>();
	Set<OWLObjectPropertyAssertionAxiom> axioms = model.getObjectPropertyAssertionAxioms(i);
	for (OWLObjectPropertyAssertionAxiom ax : axioms) {
		if (enabledBy.equals(ax.getProperty())) {
			continue;
		}
		OWLIndividual object = ax.getObject();
		if (object.isNamed()) {
			Set<OWLClass> types = getTypes(object.asOWLNamedIndividual(), model);
			for (OWLClass cls : types) {
				result.add(createSvf(ax.getProperty(), cls));
			}
		}
	}
	return result;
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:18,代碼來源:LegoModelWalker.java

示例2: removeFact

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public Set<IRI> removeFact(ModelContainer model, OWLObjectPropertyExpression p,
		OWLIndividual i, OWLIndividual j, METADATA metadata) {
	OWLDataFactory f = model.getOWLDataFactory();
	
	OWLOntology ont = model.getAboxOntology();
	OWLAxiom toRemove = null;
	Set<IRI> iriSet = new HashSet<IRI>();
	Set<OWLObjectPropertyAssertionAxiom> candidates = ont.getObjectPropertyAssertionAxioms(i);
	for (OWLObjectPropertyAssertionAxiom axiom : candidates) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toRemove = axiom;
			extractEvidenceIRIValues(axiom.getAnnotations(), iriSet);
			break;
		}
	}
	if (toRemove == null) {
		// fall back solution
		toRemove = f.getOWLObjectPropertyAssertionAxiom(p, i, j);
	}
	removeAxiom(model, toRemove, metadata);
	return iriSet;
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:23,代碼來源:CoreMolecularModelManager.java

示例3: removeAnnotations

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public OWLObjectPropertyAssertionAxiom removeAnnotations(ModelContainer model, OWLObjectPropertyExpression p,
		OWLNamedIndividual i, OWLNamedIndividual j, Set<OWLAnnotation> annotations, METADATA metadata) {
	OWLOntology ont = model.getAboxOntology();
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	OWLObjectPropertyAssertionAxiom toModify = null;
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toModify = axiom;
			break;
		}
	}
	OWLObjectPropertyAssertionAxiom newAxiom = null;
	if (toModify != null) {
		Set<OWLAnnotation> combindedAnnotations = new HashSet<OWLAnnotation>(toModify.getAnnotations());
		combindedAnnotations.removeAll(annotations);
		newAxiom = modifyAnnotations(toModify, combindedAnnotations, model, metadata);
	}
	return newAxiom;
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:20,代碼來源:CoreMolecularModelManager.java

示例4: addAnnotations

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public void addAnnotations(ModelContainer model, OWLObjectPropertyExpression p,
		OWLNamedIndividual i, OWLNamedIndividual j, Set<OWLAnnotation> annotations,
		METADATA metadata) {
	OWLOntology ont = model.getAboxOntology();
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	OWLObjectPropertyAssertionAxiom toModify = null;
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toModify = axiom;
			break;
		}
	}
	addAnnotations(model, toModify, annotations, metadata);
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:15,代碼來源:CoreMolecularModelManager.java

示例5: updateAnnotation

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public void updateAnnotation(ModelContainer model, OWLObjectPropertyExpression p,
		OWLNamedIndividual i, OWLNamedIndividual j, OWLAnnotation update,
		METADATA metadata) {
	OWLOntology ont = model.getAboxOntology();
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	OWLObjectPropertyAssertionAxiom toModify = null;
	for (OWLObjectPropertyAssertionAxiom axiom : axioms) {
		if (p.equals(axiom.getProperty()) && j.equals(axiom.getObject())) {
			toModify = axiom;
			break;
		}
	}
	updateAnnotation(model, toModify, update, metadata);
}
 
開發者ID:geneontology,項目名稱:minerva,代碼行數:15,代碼來源:CoreMolecularModelManager.java

示例6: getObjectPropertyValues

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(OWLNamedIndividual ind, OWLObjectPropertyExpression pe) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
    ensurePrepared();
    OWLNamedIndividualNodeSet result = new OWLNamedIndividualNodeSet();
    Node<OWLObjectPropertyExpression> inverses = getInverseObjectProperties(pe);
    for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
        for (OWLObjectPropertyAssertionAxiom axiom : ontology.getObjectPropertyAssertionAxioms(ind)) {
            if (!axiom.getObject().isAnonymous()) {
                if (axiom.getProperty().getSimplified().equals(pe.getSimplified())) {
                    if (getIndividualNodeSetPolicy().equals(IndividualNodeSetPolicy.BY_SAME_AS)) {
                        result.addNode(getSameIndividuals(axiom.getObject().asOWLNamedIndividual()));
                    }
                    else {
                        result.addNode(new OWLNamedIndividualNode(axiom.getObject().asOWLNamedIndividual()));
                    }
                }
            }
            // Inverse of pe
            if (axiom.getObject().equals(ind) && !axiom.getSubject().isAnonymous()) {
                OWLObjectPropertyExpression invPe = axiom.getProperty().getInverseProperty().getSimplified();
                if (!invPe.isAnonymous() && inverses.contains(invPe.asOWLObjectProperty())) {
                    if (getIndividualNodeSetPolicy().equals(IndividualNodeSetPolicy.BY_SAME_AS)) {
                        result.addNode(getSameIndividuals(axiom.getObject().asOWLNamedIndividual()));
                    }
                    else {
                        result.addNode(new OWLNamedIndividualNode(axiom.getObject().asOWLNamedIndividual()));
                    }
                }
            }

        }
    }
    // Could do other stuff like inspecting owl:hasValue restrictions
    return result;
}
 
開發者ID:ernestojimenezruiz,項目名稱:logmap-matcher,代碼行數:35,代碼來源:StructuralReasoner2.java

示例7: getObjectPropertyValues

import org.semanticweb.owlapi.model.OWLOntology; //導入方法依賴的package包/類
public static Map<OWLObjectPropertyExpression, Set<OWLIndividual>> getObjectPropertyValues(OWLIndividual i, OWLOntology ont) {
	Set<OWLObjectPropertyAssertionAxiom> axioms = ont.getObjectPropertyAssertionAxioms(i);
	Map<OWLObjectPropertyExpression, Set<OWLIndividual>> result = new HashMap<>();
	for(OWLObjectPropertyAssertionAxiom ax : axioms) {
		Set<OWLIndividual> inds = result.get(ax.getProperty());
		if (inds == null) {
			inds = new HashSet<>();
			result.put(ax.getProperty(), inds);
		}
		inds.add(ax.getObject());
	}
	return result;
}
 
開發者ID:owlcollab,項目名稱:owltools,代碼行數:14,代碼來源:OwlHelper.java


注:本文中的org.semanticweb.owlapi.model.OWLOntology.getObjectPropertyAssertionAxioms方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。