本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectIntersectionOf类的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectIntersectionOf类的具体用法?Java OWLObjectIntersectionOf怎么用?Java OWLObjectIntersectionOf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OWLObjectIntersectionOf类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLObjectIntersectionOf类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getExplicitDLDisjointnessAxioms
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
/**
* A ^ B -> bottom
* @param reasoner
* @param ontology
* @param cls
* @author Shuo Zhang
* @return
*/
public static OWLClassNodeSet getExplicitDLDisjointnessAxioms(OWLReasoner reasoner, OWLOntology ontology, OWLClass cls){
OWLClassNodeSet nodeSet = new OWLClassNodeSet();
OWLClassExpression subExp;
Set<OWLClassExpression> set;
for (OWLSubClassOfAxiom sax : ontology.getSubClassAxiomsForSuperClass(OWLManager.getOWLDataFactory().getOWLNothing())) {
subExp = sax.getSubClass();
if (subExp instanceof OWLObjectIntersectionOf) {
set = subExp.asConjunctSet();
if (set.contains(cls) && set.size() == 2) {
for (OWLClassExpression op : set) {
if (!op.equals(cls) && !op.isAnonymous()) {
nodeSet.addNode(reasoner.getEquivalentClasses(op));
break;
}
}
}
}
}
return nodeSet;
}
开发者ID:ernestojimenezruiz,项目名称:logmap-matcher,代码行数:33,代码来源:DisjointnessAxiomExtractor.java
示例2: buildSimpleDefMap
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private void buildSimpleDefMap() {
simpleDefMap = new HashMap<OWLClass,Set<OWLClassExpression>>();
OWLOntology o = getGraph().getSourceOntology();
for (OWLClass c : o.getClassesInSignature()) {
for (OWLEquivalentClassesAxiom eca : o.getEquivalentClassesAxioms(c)) {
Set<OWLClassExpression> elts = new HashSet<OWLClassExpression>();
for (OWLClassExpression x : eca.getClassExpressions()) {
// assume one logical definitionper class - otherwise choose arbitrary
if (x instanceof OWLObjectIntersectionOf) {
if (getReachableOWLClasses(x, elts) && elts.size() > 0) {
//LOG.info(c+" def= "+elts);
simpleDefMap.put(c, elts);
}
}
}
}
}
}
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:CompositionalClassPredictor.java
示例3: getLowestCommonSubsumerClass
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
/**
* generates a LCS expression and makes it a class if it is a class expression
*
* @param a
* @param b
* @return named class representing LCS
*/
public OWLClass getLowestCommonSubsumerClass(OWLClassExpression a, OWLClassExpression b) {
OWLClassExpressionPair pair = new OWLClassExpressionPair(a,b);
if (lcsCache.containsKey(pair)) {
return lcsCache.get(pair);
}
OWLClassExpression x = getLowestCommonSubsumer(a,b);
OWLClass lcs;
if (lcsExpressionToClass.containsKey(x)) {
lcs = lcsExpressionToClass.get(x);
}
if (x instanceof OWLClass)
lcs = (OWLClass)x;
else if (x instanceof OWLObjectIntersectionOf)
lcs = makeClass((OWLObjectIntersectionOf) x);
else
lcs = null;
lcsCache.put(pair, lcs);
return lcs;
}
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:OldSimpleOwlSim.java
示例4: expressionToClass
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private OWLClass expressionToClass(OWLClassExpression x) {
if (x instanceof OWLClass)
return (OWLClass)x;
if (this.expressionToClassMap.containsKey(x))
return this.expressionToClassMap.get(x);
OWLClass c = owlDataFactory.getOWLClass(IRI.create("http://owlsim.org#"+idNum));
idNum++;
OWLEquivalentClassesAxiom eca =
owlDataFactory.getOWLEquivalentClassesAxiom(c, x);
owlOntologyManager.addAxiom(sourceOntology, eca);
expressionToClassMap.put(x, c);
// fully fold tbox (AND and SOME only)
if (x instanceof OWLObjectIntersectionOf) {
for (OWLClassExpression y : ((OWLObjectIntersectionOf)x).getOperands()) {
expressionToClass(y);
}
}
else if (x instanceof OWLObjectSomeValuesFrom) {
expressionToClass(((OWLObjectSomeValuesFrom)x).getFiller());
}
return c;
}
开发者ID:owlcollab,项目名称:owltools,代码行数:25,代码来源:OldSimpleOwlSim.java
示例5: getLowestCommonSubsumerClass
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
/**
* generates a LCS expression and makes it a class if it is a class expression
*
* @param a
* @param b
* @param leafClasses
* @return named class representing LCS
*/
public OWLClass getLowestCommonSubsumerClass(OWLClassExpression a, OWLClassExpression b, Set<OWLClass> leafClasses) {
OWLClassExpressionPair pair = new OWLClassExpressionPair(a,b);
if (lcsCache.containsKey(pair)) {
return lcsCache.get(pair);
}
OWLClassExpression x = getLowestCommonSubsumer(a,b,leafClasses);
OWLClass lcs;
/*
if (lcsExpressionToClass.containsKey(x)) {
lcs = lcsExpressionToClass.get(x);
}
*/
if (x instanceof OWLClass)
lcs = (OWLClass)x;
else if (x instanceof OWLObjectIntersectionOf)
lcs = makeClass((OWLObjectIntersectionOf) x);
else
lcs = null;
lcsCache.put(pair, lcs);
//LOG.info("LCS of "+a+" + "+b+" = "+lcs);
return lcs;
}
开发者ID:owlcollab,项目名称:owltools,代码行数:33,代码来源:LCSEnabledSimPreProcessor.java
示例6: gatherProperties
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private void gatherProperties(OWLClassExpression x) {
if (x instanceof OWLClass) {
return;
}
else if (x instanceof OWLObjectIntersectionOf) {
for (OWLClassExpression y : ((OWLObjectIntersectionOf)x).getOperands()) {
gatherProperties(y);
}
}
else if (x instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom)x;
gatherProperties(svf.getProperty());
gatherProperties(svf.getFiller());
}
else {
//
}
}
开发者ID:owlcollab,项目名称:owltools,代码行数:19,代码来源:AutomaticSimPreProcessor.java
示例7: makeExpression
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
public Expression makeExpression(OWLClassExpression x) {
if (x.isAnonymous()) {
if (x instanceof OWLObjectIntersectionOf) {
return makeIntersectionOf((OWLObjectIntersectionOf)x);
}
else if (x instanceof OWLObjectSomeValuesFrom) {
return makeSomeValuesFrom((OWLObjectSomeValuesFrom)x);
}
else {
return null;
}
}
else {
return makeClassStub(x);
}
}
开发者ID:owlcollab,项目名称:owltools,代码行数:17,代码来源:FrameMaker.java
示例8: visit
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
@Override
public HandlerResult visit(OWLObjectIntersectionOf intersectionOf) {
Set<OWLClassExpression> newOperands = new HashSet<OWLClassExpression>();
boolean changed = false;
for (OWLClassExpression ce : intersectionOf.getOperands()) {
HandlerResult handlerResult = ce.accept(this);
if (handlerResult != null) {
if (handlerResult.remove) {
return HandlerResult.remove();
}
changed = true;
newOperands.add(handlerResult.modified);
}
else {
newOperands.add(ce);
}
}
if (changed) {
if (newOperands.size() == 1) {
return HandlerResult.modified(newOperands.iterator().next());
}
return HandlerResult.modified(factory.getOWLObjectIntersectionOf(newOperands));
}
return null;
}
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:CardinalityContraintsTools.java
示例9: handleIntersection
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private void handleIntersection(List<CheckWarning> warnings, Set<OWLOntology> allOntologies,
OWLEquivalentClassesAxiom axiom, OWLObjectIntersectionOf intersection, OWLPrettyPrinter pp)
{
for(OWLClassExpression operand : intersection.getOperandsAsList()) {
OWLClass operandCls = null;
if (!operand.isAnonymous()) {
operandCls = operand.asOWLClass();
}
else if (operand instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom ristriction = (OWLObjectSomeValuesFrom) operand;
OWLClassExpression filler = ristriction.getFiller();
if (!filler.isAnonymous()) {
operandCls = filler.asOWLClass();
}
}
else {
// not translatable to OBO
handleGeneric(warnings, allOntologies, axiom, operand, pp);
}
if (operandCls != null && isDangling(operandCls, allOntologies)) {
final IRI iri = operandCls.getIRI();
String message = "Dangling reference "+iri+" in INTERSECTION_OF axiom: "+pp.render(axiom);
warnings.add(new CheckWarning(getID(), message , isFatal(), iri, OboFormatTag.TAG_INTERSECTION_OF.getTag()));
}
}
}
开发者ID:owlcollab,项目名称:owltools,代码行数:27,代码来源:DanglingReferenceCheck.java
示例10: getNextPossibleSymptom
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
public String getNextPossibleSymptom() {
OWLClass disease = model.getClass("Disease");
OWLObjectUnionOf allDiseases = model.getDataFactory().getOWLObjectUnionOf(model.getSubOfExpression(disease));
OWLObjectIntersectionOf intersectionOfSelected = getIntersectionOfSelected();
OWLObjectUnionOf unionOfSubSelected = model.getDataFactory().getOWLObjectUnionOf(model.getSubOfExpression(intersectionOfSelected));
OWLObjectIntersectionOf possibleDiseasesIntersection = model.getDataFactory().getOWLObjectIntersectionOf(allDiseases, unionOfSubSelected);
Set<OWLClass> possibleDiseases = model.getSubOfExpression(possibleDiseasesIntersection);
possibleDiseases.addAll(model.getEquivalentOfExpression(possibleDiseasesIntersection));
possibleDiseases.remove(model.getDataFactory().getOWLNothing());
Set<OWLClass> possibleSymptoms = new TreeSet<OWLClass>();
Iterator<OWLClass> possibleDiseasesIterator = possibleDiseases.iterator();
while (possibleDiseasesIterator.hasNext()) {
OWLClass next = possibleDiseasesIterator.next();
possibleSymptoms.addAll(model.getSuperOfExpression(next));
}
possibleSymptoms.remove(model.getDataFactory().getOWLThing());
possibleSymptoms.remove(model.getClass("Disease"));
possibleSymptoms.removeAll(selectedSymptoms);
possibleSymptoms.removeAll(notSelectedSymptoms);
System.out.println(possibleDiseases);
if(possibleSymptoms.size()!=0 && possibleDiseases.size()>1)
return (new SimpleShortFormProvider().getShortForm((OWLClass)possibleSymptoms.toArray()[0])).substring(7);
else
return null;
}
开发者ID:UyumazHakan,项目名称:SemanticMedic,代码行数:27,代码来源:DiseaseQueryMaker.java
示例11: getPossibleDisease
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
public String getPossibleDisease(){
OWLClass disease = model.getClass("Disease");
OWLObjectUnionOf allDiseases = model.getDataFactory().getOWLObjectUnionOf(model.getSubOfExpression(disease));
OWLObjectIntersectionOf intersectionOfSelected = getIntersectionOfSelected();
OWLObjectUnionOf unionOfSubSelected = model.getDataFactory().getOWLObjectUnionOf(model.getSubOfExpression(intersectionOfSelected));
OWLObjectIntersectionOf possibleDiseasesIntersection = model.getDataFactory().getOWLObjectIntersectionOf(allDiseases, unionOfSubSelected);
Set<OWLClass> possibleDiseases = model.getSubOfExpression(possibleDiseasesIntersection);
possibleDiseases.addAll(model.getEquivalentOfExpression(possibleDiseasesIntersection));
possibleDiseases.remove(model.getDataFactory().getOWLNothing());
String value="";
if(possibleDiseases.size()!=0) {
Iterator<OWLClass> it = possibleDiseases.iterator();
while (it.hasNext()) {
value+="\n"+new SimpleShortFormProvider().getShortForm(it.next());
}
}else
value+="\nCould not found";
return value;
}
开发者ID:UyumazHakan,项目名称:SemanticMedic,代码行数:20,代码来源:DiseaseQueryMaker.java
示例12: formatClassExpression
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
public static String formatClassExpression(OWLClassExpression ce,
OWLOntology ont) {
if (ce instanceof OWLClass) {
return getLabel(ce.asOWLClass(), ont);
} else if (ce instanceof OWLObjectIntersectionOf) {
OWLObjectIntersectionOf oi = (OWLObjectIntersectionOf) ce;
List<OWLClassExpression> ops = oi.getOperandsAsList();
StringBuilder sb = new StringBuilder();
sb.append(formatClassExpression(ops.get(0), ont));
for (int i = 1; i < ops.size(); i++) {
sb.append(" \u2229 ");
sb.append(formatClassExpression(ops.get(i), ont));
}
return sb.toString();
} else if (ce instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom osv = (OWLObjectSomeValuesFrom) ce;
OWLObjectPropertyExpression ope = osv.getProperty();
String role = (!ope.isAnonymous()) ? getLabel(
ope.asOWLObjectProperty(), ont) : ope.toString();
return "\u2203" + role + ".("
+ formatClassExpression(osv.getFiller(), ont) + ")";
} else {
return ce.toString();
}
}
开发者ID:aehrc,项目名称:snorocket,代码行数:26,代码来源:DebugUtils.java
示例13: addToOntology
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLClass c1 = featurePool.getExclusiveClass(":ObjectIntersectionOf_QL_Class1");
OWLClass c2 = featurePool.getExclusiveClass(":ObjectIntersectionOf_QL_Class2");
OWLObjectIntersectionOf spork = factory.getOWLObjectIntersectionOf(c1, c2);
OWLClass owlClass = featurePool.getExclusiveClass(":ObjectIntersectionOf_QL");
addAxiomToOntology(factory.getOWLSubClassOfAxiom(owlClass, spork));
}
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:11,代码来源:OwlObjectIntersectionOfOwl2QlFeature.java
示例14: addToOntology
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLClass c1 = featurePool.getExclusiveClass(":ObjectIntersectionOf_Class1");
OWLClass c2 = featurePool.getExclusiveClass(":ObjectIntersectionOf_Class2");
OWLObjectIntersectionOf spork = factory.getOWLObjectIntersectionOf(c1, c2);
OWLClass owlClass = featurePool.getExclusiveClass(":ObjectIntersectionOf");
OWLAxiom axiom = factory.getOWLEquivalentClassesAxiom(owlClass, spork);
addAxiomToOntology(axiom);
}
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:12,代码来源:OwlObjectIntersectionOfFeature.java
示例15: flattenClassExpression
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private Set<Integer> flattenClassExpression(OWLClassExpression expression, Set<Definition> newDefinitions,
Set<Integer> newNames) {
if (expression instanceof OWLClass) {
return flattenClass((OWLClass) expression, newNames);
}
if (expression instanceof OWLObjectIntersectionOf) {
return flattenConjunction((OWLObjectIntersectionOf) expression, newDefinitions, newNames);
}
if (expression instanceof OWLObjectSomeValuesFrom) {
return flattenExistentialRestriction((OWLObjectSomeValuesFrom) expression, newDefinitions, newNames);
}
throw new RuntimeException("Unsupported class expression: " + expression);
}
开发者ID:julianmendez,项目名称:uel,代码行数:14,代码来源:UelOntology.java
示例16: flattenConjunction
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private Set<Integer> flattenConjunction(OWLObjectIntersectionOf conjunction, Set<Definition> newDefinitions,
Set<Integer> newNames) {
Set<Integer> atomIds = new HashSet<>();
for (OWLClassExpression operand : conjunction.getOperands()) {
atomIds.addAll(flattenClassExpression(operand, newDefinitions, newNames));
}
return atomIds;
}
开发者ID:julianmendez,项目名称:uel,代码行数:9,代码来源:UelOntology.java
示例17: getConceptForOwlClassExpression
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
/**
* Load owl class.
*
* @param expr the owl class
* @param ontology the ontology
* @param level the level
* @return the concept
* @throws Exception the exception
*/
private Concept getConceptForOwlClassExpression(OWLClassExpression expr,
OWLOntology ontology, int level) throws Exception {
// Log it
if (expr instanceof OWLClass) {
OwlUtility.logOwlClass((OWLClass) expr, ontology, level);
} else {
OwlUtility.logOwlClassExpression(expr, ontology, level);
}
// Handle direct OWLClass
if (expr instanceof OWLClass) {
return getConceptForOwlClass((OWLClass) expr, ontology, level);
}
// Handle ObjectIntersectionOf
else if (expr instanceof OWLObjectIntersectionOf) {
return getConceptForIntersectionOf((OWLObjectIntersectionOf) expr,
ontology, level);
}
// Handle ObjectUnionOf
else if (expr instanceof OWLObjectUnionOf) {
return getConceptForUnionOf((OWLObjectUnionOf) expr, ontology, level);
}
// Handle ObjectSomeValuesFrom
else if (expr instanceof OWLObjectSomeValuesFrom) {
return getConceptForSomeValuesFrom((OWLObjectSomeValuesFrom) expr,
ontology, level);
}
else {
throw new Exception("Unexpected class expression type - "
+ expr.getClassExpressionType());
}
}
开发者ID:WestCoastInformatics,项目名称:UMLS-Terminology-Server,代码行数:49,代码来源:OwlLoaderAlgorithm.java
示例18: negativeBranch
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private boolean negativeBranch(Set<ConceptType> conceptTypes,
List<OWLClass> atoms,
OWLReasoner reasoner,
int conceptTypeNumber,
ConceptType partialConceptType,
int atomIndex,
boolean satNeeded) {
boolean result = false;
OWLClass nextAtom = atoms.get( atomIndex );
OWLObjectIntersectionOf exprCopy = partialConceptType.getConjunctiveExpr();
//Conjunction with a negative literal
if (!partialConceptType.containsPositive( nextAtom )) {
partialConceptType.addNegative( nextAtom );
result = generate( conceptTypes,
atoms,
reasoner,
conceptTypeNumber,
partialConceptType,
atomIndex + 1,
satNeeded);
partialConceptType.removeNegative( nextAtom );
partialConceptType.setConjunctiveExpr( exprCopy );
}
return result;
}
开发者ID:klinovp,项目名称:pronto,代码行数:31,代码来源:ConceptTypeSetGeneratorImpl.java
示例19: positiveBranch
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
private boolean positiveBranch( Set<ConceptType> conceptTypes,
List<OWLClass> atoms,
OWLReasoner reasoner,
int conceptTypeNumber,
ConceptType partialConceptType,
int atomIndex,
boolean satNeeded) {
boolean result = false;
OWLClass nextAtom = atoms.get( atomIndex );
OWLObjectIntersectionOf exprCopy = partialConceptType.getConjunctiveExpr();
// Conjunction with a positive literal
if (!partialConceptType.containsNegative( nextAtom )) {
partialConceptType.addPositive( nextAtom );
result = generate( conceptTypes,
atoms,
reasoner,
conceptTypeNumber,
partialConceptType,
atomIndex + 1,
satNeeded);
partialConceptType.removePositive( nextAtom );
partialConceptType.setConjunctiveExpr( exprCopy );
}
return result;
}
开发者ID:klinovp,项目名称:pronto,代码行数:31,代码来源:ConceptTypeSetGeneratorImpl.java
示例20: visit
import org.semanticweb.owlapi.model.OWLObjectIntersectionOf; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectIntersectionOf object) {
OWLClassExpression definition=getDefinitionFor(object,m_alreadyExists);
if (!m_alreadyExists[0])
for (OWLClassExpression description : object.getOperands())
m_newInclusions.add(new OWLClassExpression[] { negative(definition),description });
return definition;
}
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:8,代码来源:OWLNormalization.java
注:本文中的org.semanticweb.owlapi.model.OWLObjectIntersectionOf类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论