Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLDescription


        return !isSubjectOrObjectAnonymous(subject, object);
    }


    public void handleTriple(URI subject, URI predicate, URI object) throws OWLException {
        OWLDescription subClass = translateDescription(subject);
        OWLDescription supClass = translateDescription(object);
        OWLAxiom ax = getDataFactory().getOWLSubClassAxiom(subClass, supClass);
        addAxiom(ax);
        consumeTriple(subject, predicate, object);
    }
View Full Code Here


      return null;
    }

    public AxiomNotAllowed<? extends OWLAxiom> visit(
        OWLClassAssertionAxiom axiom) {
      OWLDescription desc = axiom.getDescription();
      if (desc instanceof OWLClass)
        return null;
      else
        return new AxiomNotAllowed<OWLClassAssertionAxiom>(
            new DescriptionNotAllowed(desc), axiom);
View Full Code Here

        public void visit(OWLEquivalentClassesAxiom axiom) {
            isLocal = true;

            Iterator<OWLDescription> eqs = axiom.getDescriptions().iterator();
            OWLDescription first = eqs.next();

            // axiom is local if it contains a single class description
            if (!eqs.hasNext())
                return;

            // axiom is local iff either all class descriptions evaluate to TOP
            // or all evaluate to BOTTOM

            // check if first class descr. is BOTTOM
            boolean isBottom = bottomEvaluator.isBottomEquivalent(first, signature, localityCls);

            // if not BOTTOM or not TOP then this axiom is non-local
            if (!isBottom && !topEvaluator.isTopEquivalent(first, signature, localityCls))
                isLocal = false;

//            // unless we find a non-locality, process all the class descriptions
//            while (isLocal && eqs.hasNext()) {
//                OWLDescription next = eqs.next();
//
//                if (isBottom) {
//                    // other concepts were BOTTOM so this one should be BOTTOM
//                    // too
//                    if (!bottomEvaluator.isBottomEquivalent(next, signature, localityCls)) {
//                        isLocal = false;
//                    }
//                }
//                else {
//                    // other concepts were TOP so this one should be TOP too
//                    if (!topEvaluator.isTopEquivalent(next, signature, localityCls)) {
//                        isLocal = false;
//                    }
//                }
//            }

            if (isBottom) {
                // unless we find a non-locality, process all the class descriptions
                while (isLocal && eqs.hasNext()) {
                    OWLDescription next = eqs.next();
                    // first class descr. was BOTTOM, so this one should be BOTTOM too
                    if (!bottomEvaluator.isBottomEquivalent(next, signature, localityCls)) {
                        isLocal = false;
                    }
                }
            }
            else {
                // unless we find a non-locality, process all the class descriptions
                while (isLocal && eqs.hasNext()) {
                    OWLDescription next = eqs.next();
                    // first class descr. was TOP, so this one should be TOP too
                    if (!topEvaluator.isTopEquivalent(next, signature, localityCls)) {
                        isLocal = false;
                    }
                }
View Full Code Here

      // all the entities referred in the ATerm to be defined
      // entities. therefore, we add a dummy axiom to the KB
      // that will add the definitions for each entity.
      OWLAxiom axiom = null;
      if( object instanceof OWLDescription ) {
        OWLDescription c = (OWLDescription) object;
        axiom = factory.getOWLSubClassAxiom( c, c );
      }
      else if( object instanceof OWLObjectProperty ) {
        OWLObjectProperty p = (OWLObjectProperty) object;
        axiom = factory.getOWLSubObjectPropertyAxiom( p, p );
View Full Code Here

    OWLOntology ont = loadOntology( base + "anon_inverse.owl" );

    OWLClass C = Class( ns + "C" );
    OWLClass D = Class( ns + "D" );
    OWLObjectProperty r = ObjectProperty( ns + "r" );
    OWLDescription desc = some( inverse( r ), D );

    Reasoner reasoner = new Reasoner( OWL.manager );

    reasoner.loadOntologies( Collections.singleton( ont ) );
View Full Code Here

    isEntailed = reasoner.isSubClassOf( axiom.getSubClass(), axiom.getSuperClass() );
  }

  public void visit(OWLNegativeObjectPropertyAssertionAxiom axiom) {
    OWLDataFactory factory = reasoner.getManager().getOWLDataFactory();
    OWLDescription hasValue = factory.getOWLObjectValueRestriction( axiom.getProperty(), axiom.getObject() );
    OWLDescription doesNotHaveValue = factory.getOWLObjectComplementOf( hasValue );
    isEntailed = reasoner.hasType( axiom.getSubject(), doesNotHaveValue );
  }
View Full Code Here

    }
  }

  public void visit(OWLNegativeDataPropertyAssertionAxiom axiom) {
    OWLDataFactory factory = reasoner.getManager().getOWLDataFactory();
    OWLDescription hasValue = factory.getOWLDataValueRestriction( axiom.getProperty(), axiom.getObject() );
    OWLDescription doesNotHaveValue = factory.getOWLObjectComplementOf( hasValue );
    isEntailed = reasoner.hasType( axiom.getSubject(), doesNotHaveValue );
  }
View Full Code Here

    }
  }

  public void visit(OWLClassAssertionAxiom axiom) {
    OWLIndividual ind = axiom.getIndividual();
    OWLDescription c = axiom.getDescription();

    if( ind.isAnonymous() )
      isEntailed = reasoner.isSatisfiable( c );
    else
      isEntailed = reasoner.hasType( ind, c );
View Full Code Here

  public void visit(OWLEquivalentClassesAxiom axiom) {
    isEntailed = true;

    Iterator<OWLDescription> i = axiom.getDescriptions().iterator();
    if( i.hasNext() ) {
      OWLDescription first = i.next();

      while( i.hasNext() && isEntailed ) {
        OWLDescription next = i.next();

        isEntailed = reasoner.isEquivalentClass( first, next );
      }
    }
  }
View Full Code Here

      : ATermUtils.EMPTY_LIST;
    term = ATermUtils.makeOr( setOfTerms );
  }

  public void visit(OWLObjectComplementOf not) {
    OWLDescription desc = not.getOperand();
    desc.accept( this );

    term = ATermUtils.makeNot( term );
  }
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.OWLDescription

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.