Package org.semanticweb.owlapi.util

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


        }
    }

    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

        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

     * @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

    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

  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


    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


    private void handleAxiomRemoved(OWLAxiom axiom) {
      Set<OWLEntity> sig=new HashSet<OWLEntity>();
      Set<OWLAnonymousIndividual> anons=new HashSet<OWLAnonymousIndividual>();
        OWLEntityCollector entityCollector = new OWLEntityCollector(sig, anons);
            OWLNamedObjectReferenceRemover referenceRemover = getReferenceRemover();
        axiom.accept(entityCollector);
        for (OWLEntity object : sig) {
            referenceRemover.setAxiom(axiom);
            object.accept(referenceRemover);
View Full Code Here

  /**
   * Given a set of OWL-API axiom, return its signature.
   */
  public static Set<OWLEntity> getSignature(OWLAxiom axiom) {
    Set<OWLEntity> entities = new HashSet<OWLEntity>();
    OWLEntityCollector collector = new OWLEntityCollector(entities);
    collector.setCollectDatatypes( false );
    axiom.accept(collector);

    return entities;
  }
View Full Code Here

  /**
   * Given a set of OWL-API axiom, return its signature.
   */
  public static Set<OWLEntity> getSignature(OWLAxiom axiom) {
    Set<OWLEntity> entities = new HashSet<OWLEntity>();
    OWLEntityCollector collector = new OWLEntityCollector(entities);
    collector.setCollectDatatypes( false );
    axiom.accept(collector);

    return entities;
  }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.util.OWLEntityCollector

Copyright © 2018 www.massapicom. 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.