/** * Return the TBox */ @Override public TBox getTBox() { return _kb.getTBox(); }
/** * Return the TBox */ @Override public TBox getTBox() { return _kb.getTBox(); }
private static Bool checkBinaryClash(final KnowledgeBase kb, final ATermAppl c, @SuppressWarnings("unused") final CachedNode root, final CachedNode otherRoot) { final Iterator<Unfolding> unfoldingList = kb.getTBox().unfold(c); while (unfoldingList.hasNext()) { final Unfolding unfolding = unfoldingList.next(); final ATermAppl unfoldingCondition = unfolding.getCondition(); if (!unfoldingCondition.equals(TOP) && otherRoot.getDepends().containsKey(unfoldingCondition)) return Bool.UNKNOWN; } return null; }
private static Bool checkBinaryClash(final KnowledgeBase kb, final ATermAppl c, @SuppressWarnings("unused") final CachedNode root, final CachedNode otherRoot) { final Iterator<Unfolding> unfoldingList = kb.getTBox().unfold(c); while (unfoldingList.hasNext()) { final Unfolding unfolding = unfoldingList.next(); final ATermAppl unfoldingCondition = unfolding.getCondition(); if (!unfoldingCondition.equals(TOP) && otherRoot.getDepends().containsKey(unfoldingCondition)) return Bool.UNKNOWN; } return null; }
@Override public Taxonomy<ATermAppl> getToldTaxonomy() { return new TaxonomyImpl<>(_kb.getTBox().getClasses(), TermFactory.TOP, TermFactory.BOTTOM); } }
@Override public Taxonomy<ATermAppl> getToldTaxonomy() { return new TaxonomyImpl<>(_kb.getTBox().getClasses(), TermFactory.TOP, TermFactory.BOTTOM); } }
private void processClasses() { final TBox tbox = _KB.getTBox(); for (final ATermAppl c : _KB.getAllClasses()) { final Iterator<Unfolding> unfoldC = tbox.unfold(c); while (unfoldC.hasNext()) { final Unfolding unf = unfoldC.next(); _visitor.visit(unf.getResult()); } } }
private void processClasses() { final TBox tbox = _KB.getTBox(); for (final ATermAppl c : _KB.getAllClasses()) { final Iterator<Unfolding> unfoldC = tbox.unfold(c); while (unfoldC.hasNext()) { final Unfolding unf = unfoldC.next(); _visitor.visit(unf.getResult()); } } }
@Override public void visit(final ClassAtom atom) { final ATermAppl c = atom.getPredicate(); result = _abox.getKB().getTBox().isPrimitive(c); }
@Override public void visit(final ClassAtom atom) { final ATermAppl c = atom.getPredicate(); result = _abox.getKB().getTBox().isPrimitive(c); }
protected void reset() { _kb.prepare(); _classes = new ArrayList<>(_kb.getClasses()); _useCD = OpenlletOptions.USE_CD_CLASSIFICATION && !_kb.getTBox().unfold(ATermUtils.TOP).hasNext() && !_kb.getExpressivity().hasNominal(); init(); }
protected void reset() { _kb.prepare(); _classes = new ArrayList<>(_kb.getClasses()); _useCD = OpenlletOptions.USE_CD_CLASSIFICATION && !_kb.getTBox().unfold(ATermUtils.TOP).hasNext() && !_kb.getExpressivity().hasNominal(); init(); }
protected void processDefinitions() { final boolean hasInverses = _kb.getExpressivity().hasInverse(); final TBox tbox = _kb.getTBox(); for (final ATermAppl c : _kb.getClasses()) { final Iterator<Unfolding> unfoldingList = tbox.unfold(c); while (unfoldingList.hasNext()) { final Unfolding unf = unfoldingList.next(); final Set<ATermAppl> usedByC = ATermUtils.findPrimitives(unf.getResult(), !hasInverses, true); for (final ATermAppl used : usedByC) { if (!_kb.getClasses().contains(used)) continue; addUses(c, used); } } } }
@Override @Before public void initializeKB() { super.initializeKB(); tbox = _kb.getTBox(); }
protected void processDefinitions() { final boolean hasInverses = _kb.getExpressivity().hasInverse(); final TBox tbox = _kb.getTBox(); for (final ATermAppl c : _kb.getClasses()) { final Iterator<Unfolding> unfoldingList = tbox.unfold(c); while (unfoldingList.hasNext()) { final Unfolding unf = unfoldingList.next(); final Set<ATermAppl> usedByC = ATermUtils.findPrimitives(unf.getResult(), !hasInverses, true); for (final ATermAppl used : usedByC) { if (!_kb.getClasses().contains(used)) continue; addUses(c, used); } } } }
final TBox tbox = _kb.getTBox(); tbox.axioms().forEach(axiom ->
private void processAxioms() { //EquivalentClass -> SubClasses //Disjoint Classes -> SubClass //Normalize ATerm lists to sets final Collection<ATermAppl> assertedAxioms = _kb.getTBox().getAssertedAxioms(); for (final ATermAppl assertedAxiom : assertedAxioms) processAxiom(assertedAxiom); if (PREPROCESS_DOMAINS) //Convert ATermAppl Domains to axioms for (final Entry<ATermAppl, ATermAppl> entry : _roleRestrictions.getDomains().entrySet()) { final ATermAppl roleName = entry.getKey(); final ATermAppl domain = entry.getValue(); createConceptsFromAxiom(ATermUtils.makeSomeValues(roleName, ATermUtils.TOP), domain); } //Convert Reflexive Roles to axioms for (final Role role : _kb.getRBox().getRoles().values()) if (role.isReflexive()) { final ATermAppl range = _roleRestrictions.getRange(role.getName()); if (range == null) continue; createConceptsFromAxiom(ATermUtils.TOP, range); } }
private void processAxioms() { //EquivalentClass -> SubClasses //Disjoint Classes -> SubClass //Normalize ATerm lists to sets final Collection<ATermAppl> assertedAxioms = _kb.getTBox().getAssertedAxioms(); for (final ATermAppl assertedAxiom : assertedAxioms) processAxiom(assertedAxiom); if (PREPROCESS_DOMAINS) //Convert ATermAppl Domains to axioms for (final Entry<ATermAppl, ATermAppl> entry : _roleRestrictions.getDomains().entrySet()) { final ATermAppl roleName = entry.getKey(); final ATermAppl domain = entry.getValue(); createConceptsFromAxiom(ATermUtils.makeSomeValues(roleName, ATermUtils.TOP), domain); } //Convert Reflexive Roles to axioms for (final Role role : _kb.getRBox().getRoles().values()) if (role.isReflexive()) { final ATermAppl range = _roleRestrictions.getRange(role.getName()); if (range == null) continue; createConceptsFromAxiom(ATermUtils.TOP, range); } }
private Bool isType(final CachedNode pNode, final ATermAppl c) { Bool isType = Bool.UNKNOWN; final boolean isPrimitive = _kb.getTBox().isPrimitive(c); if (isPrimitive && !pNode.isTop() && !pNode.isBottom() && pNode.isComplete()) { final DependencySet ds = pNode.getDepends().get(c); if (ds == null) return Bool.FALSE; else if (ds.isIndependent() && pNode.isIndependent()) return Bool.TRUE; } final ATermAppl notC = ATermUtils.negate(c); final CachedNode cached = getCached(notC); if (cached != null && cached.isComplete()) isType = _cache.isMergable(_kb, pNode, cached).not(); if (OpenlletOptions.CHECK_NOMINAL_EDGES && isType.isUnknown()) { final CachedNode cNode = getCached(c); if (cNode != null) isType = _cache.checkNominalEdges(_kb, pNode, cNode); } return isType; }
private Bool isType(final CachedNode pNode, final ATermAppl c) { Bool isType = Bool.UNKNOWN; final boolean isPrimitive = _kb.getTBox().isPrimitive(c); if (isPrimitive && !pNode.isTop() && !pNode.isBottom() && pNode.isComplete()) { final DependencySet ds = pNode.getDepends().get(c); if (ds == null) return Bool.FALSE; else if (ds.isIndependent() && pNode.isIndependent()) return Bool.TRUE; } final ATermAppl notC = ATermUtils.negate(c); final CachedNode cached = getCached(notC); if (cached != null && cached.isComplete()) isType = _cache.isMergable(_kb, pNode, cached).not(); if (OpenlletOptions.CHECK_NOMINAL_EDGES && isType.isUnknown()) { final CachedNode cNode = getCached(c); if (cNode != null) isType = _cache.checkNominalEdges(_kb, pNode, cNode); } return isType; }