本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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));
}
示例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));
}
示例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));
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
示例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()));
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
}