private boolean checkBound(@Nonnull QueryAtom atom) {
        List<QueryArgument> args = atom.getArguments();

        QueryArgument arg0, arg1, arg2;

        switch (atom.getType()) {
            case TYPE: {
                arg0 = args.get(0);
                arg1 = args.get(1);
                OWLNamedIndividual ind = asIndividual(arg0);
                OWLClass cls = asClass(arg1);
                OWLClassAssertionAxiom ax = factory.getOWLClassAssertionAxiom(cls, ind);
                return reasoner.getRootOntology()
                               .containsAxiom(ax,
                                              Imports.INCLUDED,
                                              AxiomAnnotations.CONSIDER_AXIOM_ANNOTATIONS)
                        || reasoner.isEntailed(factory.getOWLClassAssertionAxiom(cls, ind));
            }
            case DIRECT_TYPE:
                arg0 = args.get(0);
                arg1 = args.get(1);
                return reasoner.getTypes(asIndividual(arg0), true).containsEntity(asClass(arg1));
            case PROPERTY_VALUE:
                arg0 = args.get(0);
                arg1 = args.get(1);
                arg2 = args.get(2);
                if (arg2.isURI()) {
                    OWLNamedIndividual subject = asIndividual(arg0);
                    OWLObjectProperty property = asObjectProperty(arg1);
                    OWLNamedIndividual object = asIndividual(arg2);
                    OWLObjectPropertyAssertionAxiom ax = factory.getOWLObjectPropertyAssertionAxiom(property,
                                                                                                    subject,
                                                                                                    object);
                    return reasoner.getRootOntology().containsAxiom(ax)
                            || reasoner.getObjectPropertyValues(subject, property).containsEntity(object);
                }
                else if (arg2.isLiteral()) {
                    OWLNamedIndividual subject = asIndividual(arg0);
                    OWLDataProperty property = asDataProperty(arg1);
                    OWLLiteral object = asLiteral(arg2);
                    OWLDataPropertyAssertionAxiom ax = factory.getOWLDataPropertyAssertionAxiom(property,
                                                                                                subject,
                                                                                                object);
                    if (reasoner.getRootOntology().containsAxiom(ax)) {
                        return true;
                    }
                    // Not sure about this
                    for (OWLLiteral l : reasoner.getDataPropertyValues(subject, property)) {
                        if (l.getLiteral().equals(asLiteral(arg2).getLiteral())) {
                            return true;
                        }
                    }
                    return false;
                }
                return false;
            case SUB_CLASS_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);
                OWLClass subCls = asClass(arg0);
                if (subCls.isOWLNothing()) {
                    return true;
                }
                OWLClass superCls = asClass(arg1);
                return superCls.isOWLThing()
                        || reasoner.isEntailed(factory.getOWLSubClassOfAxiom(subCls, superCls));
            case STRICT_SUB_CLASS_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);
                return reasoner.getSubClasses(asClass(arg1), false).containsEntity(asClass(arg0));
            case DIRECT_SUB_CLASS_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);
                return reasoner.getSubClasses(asClass(arg1), true).containsEntity(asClass(arg0));
            case EQUIVALENT_CLASS:
                arg0 = args.get(0);
                arg1 = args.get(1);
                return reasoner.getEquivalentClasses(asClass(arg0)).contains(asClass(arg1));
            case FUNCTIONAL:
                arg0 = args.get(0);
                OWLObjectProperty functional_op = asObjectProperty(arg0);
                OWLDataProperty functional_dp = asDataProperty(arg0);
                if (isDeclared(functional_op)) {
                    return reasoner.isEntailed(factory.getOWLFunctionalObjectPropertyAxiom(functional_op));
                }
                else if (isDeclared(functional_dp)) {
                    return reasoner.isEntailed(factory.getOWLFunctionalDataPropertyAxiom(functional_dp));
                }
                return false;
            case INVERSE_FUNCTIONAL:
                arg0 = args.get(0);
                return reasoner.isEntailed(factory.getOWLInverseFunctionalObjectPropertyAxiom(asObjectProperty(arg0)));
            case TRANSITIVE:
                arg0 = args.get(0);
                return reasoner.isEntailed(factory.getOWLTransitiveObjectPropertyAxiom(asObjectProperty(arg0)));
            case SYMMETRIC:
                arg0 = args.get(0);
                return reasoner.isEntailed(factory.getOWLSymmetricObjectPropertyAxiom(asObjectProperty(arg0)));
            case REFLEXIVE:
                arg0 = args.get(0);
                return reasoner.isEntailed(factory.getOWLReflexiveObjectPropertyAxiom(asObjectProperty(arg0)));
            case IRREFLEXIVE:
                arg0 = args.get(0);
                return reasoner.isEntailed(factory.getOWLIrreflexiveObjectPropertyAxiom(asObjectProperty(arg0)));
            case SUB_PROPERTY_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);

                OWLObjectProperty sub_prop_op0 = asObjectProperty(arg0);
                OWLDataProperty sub_prop_dp0 = asDataProperty(arg0);

                if (isDeclared(sub_prop_op0)) {
                    return reasoner.getSubObjectProperties(asObjectProperty(arg1), false)
                                   .containsEntity(sub_prop_op0) ||
                            reasoner.getEquivalentObjectProperties(asObjectProperty(arg1)).contains(sub_prop_op0);
                }
                else if (isDeclared(sub_prop_dp0)) {
                    return reasoner.getSubDataProperties(asDataProperty(arg1), false).containsEntity(sub_prop_dp0) ||
                            reasoner.getEquivalentDataProperties(asDataProperty(arg1)).contains(sub_prop_dp0);
                }
                return false;
            case STRICT_SUB_PROPERTY_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);

                OWLObjectProperty strict_sub_prop_op0 = asObjectProperty(arg0);
                OWLDataProperty strict_sub_prop_dp0 = asDataProperty(arg0);

                if (isDeclared(strict_sub_prop_op0)) {
                    return reasoner.getSubObjectProperties(asObjectProperty(arg1), false)
                                   .containsEntity(strict_sub_prop_op0);
                }
                else if (isDeclared(strict_sub_prop_dp0)) {
                    return reasoner.getSubDataProperties(asDataProperty(arg1), false)
                                   .containsEntity(strict_sub_prop_dp0);
                }
                return false;
            case DIRECT_SUB_PROPERTY_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);

                OWLObjectProperty direct_sub_prop_op0 = asObjectProperty(arg0);
                OWLDataProperty direct_sub_prop_dp0 = asDataProperty(arg0);

                if (isDeclared(direct_sub_prop_op0)) {
                    return reasoner.getSubObjectProperties(asObjectProperty(arg1), true)
                                   .containsEntity(direct_sub_prop_op0);
                }
                else if (isDeclared(direct_sub_prop_dp0)) {
                    return reasoner.getSubDataProperties(asDataProperty(arg1), true)
                                   .containsEntity(direct_sub_prop_dp0);
                }
                return false;
            case INVERSE_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);

                OWLObjectProperty inv_prop_op0 = asObjectProperty(arg0);

                return isDeclared(inv_prop_op0) && reasoner.getInverseObjectProperties(inv_prop_op0)
                                                           .contains(asObjectProperty(arg1));
            case EQUIVALENT_PROPERTY:
                arg0 = args.get(0);
                arg1 = args.get(1);

                OWLObjectProperty equiv_prop_op0 = asObjectProperty(arg0);
                OWLDataProperty equiv_prop_dp0 = asDataProperty(arg0);

                if (isDeclared(equiv_prop_op0)) {
                    return reasoner.getEquivalentObjectProperties(equiv_prop_op0).contains(asObjectProperty(arg1));
                }
                else if (isDeclared(equiv_prop_dp0)) {
                    return reasoner.getEquivalentDataProperties(equiv_prop_dp0).contains(asDataProperty(arg1));
                }
                return false;
            case DOMAIN:
                arg0 = args.get(0);
                arg1 = args.get(1);
                OWLObjectProperty op_0 = asObjectProperty(arg0);
                OWLDataProperty dp_0 = asDataProperty(arg0);
                OWLAnnotationProperty ap_0 = asAnnotationProperty(arg0);
                if (isDeclared(op_0)) {
                    return reasoner.getObjectPropertyDomains(op_0, false).containsEntity(asClass(arg1));
                }
                else if (isDeclared(dp_0)) {
                    return reasoner.getDataPropertyDomains(dp_0, false).containsEntity(asClass(arg1));
                }
                else if (isDeclared(ap_0)) {
                    if (!arg1.isURI()) {
                        return false;
                    }
                    Set<OWLAnnotationPropertyDomainAxiom> axioms = reasoner.getRootOntology()
                                                                           .getAxioms(AxiomType.ANNOTATION_PROPERTY_DOMAIN,
                                                                                      Imports.INCLUDED);
                    for (OWLAnnotationPropertyDomainAxiom ax : axioms) {
                        if (ax.getProperty().equals(ap_0)) {
                            if (ax.getDomain().equals(arg1.getValueAsIRI())) {
                                return true;
                            }
                        }
                    }
                }
                return false;
            case RANGE:
                arg0 = args.get(0);
                arg1 = args.get(1);
                OWLObjectProperty rng_op_0 = asObjectProperty(arg0);
                OWLDataProperty rng_dp_0 = asDataProperty(arg0);
                OWLAnnotationProperty rng_ap_0 = asAnnotationProperty(arg0);
                if (isDeclared(rng_op_0)) {
                    return reasoner.getObjectPropertyRanges(rng_op_0, false).containsEntity(asClass(arg1));
                }
                else if (isDeclared(rng_dp_0)) {
                    OWLDataPropertyRangeAxiom ax = manager.getOWLDataFactory()
                                                          .getOWLDataPropertyRangeAxiom(rng_dp_0, asDatatype(arg1));
                    return reasoner.isEntailed(ax);
                }
                else if (isDeclared(rng_ap_0)) {
                    if (!arg1.isURI()) {
                        return false;
                    }
                    Set<OWLAnnotationPropertyRangeAxiom> axioms = reasoner.getRootOntology()
                                                                          .getAxioms(AxiomType.ANNOTATION_PROPERTY_RANGE,
                                                                                     Imports.INCLUDED);
                    for (OWLAnnotationPropertyRangeAxiom ax : axioms) {
                        if (ax.getProperty().equals(rng_ap_0)) {
                            if (ax.getRange().equals(arg1.getValueAsIRI())) {
                                return true;
                            }
                        }
                    }
                }
                return false;
            case SAME_AS:
                arg0 = args.get(0);
                arg1 = args.get(1);

                return reasoner.getSameIndividuals(asIndividual(arg0)).contains(asIndividual(arg1));
            case DIFFERENT_FROM:
                arg0 = args.get(0);
                arg1 = args.get(1);

                return reasoner.getDifferentIndividuals(asIndividual(arg0)).containsEntity(asIndividual(arg1));
            case DISJOINT_WITH:
                arg0 = args.get(0);
                arg1 = args.get(1);

                return reasoner.getDisjointClasses(asClass(arg0)).containsEntity(asClass(arg1));
            case COMPLEMENT_OF:
                arg0 = args.get(0);
                arg1 = args.get(1);

                return reasoner.getEquivalentClasses(factory.getOWLObjectComplementOf(asClass(arg0)))
                               .contains(asClass(arg1));
            case ANNOTATION:
                arg0 = args.get(0); // Subject
                arg1 = args.get(1); // Property
                arg2 = args.get(2); // Object
                OWLEntity anEntity = null;
                OWLAnnotationProperty anProp = asAnnotationProperty(arg1);
                final OWLAnnotationAssertionAxiom ax;
                if (arg2.getType() == QueryArgumentType.URI) {
                    ax = factory.getOWLAnnotationAssertionAxiom(anProp, arg0.getValueAsIRI(), arg2.getValueAsIRI());
                }
                else if (arg2.getType() == QueryArgumentType.BNODE) {
                    ax = factory.getOWLAnnotationAssertionAxiom(anProp, arg0.getValueAsIRI(), arg2.getValueAsBNode());
                }
                else {
                    ax = factory.getOWLAnnotationAssertionAxiom(anProp, arg0.getValueAsIRI(), arg2.getValueAsLiteral());
                }
                return  unannotatedAxioms.contains(ax);
