Examples of OWLEntityCollector


Examples of org.semanticweb.owl.util.OWLEntityCollector

        return ontology.getAnnotations(this);
    }


    public Set<OWLEntity> getReferencedEntities() {
        OWLEntityCollector collector = new OWLEntityCollector();
        this.accept(collector);
        return collector.getObjects();
    }
View Full Code Here

Examples of org.semanticweb.owl.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.owl.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.owl.util.OWLEntityCollector

        return getIndexedSet(axiom, entitiesByAxiomRHS, true);
    }


    private void indexAxiomsByRHSEntities(OWLObject rhs, OWLAxiom axiom) {
        OWLEntityCollector collector = new OWLEntityCollector();
        rhs.accept(collector);
        getIndexedSet(axiom, entitiesByAxiomRHS, true).addAll(collector.getObjects());
    }
View Full Code Here

Examples of org.semanticweb.owl.util.OWLEntityCollector

                axioms1 = ont.getAxioms(o1.asOWLDataProperty());
            }
            else if(o1.isOWLIndividual()) {
                axioms1 = ont.getAxioms(o1.asOWLIndividual());
            }
            OWLEntityCollector collector1 = new OWLEntityCollector();
            for (OWLAxiom ax1 : axioms1) {
                ax1.accept(collector1);
            }
            Set<OWLEntity> dependents1 = collector1.getObjects();
            dependents1.remove(o1);

            Set<? extends OWLAxiom> axioms2 = Collections.emptySet();
            if(o1.isOWLClass()) {
                axioms2 = ont.getAxioms(o2.asOWLClass());
            }
            else if(o1.isOWLObjectProperty()) {
                axioms2 = ont.getAxioms(o2.asOWLObjectProperty());
            }
            else if(o1.isOWLDataProperty()) {
                axioms2 = ont.getAxioms(o2.asOWLDataProperty());
            }
            else if(o1.isOWLIndividual()) {
                axioms2 = ont.getAxioms(o2.asOWLIndividual());
            }
            OWLEntityCollector collector2 = new OWLEntityCollector();
            for (OWLAxiom ax2 : axioms2) {
                ax2.accept(collector2);
            }
            Set<OWLEntity> dependents2 = collector2.getObjects();
            dependents2.remove(o2);
            if(dependents1.contains(o2)) {
                if(dependents2.contains(o1)) {
                    // Cyclic dependency!
                    cyclicDependencies.add(CollectionFactory.createSet(o1, o2));
View Full Code Here

Examples of org.semanticweb.owl.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.owl.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.owl.util.OWLEntityCollector

        }
    }

    private void buildChildren(OWLDescription 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.owl.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.owl.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
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.