/** * Clear the visitor cache about simple properties. Should be called before * a reload. */ public void clear() { unsupportedAxioms = new HashSet<OWLAxiom>(); compositePropertyAxioms = new MultiValueMap<OWLObjectProperty, OWLObjectPropertyAxiom>(); simpleProperties = new HashSet<OWLObjectProperty>(); }
/** * Clear the visitor cache about simple properties. Should be called before * a reload. */ public void clear() { unsupportedAxioms = new HashSet<OWLAxiom>(); compositePropertyAxioms = new MultiValueMap<OWLObjectProperty, OWLObjectPropertyAxiom>(); simpleProperties = new HashSet<OWLObjectProperty>(); }
public ConceptInfo(ATermAppl c, boolean storeSuccessors, boolean noTriggers) { concept = c; superClasses = CollectionUtils.makeSet(); successors = storeSuccessors ? new MultiValueMap<ATermAppl, ConceptInfo>() : null; predecessors = new MultiValueMap<ATermAppl, ConceptInfo>(); triggers = noTriggers ? null : new HashSet<Trigger>(); }
public ConceptInfo(ATermAppl c, boolean storeSuccessors, boolean noTriggers) { concept = c; superClasses = CollectionUtils.makeSet(); successors = storeSuccessors ? new MultiValueMap<ATermAppl, ConceptInfo>() : null; predecessors = new MultiValueMap<ATermAppl, ConceptInfo>(); triggers = noTriggers ? null : new HashSet<Trigger>(); }
private boolean add(ATermAppl r1, ATermAppl r2, ATermAppl superRole) { MultiValueMap<ATermAppl, ATermAppl> innerMap = m_BinaryRoleInclusions.get(r1); if (innerMap == null) { innerMap = new MultiValueMap<ATermAppl, ATermAppl>(); m_BinaryRoleInclusions.put(r1, innerMap); } return innerMap.add(r2, superRole); }
private boolean add(ATermAppl r1, ATermAppl r2, ATermAppl superRole) { MultiValueMap<ATermAppl, ATermAppl> innerMap = m_BinaryRoleInclusions.get(r1); if (innerMap == null) { innerMap = new MultiValueMap<ATermAppl, ATermAppl>(); m_BinaryRoleInclusions.put(r1, innerMap); } return innerMap.add(r2, superRole); }
/** * Reads information about the modules from the input stream that has the information stored in a form of ontology. * * @param inputStream the input stream from which the ontology should be read * @return the read information about the modules * @throws IOException if an error occurs during the read process. */ public static MultiValueMap<OWLEntity, OWLEntity> loadModules( InputStream is ) throws IOException { MultiValueMap<OWLEntity, OWLEntity> modules = new MultiValueMap<OWLEntity,OWLEntity>(); LineNumberReader lnr = new LineNumberReader( new InputStreamReader( is ) ); while ( readModule( lnr, modules ) ) { // nothing to do } return modules; } }
public void resetModules() { // cache the axiom signatures processAdditions(); additions.clear(); // no need to consider deletions for initial module extraction deletions.clear(); changes.clear(); nonLocalAxioms = false; modules = new MultiValueMap<OWLEntity, OWLEntity>(); }
/** * {@inheritDoc} */ protected MultiValueMap<ATermAppl, ATermAppl> getSubsumers(Set<Fact> facts) { MultiValueMap<ATermAppl, ATermAppl> subsumers = new MultiValueMap<ATermAppl, ATermAppl>(); for (Fact f : facts) { if (f.getElements().get(0).equals(PRED_SUB)) { List<ATermAppl> tuple = f.getElements(); ATermAppl c1 = tuple.get(1); ATermAppl c2 = tuple.get(2); if (ConstantStore.isAnon(c1) || ConstantStore.isAnon(c2)) continue; subsumers.add(c1, c2); } } return subsumers; }
/** * */ public KnowledgeBase() { clear(); timers.createTimer( "preprocessing" ); timers.createTimer( "consistency" ); timers.createTimer( "complete" ); state = EnumSet.noneOf( ReasoningState.class ); if( PelletOptions.USE_INCREMENTAL_DELETION ) { deletedAssertions = new HashSet<ATermAppl>(); dependencyIndex = new DependencyIndex( this ); syntacticAssertions = new HashSet<ATermAppl>(); } aboxAssertions = new MultiValueMap<AssertionType, ATermAppl>(); annotations = new HashMap<ATermAppl, Map<ATermAppl, Set<ATermAppl>>>(); }
@Override protected void reset() { super.reset(); hasComplexRoles = kb.getExpressivity().hasTransitivity() || kb.getExpressivity().hasComplexSubRoles(); primaryQueue = new LinkedList<QueueElement>(); concepts = CollectionUtils.makeMap(); existentials = new MultiValueMap<ATermAppl, ConceptInfo>(); conjunctions = new MultiValueMap<ConceptInfo, ConceptInfo>(); roleChains = new RoleChainCache(kb); roleRestrictions = new RoleRestrictionCache( kb.getRBox() ); }
@Override protected void reset() { super.reset(); hasComplexRoles = kb.getExpressivity().hasTransitivity() || kb.getExpressivity().hasComplexSubRoles(); primaryQueue = new LinkedList<QueueElement>(); concepts = CollectionUtils.makeMap(); existentials = new MultiValueMap<ATermAppl, ConceptInfo>(); conjunctions = new MultiValueMap<ConceptInfo, ConceptInfo>(); roleChains = new RoleChainCache(kb); roleRestrictions = new RoleRestrictionCache( kb.getRBox() ); }
private void processQueue() { int startingSize = queue.size(); while( !queue.isEmpty() ) { int processed = startingSize - queue.size(); if( monitor.getProgress() < processed ) monitor.setProgress( processed ); MultiValueMap<ConceptInfo, Trigger> localQueue = queue; queue = new MultiValueMap<ConceptInfo, Trigger>(); for (Entry<ConceptInfo, Set<Trigger>> entry : localQueue.entrySet()) { ConceptInfo ci = entry.getKey(); for (Trigger trigger : entry.getValue()) { processTrigger(ci, trigger); } } } }
private void processQueue() { int startingSize = queue.size(); while( !queue.isEmpty() ) { int processed = startingSize - queue.size(); if( monitor.getProgress() < processed ) monitor.setProgress( processed ); MultiValueMap<ConceptInfo, Trigger> localQueue = queue; queue = new MultiValueMap<ConceptInfo, Trigger>(); for (Entry<ConceptInfo, Set<Trigger>> entry : localQueue.entrySet()) { ConceptInfo ci = entry.getKey(); for (Trigger trigger : entry.getValue()) { processTrigger(ci, trigger); } } } }
private MultiValueMap<ATermAppl, Role> collectNeighbors(CachedNode ind) { MultiValueMap<ATermAppl, Role> neighbors = new MultiValueMap<ATermAppl, Role>(); for( Edge edge : ind.getInEdges() ) { Role role = edge.getRole(); ATermAppl neighbor = edge.getFromName(); if( !ATermUtils.isBnode( neighbor ) ) neighbors.put( neighbor, Collections.singleton(role) ); } for( Edge edge : ind.getOutEdges() ) { Role role = edge.getRole(); ATermAppl neighbor = edge.getToName(); if( role.isObjectRole() && !ATermUtils.isBnode( neighbor ) ) neighbors.put( neighbor, Collections.singleton(role.getInverse()) ); } return neighbors; }
protected void reset() { super.reset(); hasComplexRoles = kb.getExpressivity().hasTransitivity() || kb.getExpressivity().hasComplexSubRoles(); queue = new MultiValueMap<ConceptInfo, Trigger>(); concepts = CollectionUtils.makeMap(); roleChains = new RoleChainCache(kb); roleRestrictions = new RoleRestrictionCache( kb.getRBox() ); }
protected void reset() { super.reset(); hasComplexRoles = kb.getExpressivity().hasTransitivity() || kb.getExpressivity().hasComplexSubRoles(); queue = new MultiValueMap<ConceptInfo, Trigger>(); concepts = CollectionUtils.makeMap(); roleChains = new RoleChainCache(kb); roleRestrictions = new RoleRestrictionCache( kb.getRBox() ); }
protected MultiValueMap<ATermAppl, ATermAppl> getSubsumptions(Graph graph) { MultiValueMap<ATermAppl, ATermAppl> subsumers = new MultiValueMap<ATermAppl, ATermAppl>(); ExtendedIterator it = graph.find(Node.ANY, PRED_SUB, Node.ANY); while (it.hasNext()) { Triple tri = (Triple) it.next(); Node sub = tri.getSubject(); Node sup = tri.getObject(); if (NameStore.isAnon(sub) || NameStore.isAnon(sup)) continue; subsumers.add(toATermAppl(sub), toATermAppl(sup)); } it.close(); return subsumers; }
protected MultiValueMap<ATermAppl, ATermAppl> getSubsumptions(Graph graph) { MultiValueMap<ATermAppl, ATermAppl> subsumers = new MultiValueMap<ATermAppl, ATermAppl>(); ExtendedIterator it = graph.find(Node.ANY, PRED_SUB, Node.ANY); while (it.hasNext()) { Triple tri = (Triple) it.next(); Node sub = tri.getSubject(); Node sup = tri.getObject(); if (NameStore.isAnon(sub) || NameStore.isAnon(sup)) continue; subsumers.add(toATermAppl(sub), toATermAppl(sup)); } it.close(); return subsumers; }
private MultiValueMap<ATermAppl, Role> collectNeighbors(CachedNode ind) { MultiValueMap<ATermAppl, Role> neighbors = new MultiValueMap<ATermAppl, Role>(); for( Edge edge : ind.getInEdges() ) { Role role = edge.getRole(); ATermAppl neighbor = edge.getFromName(); if( !ATermUtils.isBnode( neighbor ) ) neighbors.putSingle( neighbor, role ); } for( Edge edge : ind.getOutEdges() ) { Role role = edge.getRole(); ATermAppl neighbor = edge.getToName(); if( role.isObjectRole() && !ATermUtils.isBnode( neighbor ) ) neighbors.putSingle( neighbor, role.getInverse() ); } return neighbors; }