//                if (unannotatedAxioms.contains(ax)) {
//                    return true;
//                }
//
//                if (isDeclaredIndividual(arg0)) {
//                    anEntity = asIndividual(arg0);
//                }
//                else if (isDeclaredDataProperty(arg0)) {
//                    anEntity = asDataProperty(arg0);
//                }
//                else if (isDeclaredObjectProperty(arg0)) {
//                    anEntity = asObjectProperty(arg0);
//                }
//                else if (isDeclaredClass(arg0)) {
//                    anEntity = asClass(arg0);
//                }
//
//                if (anEntity == null) {
//                    return false;
//                }
//
//                Set<OWLAnnotation> annotations = new HashSet<>();
//                for (OWLOntology o : getImportsClosure()) {
//                    annotations.addAll(EntitySearcher.getAnnotations(anEntity, o, anProp));
//                }
//
//                if (arg2.isURI()) {
//                    for (OWLAnnotation a : annotations) {
//                        if (a.getValue() instanceof IRI) {
//                            IRI i = (IRI) a.getValue();
//                            if (i.equals(arg2.getValueAsIRI())) {
//                                return true;
//                            }
//                        }
//                    }
//                }
//                else if (arg2.isLiteral()) {
//                    for (OWLAnnotation a : annotations) {
//                        if (a.getValue() instanceof OWLLiteral) {
//                            OWLLiteral l = (OWLLiteral) a.getValue();
//                            if (l.equals(arg2.getValueAsLiteral())) {
//                                return true;
//                            }
//                        }
//                    }
//                }
//                return false;
            case CLASS:
                return isDeclaredClass(args.get(0));
            case INDIVIDUAL:
                return isDeclaredIndividual(args.get(0));
            case PROPERTY:
                return isDeclaredObjectProperty(args.get(0)) || isDeclaredDataProperty(args.get(0));
            case OBJECT_PROPERTY:
                return isDeclaredObjectProperty(args.get(0));
            case DATA_PROPERTY:
                return isDeclaredDataProperty(args.get(0));
            case ANNOTATION_PROPERTY:
                return isDeclaredAnnotationProperty(args.get(0));
            default:
                throw new RuntimeException("Unsupported or unknown atom type.");
        }
    }
