Examples of OWLEntityCollector


Examples of org.semanticweb.owlapi.util.OWLEntityCollector


    public Set<OWLEntity> getSignature() {
        if (signature == null) {
            Set<OWLEntity> sig = new HashSet<OWLEntity>();
            OWLEntityCollector collector = new OWLEntityCollector();
            accept(collector);
            sig.addAll(collector.getObjects());
            signature = new HashSet<OWLEntity>(sig);
        }
        return Collections.unmodifiableSet(signature);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

     * referenced in the axiom contained within this change.
     * @return A <code>Set</code> of entities which are referenced
     * by the axiom contained within this change.
     */
    public Set<OWLEntity> getEntities() {
        OWLEntityCollector collector = new OWLEntityCollector();
        axiom.accept(collector);
        return collector.getObjects();
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

            if (expandedWithDefiningAxioms.contains(ax)) {
                // Skip if already done
                continue;
            }
            // Collect the entities that have been used in the axiom
            OWLEntityCollector collector = new OWLEntityCollector();
            ax.accept(collector);
            for (OWLEntity curObj : collector.getObjects()) {
                if (!objectsExpandedWithDefiningAxioms.contains(curObj)) {
                    int added = expandWithDefiningAxioms(curObj, remainingSpace);
                    axiomsAdded += added;
                    remainingSpace = remainingSpace - added;
                    if (remainingSpace == 0) {
                        expansionLimit *= expansionFactor;
                        return axiomsAdded;
                    }
                    // Flag that we have completely expanded all defining axioms
                    // for this particular entity
                    objectsExpandedWithDefiningAxioms.add(curObj);
                }
            }

            // Flag that we've completely expanded this particular axiom
            expandedWithDefiningAxioms.add(ax);
        }

        if (axiomsAdded > 0) {
            return axiomsAdded;
        }

        // No axioms added at this point.  Start adding axioms that reference
        // entities contained in the current set of debugging axioms
        for (OWLAxiom ax : new HashSet<OWLAxiom>(debuggingAxioms)) {
            if (expandedWithReferencingAxioms.contains(ax)) {
                // Skip - already done this one
                continue;
            }
            OWLEntityCollector collector = new OWLEntityCollector();
            ax.accept(collector);
            // Keep track of the number of axioms that have been added
            for (OWLEntity curObj : collector.getObjects()) {
                if (!objectsExpandedWithReferencingAxioms.contains(curObj)) {
                    int added = expandWithReferencingAxioms(curObj, expansionLimit);
                    axiomsAdded += added;
                    remainingSpace -= added;
                    if (remainingSpace == 0) {
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

    private void createMap() {
        for (OWLAxiom ax : axioms) {
            OWLAxiomPartExtractor extractor = new OWLAxiomPartExtractor();
            ax.accept(extractor);
            OWLEntityCollector rhsCollector = new OWLEntityCollector();
            for (OWLObject rhsObject : extractor.getRHS()) {
                rhsObject.accept(rhsCollector);
            }
            for (OWLEntity rhsEntity : rhsCollector.getObjects()) {
                index(rhsEntity, axiomsByRHS, ax);
            }
            OWLEntityCollector lhsCollector = new OWLEntityCollector();
            for (OWLObject lhsObject : extractor.getLHS()) {
                lhsObject.accept(lhsCollector);
            }
            for (OWLEntity lhsEntity : lhsCollector.getObjects()) {
                index(lhsEntity, axiomsByLHS, ax);
            }
        }
        buildChildren(desc);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

        }
    }

    private void buildChildren(OWLClassExpression seed) {
        // Return the axioms that have the entity on the LHS
        OWLEntityCollector collector = new OWLEntityCollector();
        seed.accept(collector);
        Set<OWLAxiom> result = new HashSet<OWLAxiom>();
        for (OWLEntity ent : collector.getObjects()) {
            Set<OWLAxiom> axs = getAxiomsByLHS(ent);
            for (OWLAxiom ax : axs) {
                result.add(ax);
                usedAxioms.add(ax);
            }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

        usedAxioms.add(parentAxiom);
        OWLAxiomPartExtractor extractor = new OWLAxiomPartExtractor();
        parentAxiom.accept(extractor);
        Set<OWLAxiom> result = new HashSet<OWLAxiom>();
        for (OWLObject obj : extractor.getRHS()) {
            OWLEntityCollector collector = new OWLEntityCollector();
            obj.accept(collector);
            for (OWLEntity ent : collector.getObjects()) {
                Set<OWLAxiom> axs = getAxiomsByLHS(ent);
                for (OWLAxiom ax : axs) {
                    if (!usedAxioms.contains(ax)) {
                        result.add(ax);
                        usedAxioms.add(ax);
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

     * @param axiom axiom whose signature is being computed
     * @return the entities referenced in the axiom
     */
  private Set<OWLEntity> getSignature(OWLAxiom axiom) {
    Set<OWLEntity> toReturn = new HashSet<OWLEntity>();
    OWLEntityCollector collector = new OWLEntityCollector(toReturn);
    collector.setCollectDatatypes(false);
    axiom.accept(collector);
    return toReturn;
  }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

    private void createMap() {
        for (OWLAxiom ax : axioms) {
            OWLAxiomPartExtractor extractor = new OWLAxiomPartExtractor();
            ax.accept(extractor);
            Set<OWLEntity> rhscollected=new HashSet<OWLEntity>();
            OWLEntityCollector rhsCollector = new OWLEntityCollector(rhscollected);
            for (OWLObject rhsObject : extractor.getRHS()) {
                rhsObject.accept(rhsCollector);
            }
            for (OWLEntity rhsEntity : rhscollected) {
                index(rhsEntity, axiomsByRHS, ax);
            }
            Set<OWLEntity> lhscollected=new HashSet<OWLEntity>();
            OWLEntityCollector lhsCollector = new OWLEntityCollector(lhscollected);
            for (OWLObject lhsObject : extractor.getLHS()) {
                lhsObject.accept(lhsCollector);
            }
            for (OWLEntity lhsEntity : lhscollected) {
                index(lhsEntity, axiomsByLHS, ax);
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

  public Set<OWLEntity> getSignature() {
    if (signature == null) {
      Set<OWLEntity> sig = new HashSet<OWLEntity>();
      List<OWLAnonymousIndividual> anons = new ArrayList<OWLAnonymousIndividual>();
      OWLEntityCollector collector = new OWLEntityCollector(sig, anons);
      accept(collector);
      signature = sig;
    }
    return CollectionFactory.getCopyOnRequestSet(signature);
  }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector


    private void handleAxiomAdded(OWLAxiom axiom) {
      Set<OWLEntity> sig=new HashSet<OWLEntity>();
      Set<OWLAnonymousIndividual> anons=new HashSet<OWLAnonymousIndividual>();
        OWLEntityCollector entityCollector = new OWLEntityCollector(sig, anons);
        OWLNamedObjectReferenceAdder referenceAdder = getReferenceAdder();
        axiom.accept(entityCollector);
        for (OWLEntity object : sig) {
            referenceAdder.setAxiom(axiom);
            object.accept(referenceAdder);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.