Examples of OWLEntityCollector


Examples of org.semanticweb.owl.util.OWLEntityCollector

     * @return <code>true</code> if the description references entities that
     *         the ontology that contains entailments which are being explained,
     *         otherwise <code>false</code>
     */
    public static boolean containsUnreferencedEntity(OWLOntology ontology, OWLDescription desc) {
        OWLEntityCollector entityCollector = new OWLEntityCollector();
        desc.accept(entityCollector);
        for (OWLEntity entity : entityCollector.getObjects()) {
            if (!ontology.containsEntityReference(entity)) {
                if (entity instanceof OWLClass && (((OWLClass) entity).isOWLThing() || ((OWLClass) entity).isOWLNothing())) {
                    continue;
                }
                return true;
View Full Code Here

Examples of org.semanticweb.owl.util.OWLEntityCollector

  private static OWLEntityCollector collector; 
 
    public HSTExplanationGenerator(TransactionAwareSingleExpGen singleExplanationGenerator) {
        this.singleExplanationGenerator = singleExplanationGenerator;
       
        collector  = new OWLEntityCollector();
        collector.setCollectDataTypes( false );
    }
View Full Code Here

Examples of org.semanticweb.owl.util.OWLEntityCollector

   * @return <code>true</code> if the description references entities that
   *         the ontology that contains entailments which are being explained,
   *         otherwise <code>false</code>
   */
  public static boolean containsUnreferencedEntity(OWLOntology ontology, OWLDescription desc) {
    OWLEntityCollector entityCollector = new OWLEntityCollector();
    desc.accept( entityCollector );
    for( OWLEntity entity : entityCollector.getObjects() ) {
      if( !ontology.containsEntityReference( entity ) ) {
        if( entity instanceof OWLClass
            && (((OWLClass) entity).isOWLThing() || ((OWLClass) entity).isOWLNothing()) ) {
          continue;
        }
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<>();
            OWLEntityCollector rhsCollector = new OWLEntityCollector(
                    rhscollected);
            for (OWLObject rhsObject : extractor.getRHS()) {
                rhsObject.accept(rhsCollector);
            }
            for (OWLEntity rhsEntity : rhscollected) {
                axiomsByRHS.put(rhsEntity, ax);
            }
            Set<OWLEntity> lhscollected = new HashSet<>();
            OWLEntityCollector lhsCollector = new OWLEntityCollector(
                    lhscollected);
            for (OWLObject lhsObject : extractor.getLHS()) {
                lhsObject.accept(lhsCollector);
            }
            for (OWLEntity lhsEntity : lhscollected) {
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

     * @return the entities referenced in the axiom
     */
    @Nonnull
    private static Set<OWLEntity> getSignature(@Nonnull OWLAxiom axiom) {
        Set<OWLEntity> toReturn = new HashSet<>();
        OWLEntityCollector collector = new OWLEntityCollector(toReturn);
        axiom.accept(collector);
        return toReturn;
    }
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 static OWLEntityCollector collector;

    public HSTExplanationGenerator(TransactionAwareSingleExpGen singleExplanationGenerator) {
        this.singleExplanationGenerator = singleExplanationGenerator;
        collector = new OWLEntityCollector();
        collector.setCollectDatatypes(false);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.util.OWLEntityCollector

        return annotations.equals(other.getAnnotations());
    }


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

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

     * @return <code>true</code> if the description references entities that
     *         the ontology that contains entailments which are being explained,
     *         otherwise <code>false</code>
     */
    public static boolean containsUnreferencedEntity(OWLOntology ontology, OWLClassExpression desc) {
        OWLEntityCollector entityCollector = new OWLEntityCollector();
        desc.accept(entityCollector);
        for (OWLEntity entity : entityCollector.getObjects()) {
            if (!ontology.containsEntityInSignature(entity)) {
                if (entity instanceof OWLClass && (((OWLClass) entity).isOWLThing() || ((OWLClass) entity).isOWLNothing())) {
                    continue;
                }
                return true;
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.