private boolean checkBound ( @ Nonnull QueryAtom atom ) { List < QueryArgument > args = atom . getArguments ( ) ; QueryArgument arg0 , arg1 , arg2 ; switch ( atom . getType ( ) ) { case TYPE : { arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLNamedIndividual ind = asIndividual ( arg0 ) ; OWLClass cls = asClass ( arg1 ) ; OWLClassAssertionAxiom ax = factory . getOWLClassAssertionAxiom ( cls , ind ) ; return reasoner . getRootOntology ( ) . containsAxiom ( ax , Imports . INCLUDED , AxiomAnnotations . CONSIDER_AXIOM_ANNOTATIONS ) || reasoner . isEntailed ( factory . getOWLClassAssertionAxiom ( cls , ind ) ) ; } case DIRECT_TYPE : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getTypes ( asIndividual ( arg0 ) , true ) . containsEntity ( asClass ( arg1 ) ) ; case PROPERTY_VALUE : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; arg2 = args . get ( 2 ) ; if ( arg2 . isURI ( ) ) { OWLNamedIndividual subject = asIndividual ( arg0 ) ; OWLObjectProperty property = asObjectProperty ( arg1 ) ; OWLNamedIndividual object = asIndividual ( arg2 ) ; OWLObjectPropertyAssertionAxiom ax = factory . getOWLObjectPropertyAssertionAxiom ( property , subject , object ) ; return reasoner . getRootOntology ( ) . containsAxiom ( ax ) || reasoner . getObjectPropertyValues ( subject , property ) . containsEntity ( object ) ; } else if ( arg2 . isLiteral ( ) ) { OWLNamedIndividual subject = asIndividual ( arg0 ) ; OWLDataProperty property = asDataProperty ( arg1 ) ; OWLLiteral object = asLiteral ( arg2 ) ; OWLDataPropertyAssertionAxiom ax = factory . getOWLDataPropertyAssertionAxiom ( property , subject , object ) ; if ( reasoner . getRootOntology ( ) . containsAxiom ( ax ) ) { return true ; } for ( OWLLiteral l : reasoner . getDataPropertyValues ( subject , property ) ) { if ( l . getLiteral ( ) . equals ( asLiteral ( arg2 ) . getLiteral ( ) ) ) { return true ; } } return false ; } return false ; case SUB_CLASS_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLClass subCls = asClass ( arg0 ) ; if ( subCls . isOWLNothing ( ) ) { return true ; } OWLClass superCls = asClass ( arg1 ) ; return superCls . isOWLThing ( ) || reasoner . isEntailed ( factory . getOWLSubClassOfAxiom ( subCls , superCls ) ) ; case STRICT_SUB_CLASS_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getSubClasses ( asClass ( arg1 ) , false ) . containsEntity ( asClass ( arg0 ) ) ; case DIRECT_SUB_CLASS_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getSubClasses ( asClass ( arg1 ) , true ) . containsEntity ( asClass ( arg0 ) ) ; case EQUIVALENT_CLASS : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getEquivalentClasses ( asClass ( arg0 ) ) . contains ( asClass ( arg1 ) ) ; case FUNCTIONAL : arg0 = args . get ( 0 ) ; OWLObjectProperty functional_op = asObjectProperty ( arg0 ) ; OWLDataProperty functional_dp = asDataProperty ( arg0 ) ; if ( isDeclared ( functional_op ) ) { return reasoner . isEntailed ( factory . getOWLFunctionalObjectPropertyAxiom ( functional_op ) ) ; } else if ( isDeclared ( functional_dp ) ) { return reasoner . isEntailed ( factory . getOWLFunctionalDataPropertyAxiom ( functional_dp ) ) ; } return false ; case INVERSE_FUNCTIONAL : arg0 = args . get ( 0 ) ; return reasoner . isEntailed ( factory . getOWLInverseFunctionalObjectPropertyAxiom ( asObjectProperty ( arg0 ) ) ) ; case TRANSITIVE : arg0 = args . get ( 0 ) ; return reasoner . isEntailed ( factory . getOWLTransitiveObjectPropertyAxiom ( asObjectProperty ( arg0 ) ) ) ; case SYMMETRIC : arg0 = args . get ( 0 ) ; return reasoner . isEntailed ( factory . getOWLSymmetricObjectPropertyAxiom ( asObjectProperty ( arg0 ) ) ) ; case REFLEXIVE : arg0 = args . get ( 0 ) ; return reasoner . isEntailed ( factory . getOWLReflexiveObjectPropertyAxiom ( asObjectProperty ( arg0 ) ) ) ; case IRREFLEXIVE : arg0 = args . get ( 0 ) ; return reasoner . isEntailed ( factory . getOWLIrreflexiveObjectPropertyAxiom ( asObjectProperty ( arg0 ) ) ) ; case SUB_PROPERTY_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty sub_prop_op0 = asObjectProperty ( arg0 ) ; OWLDataProperty sub_prop_dp0 = asDataProperty ( arg0 ) ; if ( isDeclared ( sub_prop_op0 ) ) { return reasoner . getSubObjectProperties ( asObjectProperty ( arg1 ) , false ) . containsEntity ( sub_prop_op0 ) || reasoner . getEquivalentObjectProperties ( asObjectProperty ( arg1 ) ) . contains ( sub_prop_op0 ) ; } else if ( isDeclared ( sub_prop_dp0 ) ) { return reasoner . getSubDataProperties ( asDataProperty ( arg1 ) , false ) . containsEntity ( sub_prop_dp0 ) || reasoner . getEquivalentDataProperties ( asDataProperty ( arg1 ) ) . contains ( sub_prop_dp0 ) ; } return false ; case STRICT_SUB_PROPERTY_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty strict_sub_prop_op0 = asObjectProperty ( arg0 ) ; OWLDataProperty strict_sub_prop_dp0 = asDataProperty ( arg0 ) ; if ( isDeclared ( strict_sub_prop_op0 ) ) { return reasoner . getSubObjectProperties ( asObjectProperty ( arg1 ) , false ) . containsEntity ( strict_sub_prop_op0 ) ; } else if ( isDeclared ( strict_sub_prop_dp0 ) ) { return reasoner . getSubDataProperties ( asDataProperty ( arg1 ) , false ) . containsEntity ( strict_sub_prop_dp0 ) ; } return false ; case DIRECT_SUB_PROPERTY_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty direct_sub_prop_op0 = asObjectProperty ( arg0 ) ; OWLDataProperty direct_sub_prop_dp0 = asDataProperty ( arg0 ) ; if ( isDeclared ( direct_sub_prop_op0 ) ) { return reasoner . getSubObjectProperties ( asObjectProperty ( arg1 ) , true ) . containsEntity ( direct_sub_prop_op0 ) ; } else if ( isDeclared ( direct_sub_prop_dp0 ) ) { return reasoner . getSubDataProperties ( asDataProperty ( arg1 ) , true ) . containsEntity ( direct_sub_prop_dp0 ) ; } return false ; case INVERSE_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty inv_prop_op0 = asObjectProperty ( arg0 ) ; return isDeclared ( inv_prop_op0 ) && reasoner . getInverseObjectProperties ( inv_prop_op0 ) . contains ( asObjectProperty ( arg1 ) ) ; case EQUIVALENT_PROPERTY : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty equiv_prop_op0 = asObjectProperty ( arg0 ) ; OWLDataProperty equiv_prop_dp0 = asDataProperty ( arg0 ) ; if ( isDeclared ( equiv_prop_op0 ) ) { return reasoner . getEquivalentObjectProperties ( equiv_prop_op0 ) . contains ( asObjectProperty ( arg1 ) ) ; } else if ( isDeclared ( equiv_prop_dp0 ) ) { return reasoner . getEquivalentDataProperties ( equiv_prop_dp0 ) . contains ( asDataProperty ( arg1 ) ) ; } return false ; case DOMAIN : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty op_0 = asObjectProperty ( arg0 ) ; OWLDataProperty dp_0 = asDataProperty ( arg0 ) ; OWLAnnotationProperty ap_0 = asAnnotationProperty ( arg0 ) ; if ( isDeclared ( op_0 ) ) { return reasoner . getObjectPropertyDomains ( op_0 , false ) . containsEntity ( asClass ( arg1 ) ) ; } else if ( isDeclared ( dp_0 ) ) { return reasoner . getDataPropertyDomains ( dp_0 , false ) . containsEntity ( asClass ( arg1 ) ) ; } else if ( isDeclared ( ap_0 ) ) { if ( ! arg1 . isURI ( ) ) { return false ; } Set < OWLAnnotationPropertyDomainAxiom > axioms = reasoner . getRootOntology ( ) . getAxioms ( AxiomType . ANNOTATION_PROPERTY_DOMAIN , Imports . INCLUDED ) ; for ( OWLAnnotationPropertyDomainAxiom ax : axioms ) { if ( ax . getProperty ( ) . equals ( ap_0 ) ) { if ( ax . getDomain ( ) . equals ( arg1 . getValueAsIRI ( ) ) ) { return true ; } } } } return false ; case RANGE : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; OWLObjectProperty rng_op_0 = asObjectProperty ( arg0 ) ; OWLDataProperty rng_dp_0 = asDataProperty ( arg0 ) ; OWLAnnotationProperty rng_ap_0 = asAnnotationProperty ( arg0 ) ; if ( isDeclared ( rng_op_0 ) ) { return reasoner . getObjectPropertyRanges ( rng_op_0 , false ) . containsEntity ( asClass ( arg1 ) ) ; } else if ( isDeclared ( rng_dp_0 ) ) { OWLDataPropertyRangeAxiom ax = manager . getOWLDataFactory ( ) . getOWLDataPropertyRangeAxiom ( rng_dp_0 , asDatatype ( arg1 ) ) ; return reasoner . isEntailed ( ax ) ; } else if ( isDeclared ( rng_ap_0 ) ) { if ( ! arg1 . isURI ( ) ) { return false ; } Set < OWLAnnotationPropertyRangeAxiom > axioms = reasoner . getRootOntology ( ) . getAxioms ( AxiomType . ANNOTATION_PROPERTY_RANGE , Imports . INCLUDED ) ; for ( OWLAnnotationPropertyRangeAxiom ax : axioms ) { if ( ax . getProperty ( ) . equals ( rng_ap_0 ) ) { if ( ax . getRange ( ) . equals ( arg1 . getValueAsIRI ( ) ) ) { return true ; } } } } return false ; case SAME_AS : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getSameIndividuals ( asIndividual ( arg0 ) ) . contains ( asIndividual ( arg1 ) ) ; case DIFFERENT_FROM : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getDifferentIndividuals ( asIndividual ( arg0 ) ) . containsEntity ( asIndividual ( arg1 ) ) ; case DISJOINT_WITH : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getDisjointClasses ( asClass ( arg0 ) ) . containsEntity ( asClass ( arg1 ) ) ; case COMPLEMENT_OF : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; return reasoner . getEquivalentClasses ( factory . getOWLObjectComplementOf ( asClass ( arg0 ) ) ) . contains ( asClass ( arg1 ) ) ; case ANNOTATION : arg0 = args . get ( 0 ) ; arg1 = args . get ( 1 ) ; arg2 = args . get ( 2 ) ; OWLEntity anEntity = null ; OWLAnnotationProperty anProp = asAnnotationProperty ( arg1 ) ; final OWLAnnotationAssertionAxiom ax ; if ( arg2 . getType ( ) == QueryArgumentType . URI ) { ax = factory . getOWLAnnotationAssertionAxiom ( anProp , arg0 . getValueAsIRI ( ) , arg2 . getValueAsIRI ( ) ) ; } else if ( arg2 . getType ( ) == QueryArgumentType . BNODE ) { ax = factory . getOWLAnnotationAssertionAxiom ( anProp , arg0 . getValueAsIRI ( ) , arg2 . getValueAsBNode ( ) ) ; } else { ax = factory . getOWLAnnotationAssertionAxiom ( anProp , arg0 . getValueAsIRI ( ) , arg2 . getValueAsLiteral ( ) ) ; } return unannotatedAxioms . contains ( ax ) ; case CLASS : return isDeclaredClass ( args . get ( 0 ) ) ; case INDIVIDUAL : return isDeclaredIndividual ( args . get ( 0 ) ) ; case PROPERTY : return isDeclaredObjectProperty ( args . get ( 0 ) ) || isDeclaredDataProperty ( args . get ( 0 ) ) ; case OBJECT_PROPERTY : return isDeclaredObjectProperty ( args . get ( 0 ) ) ; case DATA_PROPERTY : return isDeclaredDataProperty ( args . get ( 0 ) ) ; case ANNOTATION_PROPERTY : return isDeclaredAnnotationProperty ( args . get ( 0 ) ) ; default : throw new RuntimeException ( "Unsupported or unknown atom type." ) ; } }
Determines if the specified binding is actually entailed by the ontology

@param atom The atom to check.
@return true if the binding is entailed by the ontology, otherwise false