public static ATermAppl some(final ATermAppl r, final ATermAppl c) { return ATermUtils.makeSomeValues(r, c); }
public static ATermAppl some(final ATermAppl r, final ATermAppl c) { return ATermUtils.makeSomeValues(r, c); }
@Override protected boolean isSubsumedBy(final ATermAppl a, final ATermAppl b) { final ATermAppl someB = ATermUtils.makeSomeValues(_p, b); return _kb.isSubClassOf(a, someB); } }
@Override protected boolean isSubsumedBy(final ATermAppl a, final ATermAppl b) { final ATermAppl someB = ATermUtils.makeSomeValues(_p, b); return _kb.isSubClassOf(a, someB); } }
/** * {@inheritDoc} */ @Override protected void addRoleRangeRule(final ATermAppl p, final ATermAppl range) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); final ATermAppl someOfRange = ATermUtils.makeSomeValues(p, range); translateSuper(head, someOfRange, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleRangeRule(final ATermAppl p, final ATermAppl range) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); final ATermAppl someOfRange = ATermUtils.makeSomeValues(p, range); translateSuper(head, someOfRange, freeVar, var0); _rules.add(new Rule(head, body)); }
/** * {@inheritDoc} */ @Override protected void addRoleRangeRule(final ATermAppl p, final ATermAppl range) { final List<ClauseEntry> body = new ArrayList<>(); final List<ClauseEntry> head = new ArrayList<>(); final FreeVariableStore freeVar = new FreeVariableStore(); final Node var0 = freeVar.next(); final Node var1 = freeVar.next(); body.add(makeSubOfSomeTriple(var0, p, var1)); final ATermAppl someOfRange = ATermUtils.makeSomeValues(p, range); translateSuper(head, someOfRange, freeVar, var0); _rules.add(new Rule(head, body)); }
@Override public void visit(final OWLDataSomeValuesFrom restriction) { restriction.getProperty().accept(this); final ATerm p = _term; restriction.getFiller().accept(this); final ATerm c = _term; _term = ATermUtils.makeSomeValues(p, c); }
@Override public NodeSet<OWLClass> getObjectPropertyDomains(final OWLObjectPropertyExpression pe, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final ATermAppl some = ATermUtils.makeSomeValues(term(pe), ATermUtils.TOP); final Set<ATermAppl> equivalents = _kb.getEquivalentClasses(some); if (direct && !equivalents.isEmpty()) return toClassNodeSet(Collections.singleton(equivalents)); final Set<Set<ATermAppl>> result = _kb.getSuperClasses(some, direct); if (!equivalents.isEmpty()) result.add(equivalents); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
@Override public NodeSet<OWLClass> getDataPropertyDomains(final OWLDataProperty pe, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final ATermAppl some = ATermUtils.makeSomeValues(term(pe), ATermUtils.TOP_LIT); final Set<ATermAppl> equivalents = _kb.getEquivalentClasses(some); if (direct && !equivalents.isEmpty()) return toClassNodeSet(Collections.singleton(equivalents)); final Set<Set<ATermAppl>> result = _kb.getSuperClasses(some, direct); if (!equivalents.isEmpty()) result.add(equivalents); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
@Override public void visit(final OWLObjectSomeValuesFrom restriction) { restriction.getProperty().accept(this); final ATerm p = _term; restriction.getFiller().accept(this); final ATerm c = _term; _term = ATermUtils.makeSomeValues(p, c); }
@Override public void visit(final OWLDataSomeValuesFrom restriction) { restriction.getProperty().accept(this); final ATerm p = _term; restriction.getFiller().accept(this); final ATerm c = _term; _term = ATermUtils.makeSomeValues(p, c); }
@Override public void visit(final OWLObjectSomeValuesFrom restriction) { restriction.getProperty().accept(this); final ATerm p = _term; restriction.getFiller().accept(this); final ATerm c = _term; _term = ATermUtils.makeSomeValues(p, c); }
@Override public NodeSet<OWLClass> getObjectPropertyDomains(final OWLObjectPropertyExpression pe, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final ATermAppl some = ATermUtils.makeSomeValues(term(pe), ATermUtils.TOP); final Set<ATermAppl> equivalents = _kb.getEquivalentClasses(some); if (direct && !equivalents.isEmpty()) return toClassNodeSet(Collections.singleton(equivalents)); final Set<Set<ATermAppl>> result = _kb.getSuperClasses(some, direct); if (!equivalents.isEmpty()) result.add(equivalents); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
@Override public void visit(final OWLDataSomeValuesFrom restriction) { restriction.getProperty().accept(this); final ATerm p = _term; restriction.getFiller().accept(this); final ATerm c = _term; _term = ATermUtils.makeSomeValues(p, c); }
@Override public void visit(final OWLObjectSomeValuesFrom restriction) { restriction.getProperty().accept(this); final ATerm p = _term; restriction.getFiller().accept(this); final ATerm c = _term; _term = ATermUtils.makeSomeValues(p, c); }
@Override public NodeSet<OWLClass> getObjectPropertyRanges(final OWLObjectPropertyExpression pe, final boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException { refreshCheck(); try { final ATermAppl some = ATermUtils.makeSomeValues(ATermUtils.makeInv(term(pe)), ATermUtils.TOP); final Set<ATermAppl> equivalents = _kb.getEquivalentClasses(some); if (direct && !equivalents.isEmpty()) return toClassNodeSet(Collections.singleton(equivalents)); final Set<Set<ATermAppl>> result = _kb.getSuperClasses(some, direct); if (!equivalents.isEmpty()) result.add(equivalents); return toClassNodeSet(result); } catch (final PelletRuntimeException e) { throw convert(e); } }
default boolean hasDomain(final ATermAppl p, final ATermAppl c) { if (null == p || null == c) return false; final Role r = getRBox().getRole(p); if (r == null) { Base.handleUndefinedEntity(p + _isNotAnProperty); return false; } if (!isClass(c)) { Base.handleUndefinedEntity(c + _isNotAValidClassExpression); return false; } final ATermAppl someP = ATermUtils.makeSomeValues(p, ATermUtils.getTop(r)); return isSubClassOf(someP, c); }
default boolean hasDomain(final ATermAppl p, final ATermAppl c) { if (null == p || null == c) return false; final Role r = getRBox().getRole(p); if (r == null) { Base.handleUndefinedEntity(p + _isNotAnProperty); return false; } if (!isClass(c)) { Base.handleUndefinedEntity(c + _isNotAValidClassExpression); return false; } final ATermAppl someP = ATermUtils.makeSomeValues(p, ATermUtils.getTop(r)); return isSubClassOf(someP, c); }
@Test public void testIsClass1() { final KnowledgeBase kb = new KnowledgeBaseImpl(); final ATermAppl p = term("p"); final ATermAppl l = ATermUtils.makeTermAppl("l"); final ATermAppl v = ATermUtils.makeValue(ATermUtils.makeLiteral(l)); final ATermAppl c = ATermUtils.makeSomeValues(p, v); kb.addProperty(p); assertTrue(kb.isClass(c)); }