本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectAllValuesFrom类的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectAllValuesFrom类的具体用法?Java OWLObjectAllValuesFrom怎么用?Java OWLObjectAllValuesFrom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLObjectAllValuesFrom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLObjectAllValuesFrom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addToOntology
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLObjectProperty property = featurePool.getExclusiveProperty(":objectAllValuesFromProperty");
OWLClass range = featurePool.getExclusiveClass(":ObjectAllValuesFromRange");
OWLObjectAllValuesFrom restriction = factory.getOWLObjectAllValuesFrom(property, range);
OWLClass allValuesFrom = featurePool.getExclusiveClass(":ObjectAllValuesFrom");
addAxiomToOntology(factory.getOWLSubClassOfAxiom(allValuesFrom, restriction));
}
示例2: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
public void visit(OWLObjectAllValuesFrom arg0) {
try {
OWLObjectProperty op = Utils.ensureObjectProperty(arg0.getProperty());
OWLClass clz = Utils.ensureClass(arg0.getFiller());
integrityConstraints.add(integrityConstraintFactory
.ObjectPropertyRangeConstraint(subjClass, op, clz));
} catch (UnsupportedICException e) {
notSupported(arg0);
}
}
示例3: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectAllValuesFrom object) {
m_axioms.m_objectPropertiesOccurringInOWLAxioms.add(object.getProperty().getNamedProperty());
OWLClassExpression filler=object.getFiller();
if (isSimple(filler) || isNominal(filler) || isNegatedOneNominal(filler))
// The nominal cases are optimizations.
return object;
else {
OWLClassExpression definition=getDefinitionFor(filler,m_alreadyExists);
if (!m_alreadyExists[0])
m_newInclusions.add(new OWLClassExpression[] { negative(definition),filler });
return m_factory.getOWLObjectAllValuesFrom(object.getProperty(),definition);
}
}
示例4: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
public OWLClassExpression visit(OWLObjectAllValuesFrom d) {
OWLClassExpression filler=getSimplified(d.getFiller());
if (filler.isOWLThing())
return m_factory.getOWLThing();
else
return m_factory.getOWLObjectAllValuesFrom(d.getProperty().getSimplified(),filler);
}
示例5: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public OWLObjectAllValuesFrom visit(OWLObjectAllValuesFrom ce) {
if (LOG.isDebugEnabled()) {
LOG.debug("Unfolding all_values_from: "+ce);
}
OWLClassExpression filler = ce.getFiller();
if (filler != null) {
OWLClassExpression unfold = filler.accept(this);
if (unfold != null) {
return factory.getOWLObjectAllValuesFrom(ce.getProperty(), unfold);
}
}
return null;
}
示例6: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public Void visit(OWLObjectAllValuesFrom desc) {
long restriction =
getOrCreateNode(getIri(desc), OwlLabels.OWL_ALL_VALUES_FROM, OwlLabels.OWL_ANONYMOUS);
if (!desc.getProperty().isAnonymous()) {
long property = getOrCreateNode(getIri(desc.getProperty()));
getOrCreateRelationship(restriction, property, OwlRelationships.PROPERTY);
long cls = getOrCreateNode(getIri(desc.getFiller()));
getOrCreateRelationship(restriction, cls, OwlRelationships.FILLER);
}
return null;
}
示例7: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectAllValuesFrom ce) {
OWLClassExpression filler = ce.getFiller();
OWLClassExpression shortenedFiller = filler.accept(this);
if(shortenedFiller.isOWLThing()){// \forall r.\top \equiv \top
return df.getOWLThing();
} else if(beautify && shortenedFiller.isOWLNothing()) {// \forall r.\bot to \neg \exists r.\top
return df.getOWLObjectComplementOf(df.getOWLObjectSomeValuesFrom(ce.getProperty(), df.getOWLThing()));
} else if(!filler.equals(shortenedFiller)){
return df.getOWLObjectAllValuesFrom(ce.getProperty(), shortenedFiller);
}
return ce;
}
示例8: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public OWLClassExpression visit(OWLObjectAllValuesFrom ce) {
OWLClassExpression filler = ce.getFiller().accept(this);
if (negated) {
return dataFactory.getOWLObjectSomeValuesFrom(ce.getProperty(),
filler);
} else {
return dataFactory.getOWLObjectAllValuesFrom(ce.getProperty(),
filler);
}
}
示例9: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public Set<OWLClassExpression> visit(OWLObjectAllValuesFrom ce) {
Set<OWLClassExpression> result = new HashSet<>();
result.add(ce);
result.addAll(ce.getFiller().accept(this));
return result;
}
示例10: equals
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!super.equals(obj)) {
return false;
}
return obj instanceof OWLObjectAllValuesFrom;
}
示例11: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
public void visit(OWLObjectAllValuesFrom object) {
visitProperty(object.getProperty());
object.getFiller().accept(this);
}
示例12: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public OWLObjectAllValuesFrom visit(ElkObjectAllValuesFrom expression) {
return owlFactory_.getOWLObjectAllValuesFrom(
convert(expression.getProperty()),
convert(expression.getFiller()));
}
示例13: visit
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@Override
public ElkObjectAllValuesFrom visit(
OWLObjectAllValuesFrom owlObjectAllValuesFrom) {
return CONVERTER.convert(owlObjectAllValuesFrom);
}
示例14: convert
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
@SuppressWarnings("static-method")
public ElkObjectAllValuesFrom convert(
OWLObjectAllValuesFrom owlObjectAllValuesFrom) {
return new ElkObjectAllValuesFromWrap<OWLObjectAllValuesFrom>(
owlObjectAllValuesFrom);
}
示例15: makeUnionUsingReflexiveProperty
import org.semanticweb.owlapi.model.OWLObjectAllValuesFrom; //导入依赖的package包/类
/**
* makes a reduced union expression.
*
* Uses the following two reduction rules:
*
* (r1 some X) U (r2 some Y) ==> lcs(r1,r2) some MakeUnionOf(X,Y)
* (r1 some X) U X ==> reflexive-version-of-r1 some X
*
* TODO: test for (r some r some X) u (r some X) cases. needs to be done over final expression.
*
* if a reduced form cannot be made, returns null
*
* @param xa
* @param xb
* @return class expression
*/
private OWLClassExpression makeUnionUsingReflexiveProperty(OWLClassExpression xa, OWLClassExpression xb) {
LOG.info("testing if there is a more compact union expression for "+xa+" ++ "+xb);
OWLDataFactory df = graph.getDataFactory();
if (xa instanceof OWLQuantifiedRestriction) {
// TODO - check before casting
OWLObjectProperty prop = (OWLObjectProperty) ((OWLQuantifiedRestriction) xa).getProperty();
OWLClassExpression xaRest = (OWLClassExpression) ((OWLQuantifiedRestriction)xa).getFiller();
if (xb instanceof OWLQuantifiedRestriction) {
OWLObjectPropertyExpression p2 =
propertySubsumer(prop,
((OWLQuantifiedObjectRestriction) xb).getProperty());
if (p2 != null) {
OWLClassExpression xbRest = (OWLClassExpression) ((OWLQuantifiedRestriction)xb).getFiller();
OWLClassExpression x = makeUnionWithReduction(xaRest,xbRest);
// todo - mixing some and all
if (xa instanceof OWLObjectSomeValuesFrom)
return df.getOWLObjectSomeValuesFrom(p2,x);
else if (xa instanceof OWLObjectAllValuesFrom)
return df.getOWLObjectAllValuesFrom(p2, x);
}
}
LOG.info(" test: "+xaRest+" == "+xb);
if (xaRest.equals(xb)) {
LOG.info(" TRUE: "+xaRest+" == "+xb);
OWLObjectProperty rprop = null;
if (graph.getIsReflexive(prop)) {
rprop = prop;
}
if (forceReflexivePropertyCreation) {
OWLOntologyManager manager = graph.getManager();
OWLOntology ont = graph.getSourceOntology();
rprop =
df.getOWLObjectProperty(IRI.create(prop.getIRI().toString()+"_reflexive"));
manager.applyChange(new AddAxiom(ont, df.getOWLSubObjectPropertyOfAxiom(prop, rprop)));
manager.applyChange(new AddAxiom(ont, df.getOWLTransitiveObjectPropertyAxiom(rprop)));
LOG.info(" reflexive prop:"+rprop);
}
if (rprop != null) {
if (xa instanceof OWLObjectSomeValuesFrom)
return df.getOWLObjectSomeValuesFrom(rprop,xb);
else if (xa instanceof OWLObjectAllValuesFrom)
return df.getOWLObjectAllValuesFrom(rprop, xb);
}
}
}
return null;
}