use of fr.lirmm.graphik.graal.api.core.InMemoryAtomSet in project graal by graphik-team.
the class OWLAxiomParser method visit.
@Override
public Iterable<? extends Object> visit(OWLNegativeDataPropertyAssertionAxiom arg) {
freeVarGen.setIndex(0);
Term a = GraalUtils.createTerm(arg.getSubject());
Term b = GraalUtils.createLiteral(arg.getObject());
InMemoryAtomSet atomset = arg.getProperty().accept(new OWLPropertyExpressionVisitorImpl(a, b));
return Collections.singleton(new DefaultNegativeConstraint(atomset));
}
use of fr.lirmm.graphik.graal.api.core.InMemoryAtomSet in project graal by graphik-team.
the class OWLEquivalentClassExpressionVisitorImpl method objectMinCardinality0.
@Override
public InMemoryAtomSet objectMinCardinality0(OWLObjectMinCardinality arg) {
InMemoryAtomSet atomset = GraalUtils.createAtomSet();
atomset.add(new DefaultAtom(Predicate.TOP, glueVariable));
return atomset;
}
use of fr.lirmm.graphik.graal.api.core.InMemoryAtomSet in project graal by graphik-team.
the class OWLEquivalentClassExpressionVisitorImpl method dataMinCardinality1.
@Override
public InMemoryAtomSet dataMinCardinality1(OWLDataMinCardinality arg) {
Variable newGlueVariable = varGen.getFreshSymbol();
InMemoryAtomSet atomset = arg.getProperty().accept(new OWLPropertyExpressionVisitorImpl(glueVariable, newGlueVariable));
atomset.addAll(arg.getFiller().accept(new OWLEquivalentDataRangeVisitorImpl(newGlueVariable)));
return atomset;
}
use of fr.lirmm.graphik.graal.api.core.InMemoryAtomSet in project graal by graphik-team.
the class OWLEquivalentClassExpressionVisitorImpl method visit.
@Override
public InMemoryAtomSet visit(OWLObjectSomeValuesFrom arg) {
Term newGlueVariable = varGen.getFreshSymbol();
InMemoryAtomSet atomset = arg.getProperty().accept(new OWLPropertyExpressionVisitorImpl(glueVariable, newGlueVariable));
if (!arg.getFiller().equals(DF.getOWLThing())) {
atomset.addAll(arg.getFiller().accept(new OWLEquivalentClassExpressionVisitorImpl(this.prefixManager, varGen, newGlueVariable)));
}
return atomset;
}
use of fr.lirmm.graphik.graal.api.core.InMemoryAtomSet in project graal by graphik-team.
the class Utils method isMoreGeneralThan.
/**
* Returns true if AtomSet h is more general than AtomSet f, and mark all
* the atom of h if h is a marked fact; else return false
*
* @param h
* @param f
* @param compilation
* @return true if AtomSet h is more general than AtomSet f, and mark all
* the atom of h if h is a marked fact, false otherwise.
*/
public static boolean isMoreGeneralThan(InMemoryAtomSet h, InMemoryAtomSet f, RulesCompilation compilation) {
boolean moreGen = false;
if (testInclu && AtomSetUtils.contains(f, h)) {
moreGen = true;
} else {
try {
InMemoryAtomSet fCopy = Utils.getSafeCopy(f);
moreGen = PureHomomorphism.instance().exist(h, fCopy, compilation);
} catch (HomomorphismException e) {
}
}
return moreGen;
}
Aggregations