use of org.semanticweb.owlapi.model.OWLPropertyExpression in project graal by graphik-team.
the class OWLAxiomParser method visit.
// /////////////////////////////////////////////////////////////////////////
// PropertyChain
// /////////////////////////////////////////////////////////////////////////
@Override
public Iterable<? extends Object> visit(OWLSubPropertyChainOfAxiom arg) {
freeVarGen.setIndex(0);
InMemoryAtomSet body = GraalUtils.createAtomSet();
Term varX, varY, firstVarInChain;
firstVarInChain = varX = freeVarGen.getFreshSymbol();
for (OWLPropertyExpression pe : arg.getPropertyChain()) {
varY = freeVarGen.getFreshSymbol();
body.addAll(pe.accept(new OWLPropertyExpressionVisitorImpl(varX, varY)));
varX = varY;
}
InMemoryAtomSet head = arg.getSuperProperty().accept(new OWLPropertyExpressionVisitorImpl(firstVarInChain, varX));
return Collections.singleton(DefaultRuleFactory.instance().create(body, head));
}
use of org.semanticweb.owlapi.model.OWLPropertyExpression in project graal by graphik-team.
the class OWLAxiomParser method disjointPropertiesAxiom.
private Iterable<? extends Object> disjointPropertiesAxiom(Iterable<? extends OWLPropertyExpression> properties) {
Collection<Rule> rules = GraalUtils.<Rule>createCollection();
InMemoryAtomSet a, a1, a2;
Iterator<? extends OWLPropertyExpression> it1, it2;
it1 = properties.iterator();
while (it1.hasNext()) {
OWLPropertyExpression propExpr = (OWLPropertyExpression) it1.next();
a1 = propExpr.accept(propertyVisitorXY);
it1.remove();
it2 = properties.iterator();
while (it2.hasNext()) {
OWLPropertyExpression next = (OWLPropertyExpression) it2.next();
a2 = next.accept(propertyVisitorXY);
a = GraalUtils.createAtomSet();
a.addAll(a1);
a.addAll(a2);
rules.add(new DefaultNegativeConstraint(a));
}
}
return rules;
}
use of org.semanticweb.owlapi.model.OWLPropertyExpression in project graal by graphik-team.
the class OWLAxiomParser method equivalentPropertiesAxiom.
private Iterable<? extends Object> equivalentPropertiesAxiom(Iterable<? extends OWLPropertyExpression> properties) {
Collection<Rule> rules = GraalUtils.<Rule>createCollection();
InMemoryAtomSet a1, a2;
Iterator<? extends OWLPropertyExpression> it1, it2;
it1 = properties.iterator();
while (it1.hasNext()) {
OWLPropertyExpression propExpr = (OWLPropertyExpression) it1.next();
a1 = propExpr.accept(propertyVisitorXY);
it1.remove();
it2 = properties.iterator();
while (it2.hasNext()) {
OWLPropertyExpression next = (OWLPropertyExpression) it2.next();
a2 = next.accept(propertyVisitorXY);
rules.add(DefaultRuleFactory.instance().create(a1, a2));
rules.add(DefaultRuleFactory.instance().create(a2, a1));
}
}
return rules;
}
Aggregations