Package org.semanticweb.HermiT.model

Examples of org.semanticweb.HermiT.model.AtomicConcept


    }

    // General inferences

    public boolean isDefined(OWLClass owlClass) {
        AtomicConcept atomicConcept=AtomicConcept.create(owlClass.getIRI().toString());
        return m_dlOntology.containsAtomicConcept(atomicConcept) || AtomicConcept.THING.equals(atomicConcept) || AtomicConcept.NOTHING.equals(atomicConcept);
    }
View Full Code Here


    public boolean isSatisfiable(OWLClassExpression classExpression) {
        checkPreConditions(classExpression);
        if (!isConsistent())
            return false;
        if (classExpression instanceof OWLClass && m_atomicConceptHierarchy!=null) {
            AtomicConcept concept=H((OWLClass)classExpression);
            HierarchyNode<AtomicConcept> node=m_atomicConceptHierarchy.getNodeForElement(concept);
            return node!=m_atomicConceptHierarchy.getBottomNode();
        }
        else {
            OWLDataFactory factory=getDataFactory();
View Full Code Here

    public boolean isSubClassOf(OWLClassExpression subClassExpression,OWLClassExpression superClassExpression) {
        checkPreConditions(subClassExpression,superClassExpression);
        if (!isConsistent() || subClassExpression.isOWLNothing() || superClassExpression.isOWLThing())
            return true;
        if (subClassExpression instanceof OWLClass && superClassExpression instanceof OWLClass) {
            AtomicConcept subconcept=H((OWLClass)subClassExpression);
            AtomicConcept superconcept=H((OWLClass)superClassExpression);
            if (m_atomicConceptHierarchy!=null && !containsFreshEntities(subClassExpression,superClassExpression)) {
                HierarchyNode<AtomicConcept> subconceptNode=m_atomicConceptHierarchy.getNodeForElement(subconcept);
                return subconceptNode.isEquivalentElement(superconcept) || subconceptNode.isAncestorElement(superconcept);
            }
            else {
View Full Code Here

        checkPreConditions(classExpression);
        classify();
        if (!isConsistent())
            return m_atomicConceptHierarchy.getBottomNode();
        else if (classExpression instanceof OWLClass) {
            AtomicConcept atomicConcept=H((OWLClass)classExpression);
            HierarchyNode<AtomicConcept> node=m_atomicConceptHierarchy.getNodeForElement(atomicConcept);
            if (node==null)
                node=new HierarchyNode<AtomicConcept>(atomicConcept,Collections.singleton(atomicConcept),Collections.singleton(m_atomicConceptHierarchy.getTopNode()),Collections.singleton(m_atomicConceptHierarchy.getBottomNode()));
            return node;
        }
View Full Code Here

                // Create the additional axioms for classification
                List<OWLAxiom> additionalAxioms=new ArrayList<OWLAxiom>();
                OWLDataFactory factory=getDataFactory();
                OWLClass freshConcept=factory.getOWLClass(IRI.create("internal:fresh-concept"));
                for (Role objectRole : relevantObjectRoles) {
                    AtomicConcept conceptForRole;
                    OWLObjectPropertyExpression objectPropertyExpression;
                    if (objectRole instanceof AtomicRole) {
                        conceptForRole=AtomicConcept.create("internal:prop#"+((AtomicRole)objectRole).getIRI());
                        objectPropertyExpression=factory.getOWLObjectProperty(IRI.create(((AtomicRole)objectRole).getIRI()));
                    }
                    else {
                        conceptForRole=AtomicConcept.create("internal:prop#inv#"+((InverseRole)objectRole).getInverseOf().getIRI());
                        objectPropertyExpression=factory.getOWLObjectInverseOf(factory.getOWLObjectProperty(IRI.create(((InverseRole)objectRole).getInverseOf().getIRI())));
                    }
                    OWLClass classForRole=factory.getOWLClass(IRI.create(conceptForRole.getIRI()));
                    OWLAxiom axiom=factory.getOWLEquivalentClassesAxiom(classForRole,factory.getOWLObjectSomeValuesFrom(objectPropertyExpression,freshConcept));
                    additionalAxioms.add(axiom);
                    conceptsForRoles.put(objectRole,conceptForRole);
                    rolesForConcepts.put(conceptForRole,objectRole);
                }
View Full Code Here

                }
                public Set<HierarchyNode<AtomicConcept>> getPredecessorElements(HierarchyNode<AtomicConcept> u) {
                    return u.getParentNodes();
                }
                public boolean trueOf(HierarchyNode<AtomicConcept> u) {
                    AtomicConcept potentialDomainConcept=u.getRepresentative();
                    return !tableau.isSatisfiable(false,roleAssertion,Collections.singleton(Atom.create(potentialDomainConcept,freshIndividualA)),null,null,null,ReasoningTaskDescription.isDomainOf(potentialDomainConcept,role));
                }
            };
            nodes=HierarchySearch.search(searchPredicate,Collections.singleton(m_atomicConceptHierarchy.getTopNode()),null);
            m_directObjectRoleDomains.put(role,nodes);
View Full Code Here

                }
                public Set<HierarchyNode<AtomicConcept>> getPredecessorElements(HierarchyNode<AtomicConcept> u) {
                    return u.getParentNodes();
                }
                public boolean trueOf(HierarchyNode<AtomicConcept> u) {
                    AtomicConcept potentialRangeConcept=u.getRepresentative();
                    return !tableau.isSatisfiable(false,roleAssertion,Collections.singleton(Atom.create(potentialRangeConcept,freshIndividualB)),null,null,null,ReasoningTaskDescription.isRangeOf(potentialRangeConcept,role));
                }
            };
            nodes=HierarchySearch.search(searchPredicate,Collections.singleton(m_atomicConceptHierarchy.getTopNode()),null);
            m_directObjectRoleRanges.put(role,nodes);
View Full Code Here

                // Create the additional axioms for classification
                List<OWLAxiom> additionalAxioms=new ArrayList<OWLAxiom>();
                OWLDataFactory factory=getDataFactory();
                OWLDatatype unknownDatatypeA=factory.getOWLDatatype(IRI.create("internal:unknown-datatype#A"));
                for (AtomicRole dataRole : relevantDataRoles) {
                    AtomicConcept conceptForRole;
                    if (AtomicRole.TOP_DATA_ROLE.equals(dataRole))
                        conceptForRole=AtomicConcept.THING;
                    else if (AtomicRole.BOTTOM_DATA_ROLE.equals(dataRole))
                        conceptForRole=AtomicConcept.NOTHING;
                    else {
                        conceptForRole=AtomicConcept.create("internal:prop#"+dataRole.getIRI());
                        OWLClass classForRole=factory.getOWLClass(IRI.create(conceptForRole.getIRI()));
                        OWLDataProperty dataProperty=factory.getOWLDataProperty(IRI.create(dataRole.getIRI()));
                        OWLAxiom axiom=factory.getOWLEquivalentClassesAxiom(classForRole,factory.getOWLDataSomeValuesFrom(dataProperty,unknownDatatypeA));
                        additionalAxioms.add(axiom);
                    }
                    conceptsForRoles.put(dataRole,conceptForRole);
View Full Code Here

                }
                public Set<HierarchyNode<AtomicConcept>> getPredecessorElements(HierarchyNode<AtomicConcept> u) {
                    return u.getParentNodes();
                }
                public boolean trueOf(HierarchyNode<AtomicConcept> u) {
                    AtomicConcept potentialDomainConcept=u.getRepresentative();
                    return !tableau.isSatisfiable(false,roleAssertion,Collections.singleton(Atom.create(potentialDomainConcept,freshIndividual)),null,null,null,ReasoningTaskDescription.isDomainOf(potentialDomainConcept,atomicRole));
                }
            };
            nodes=HierarchySearch.search(searchPredicate,Collections.singleton(m_atomicConceptHierarchy.getTopNode()),null);
            m_directDataRoleDomains.put(atomicRole,nodes);
View Full Code Here

    public boolean hasType(OWLNamedIndividual namedIndividual,OWLClassExpression type,boolean direct) {
        checkPreConditions(namedIndividual,type);
        if (!m_isConsistent) return true;
        else if (direct && isRealised() && type instanceof OWLClass) {
            Individual individual=H(namedIndividual);
            AtomicConcept atomicConcept=H((OWLClass)type);
            Set<Individual> individuals=m_realization.get(atomicConcept);
            return individuals!=null && individuals.contains(individual);
        }
        else if (type instanceof OWLClass) {
            Individual individual=H(namedIndividual);
            AtomicConcept atomicConcept=H((OWLClass)type);
            return !getTableau().isSatisfiable(true,true,null,Collections.singleton(Atom.create(atomicConcept,individual)),null,null,null,ReasoningTaskDescription.isInstanceOf(individual,atomicConcept));
        }
        else {
            OWLDataFactory factory=getDataFactory();
            OWLAxiom negatedAssertionAxiom=factory.getOWLClassAssertionAxiom(type.getObjectComplementOf(),namedIndividual);
View Full Code Here

TOP

Related Classes of org.semanticweb.HermiT.model.AtomicConcept

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.