当前位置: 首页>>代码示例>>Java>>正文


Java OWLObjectMinCardinality类代码示例

本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectMinCardinality的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectMinCardinality类的具体用法?Java OWLObjectMinCardinality怎么用?Java OWLObjectMinCardinality使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OWLObjectMinCardinality类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLObjectMinCardinality类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public HandlerResult visit(OWLObjectMinCardinality ce) {
	final OWLClassExpression filler = ce.getFiller();
	final HandlerResult recursive = filler.accept(this);
	OWLObjectSomeValuesFrom newCE;
	if (recursive == null) {
		newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), filler);
	}
	else if (recursive.remove) {
		return HandlerResult.remove();
	}
	else {
		newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), recursive.modified);
	}
	return HandlerResult.modified(newCE);
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:17,代码来源:CardinalityContraintsTools.java

示例2: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectMinCardinality ce) {
	// >= 0 r.C \equiv \top
	int cardinality = ce.getCardinality();
	if (cardinality == 0) {
		return df.getOWLThing();
	}
	OWLClassExpression filler = ce.getFiller();
	OWLClassExpression shortenedFiller = filler.accept(this);
	if(shortenedFiller.isOWLNothing()){// >= n r.\bot \equiv \bot if n != 0
		return df.getOWLNothing();
	} else if(!filler.equals(shortenedFiller)){
		return df.getOWLObjectMinCardinality(ce.getCardinality(), ce.getProperty(), shortenedFiller);
	}
	return ce;
}
 
开发者ID:SmartDataAnalytics,项目名称:OWL2SPARQL,代码行数:17,代码来源:OWLClassExpressionMinimizer.java

示例3: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Nonnull
@Override
public OWLClassExpression visit(OWLObjectMinCardinality ce) {
    boolean neg = negated;
    int card = ce.getCardinality();
    if (negated) {
        card = ce.getCardinality() - 1;
        if (card < 0) {
            card = 0;
        }
    }
    negated = false;
    OWLClassExpression filler = ce.getFiller().accept(this);
    OWLClassExpression nnf = null;
    if (neg) {
        nnf = dataFactory.getOWLObjectMaxCardinality(card,
                ce.getProperty(), filler);
    } else {
        nnf = dataFactory.getOWLObjectMinCardinality(card,
                ce.getProperty(), filler);
    }
    negated = neg;
    return nnf;
}
 
开发者ID:matthewhorridge,项目名称:owlapi-gwt,代码行数:25,代码来源:NNF.java

示例4: addToOntology

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMinCardinalityProperty");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMinCardinalityRange");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectMinCardinality minCardinality = factory.getOWLObjectMinCardinality(2, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, minCardinality));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:11,代码来源:OwlObjectMinCardinalityFeature.java

示例5: addToOntology

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMinCardinalityProperty_Lite");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMinCardinalityRange_Lite");
  addToGenericDomainAndNewRange(property, range);

  OWLObjectMinCardinality minCardinality = factory.getOWLObjectMinCardinality(0, property);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, minCardinality));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:11,代码来源:OwlObjectMinCardinalityOwlLiteFeature.java

示例6: addToOntology

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public void addToOntology() {
  OWLObjectProperty property = featurePool.getExclusiveProperty(":objectMinQualifiedCardinalityProperty");
  OWLClass range = featurePool.getExclusiveClass(":ObjectMinQualifiedCardinalityRange");
  addToGenericDomainAndNewRange(property, range);

  OWLClass qualifier = featurePool.getExclusiveClass(":ObjectMinQualifiedCardinality_Qualifier");
  OWLObjectMinCardinality minCardinality = factory.getOWLObjectMinCardinality(1, property, qualifier);

  addAxiomToOntology(factory.getOWLSubClassOfAxiom(range, minCardinality));
}
 
开发者ID:VisualDataWeb,项目名称:OntoBench,代码行数:12,代码来源:OwlObjectMinQualifiedCardinalityFeature.java

示例7: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
public void visit(OWLObjectMinCardinality arg0) {
    try {
        OWLClass c = Utils.ensureClass(arg0.getFiller());
        OWLObjectProperty p = Utils.ensureObjectProperty(arg0.getProperty());

        integrityConstraints.add(integrityConstraintFactory
            .MinObjectParticipationConstraint(subjClass, p, c,
                arg0.getCardinality()));
    } catch (UnsupportedICException e) {
        notSupported(arg0);
    }
}
 
开发者ID:kbss-cvut,项目名称:jopa,代码行数:13,代码来源:IntegrityConstraintClassParser.java

示例8: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectMinCardinality object) {
    m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(object.getProperty().getNamedProperty());
    OWLClassExpression filler=object.getFiller();
    if (isSimple(filler))
        return object;
    else {
        OWLClassExpression definition=getDefinitionFor(filler,m_alreadyExists);
        if (!m_alreadyExists[0])
            m_newInclusions.add(new OWLClassExpression[] { negative(definition),filler });
        return m_factory.getOWLObjectMinCardinality(object.getCardinality(),object.getProperty(),definition);
    }
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:13,代码来源:OWLNormalization.java

示例9: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectMinCardinality d) {
    if (d.getCardinality()==0)
        return m_factory.getOWLNothing();
    else {
        OWLClassExpression filler=getNNF(d.getFiller());
        return m_factory.getOWLObjectMaxCardinality(d.getCardinality()-1,d.getProperty().getSimplified(),filler);
    }
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:9,代码来源:ExpressionManager.java

示例10: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
public void visit(OWLObjectMinCardinality object) {
    LiteralConcept toConcept=getLiteralConcept(object.getFiller());
    Role onRole=getRole(object.getProperty());
    AtLeastConcept atLeastConcept=AtLeastConcept.create(object.getCardinality(),onRole,toConcept);
    if (!atLeastConcept.isAlwaysFalse())
        m_headAtoms.add(Atom.create(atLeastConcept,X));
}
 
开发者ID:robertoyus,项目名称:HermiT-android,代码行数:8,代码来源:OWLClausification.java

示例11: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public OWLObjectMinCardinality visit(
		ElkObjectMinCardinalityQualified expression) {
	return owlFactory_.getOWLObjectMinCardinality(
			expression.getCardinality(), convert(expression.getProperty()),
			convert(expression.getFiller()));
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:8,代码来源:AbstractElkObjectConverter.java

示例12: convert

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@SuppressWarnings("static-method")
public ElkObjectMinCardinality convert(
		OWLObjectMinCardinality owlObjectMaxCardinality) {
	if (owlObjectMaxCardinality.isQualified())
		return new ElkObjectMinCardinalityQualifiedWrap<OWLObjectMinCardinality>(
				owlObjectMaxCardinality);
	// else
	return new ElkObjectMinCardinalityUnqualifiedWrap<OWLObjectMinCardinality>(
			owlObjectMaxCardinality);
}
 
开发者ID:liveontologies,项目名称:elk-reasoner,代码行数:11,代码来源:OwlConverter.java

示例13: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
@Override
public OWLObjectMinCardinality visit(OWLObjectMinCardinality ce) {
	if (LOG.isDebugEnabled()) {
		LOG.debug("Unfolding min_cardinality: "+ce);
	}
	
	OWLClassExpression filler = ce.getFiller();
	if (filler != null) {
		OWLClassExpression unfold = filler.accept(this);
		if (unfold != null) {
			return factory.getOWLObjectMinCardinality(ce.getCardinality(), ce.getProperty(), unfold);
		}
	}
	return null;
}
 
开发者ID:owlcollab,项目名称:owltools,代码行数:16,代码来源:TBoxUnFoldingTool.java

示例14: visit

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
/**
 * According to the naive translation:<br/>
 * <br/>
 * <code>naive(Exists r.A) := not r(X,Y), A(Y)</code>
 *
 * @see org.semanticweb.owlapi.model.OWLClassExpressionVisitor#visit(org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom)
 */

public void visit(OWLObjectSomeValuesFrom objExistential) {
	// we require normalized axioms, therefore we can do the following
	OWLObjectPropertyExpression property = objExistential.getProperty();
	OWLClassExpression fillerClass = objExistential.getFiller();

	OWLObjectMinCardinality minCard = new OWLObjectMinCardinalityImpl(property, 1, fillerClass);
	visit(minCard);
}
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:17,代码来源:DebugTranslation.java

示例15: testUnsatisfiabilityDoToFixedDomain1

import org.semanticweb.owlapi.model.OWLObjectMinCardinality; //导入依赖的package包/类
/**
   * Smth like
   *    A subClassOf r min 5 B
   *  But we have only a domain with 4 elements ...
   */
  public void testUnsatisfiabilityDoToFixedDomain1() {
  	OWLDataFactory factory = OWLManager.getOWLDataFactory();
  	OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
  	
  	OWLClassExpression classA = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "A")));
  	OWLClassExpression classB = factory.getOWLClass(IRI.create(String.format("%s#%s", PREFIX, "B")));
  	OWLObjectPropertyExpression roleR = factory.getOWLObjectProperty(IRI.create(String.format("%s#%s", PREFIX, "r")));
  	
  	OWLNamedIndividual indA = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "a")));
  	OWLNamedIndividual indB = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "b")));
  	OWLNamedIndividual indC = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "c")));
  	OWLNamedIndividual indD = factory.getOWLNamedIndividual(IRI.create(String.format("%s#%s", PREFIX, "d")));

  	OWLIndividualAxiom fact1 = factory.getOWLClassAssertionAxiom(classA, indA);
  	OWLIndividualAxiom fact2 = factory.getOWLClassAssertionAxiom(classA, indB);
  	OWLIndividualAxiom fact3 = factory.getOWLClassAssertionAxiom(classA, indC);
  	OWLIndividualAxiom fact4 = factory.getOWLClassAssertionAxiom(classA, indD);
  	
  	OWLObjectMinCardinality exprRmin5B = factory.getOWLObjectMinCardinality(5, roleR, classB);
  	OWLSubClassOfAxiom axmAsubRsomeB = factory.getOWLSubClassOfAxiom(classA, exprRmin5B);
  	
  	try {
	OWLOntology ontology = manager.createOntology();
	manager.addAxiom(ontology, fact1);
	manager.addAxiom(ontology, fact2);
	manager.addAxiom(ontology, fact3);
	manager.addAxiom(ontology, fact4);
	manager.addAxiom(ontology, axmAsubRsomeB);
	
	Wolpertinger wolpertinger = new Wolpertinger(ontology);
	
	assertFalse(wolpertinger.isConsistent());
} catch (OWLOntologyCreationException e) {
	e.printStackTrace();
	fail();
}
  }
 
开发者ID:wolpertinger-reasoner,项目名称:Wolpertinger,代码行数:43,代码来源:WolpertingerTest.java


注:本文中的org.semanticweb.owlapi.model.OWLObjectMinCardinality类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。