Package org.semanticweb.HermiT.model

Examples of org.semanticweb.HermiT.model.AtomicRole


    }
    public NodeSet<OWLClass> getDataPropertyDomains(OWLDataProperty property,boolean direct) {
        checkPreConditions(property);
        classify();
        if (!m_isConsistent) return new OWLClassNodeSet(getBottomClassNode());
        final AtomicRole atomicRole=H(property);
        Set<HierarchyNode<AtomicConcept>> nodes=m_directDataRoleDomains.get(atomicRole);
        if (nodes==null) {
            final Individual freshIndividual=Individual.createAnonymous("fresh-individual");
            final Constant freshConstant=Constant.createAnonymous("fresh-constant");
            final Set<Atom> roleAssertion=Collections.singleton(atomicRole.getRoleAssertion(freshIndividual,freshConstant));
            final Tableau tableau=getTableau();
            HierarchySearch.SearchPredicate<HierarchyNode<AtomicConcept>> searchPredicate=new HierarchySearch.SearchPredicate<HierarchyNode<AtomicConcept>>() {
                public Set<HierarchyNode<AtomicConcept>> getSuccessorElements(HierarchyNode<AtomicConcept> u) {
                    return u.getChildNodes();
                }
View Full Code Here


                result.add(node);
                if (!direct)
                    result.addAll(node.getDescendantNodes());
                return dataPropertyHierarchyNodesToNodeSet(result);
            }
            AtomicRole atomicRole=H(propertyExpression.asOWLDataProperty());
            Individual freshIndividual=Individual.create("fresh-individual");
            Constant freshConstant=Constant.createAnonymous("fresh-constant");
            Atom atomicRoleAssertion=atomicRole.getRoleAssertion(freshIndividual,freshConstant);
            Tableau tableau=getTableau();
            Set<HierarchyNode<AtomicRole>> nodesToTest=new HashSet<HierarchyNode<AtomicRole>>();
            nodesToTest.addAll(m_dataRoleHierarchy.getTopNode().getChildNodes());
            while (!nodesToTest.isEmpty()) {
                HierarchyNode<AtomicRole> nodeToTest=nodesToTest.iterator().next();
                nodesToTest.remove(nodeToTest);
                AtomicRole atomicRoleToTest=nodeToTest.getRepresentative();
                Atom atomicRoleToTestAssertion=atomicRoleToTest.getRoleAssertion(freshIndividual,freshConstant);
                Set<Atom> perTestAtoms=new HashSet<Atom>(2);
                perTestAtoms.add(atomicRoleAssertion);
                perTestAtoms.add(atomicRoleToTestAssertion);
                if (!tableau.isSatisfiable(false,perTestAtoms,null,null,null,null,new ReasoningTaskDescription(true,"disjointness of {0} and {1}",atomicRole,atomicRoleToTest))) {
                    // disjoint
View Full Code Here

        }
    }
    public boolean isFunctional(OWLDataProperty property) {
        checkPreConditions(property);
        if (!m_isConsistent) return true;
        AtomicRole atomicRole=H(property);
        Individual freshIndividual=Individual.createAnonymous("fresh-individual");
        Constant freshConstantA=Constant.createAnonymous("fresh-constant-A");
        Constant freshConstantB=Constant.createAnonymous("fresh-constant-B");
        Set<Atom> assertions=new HashSet<Atom>();
        assertions.add(atomicRole.getRoleAssertion(freshIndividual,freshConstantA));
        assertions.add(atomicRole.getRoleAssertion(freshIndividual,freshConstantB));
        assertions.add(Atom.create(Inequality.INSTANCE,freshConstantA,freshConstantB));
        return !getTableau().isSatisfiable(false,assertions,null,null,null,null,new ReasoningTaskDescription(true,"functionality of {0}",atomicRole));
    }
View Full Code Here

    protected HierarchyNode<AtomicRole> getHierarchyNode(OWLDataProperty property) {
        checkPreConditions(property);
        classifyDataProperties();
        if (!m_isConsistent) return m_dataRoleHierarchy.getBottomNode();
        else {
            AtomicRole atomicRole=H(property);
            HierarchyNode<AtomicRole> node=m_dataRoleHierarchy.getNodeForElement(atomicRole);
            if (node==null)
                node=new HierarchyNode<AtomicRole>(atomicRole,Collections.singleton(atomicRole),Collections.singleton(m_dataRoleHierarchy.getTopNode()),Collections.singleton(m_dataRoleHierarchy.getBottomNode()));
            return node;
        }
View Full Code Here

        Set<OWLLiteral> result=new HashSet<OWLLiteral>();
        if (m_dlOntology.hasDatatypes()) {
            OWLDataFactory factory=getDataFactory();
            Individual individual=H(namedIndividual);
            for (OWLDataProperty dataProperty : getDescendantDataProperties(property).getFlattened()) {
                AtomicRole atomicRole=H(dataProperty);
                Map<Individual,Set<Constant>> dataPropertyAssertions=m_dlOntology.getDataPropertyAssertions().get(atomicRole);
                if (dataPropertyAssertions!=null) {
                    if (dataPropertyAssertions.containsKey(individual)) {
                        for (Constant constant : dataPropertyAssertions.get(individual)) {
                            String lexicalForm=constant.getLexicalForm();
View Full Code Here

                result.put(ind, getAllNamedIndividuals());
            }
            return result;
        }
        OWLDataFactory factory=getDataFactory();
        AtomicRole role=H(property);
        initializeKnownAndPossibleRelations();
        // If an individual is declared, but not used in a logical axiom, it can still be related
        // e.g., {ReflexiveObjectProperty(r)} entails r(a,a) even if a if not used in a logical axiom
        Map<Individual,Set<Individual>> relations=m_possibleObjectPropertyRelations.get(role);
        if (relations!=null) {
View Full Code Here

            OWLNamedIndividual tmp=subject;
            subject=object;
            object=tmp;
        }
        OWLDataFactory factory=getDataFactory();
        AtomicRole role=H(property);
        Individual subj=H(subject);
        Individual obj=H(object);
        boolean testEvenIfNotPossible=false;
        Map<Individual,Set<Individual>> relations=null;
        if (!getAllNamedIndividuals().contains(subject) || !getAllNamedIndividuals().contains(object)) {
View Full Code Here

        public void visit(OWLObjectExactCardinality object) {
            throw new IllegalStateException("Internal error: invalid normal form.");
        }
        public void visit(OWLDataSomeValuesFrom object) {
            if (!object.getProperty().isOWLBottomDataProperty()) {
                AtomicRole atomicRole=getAtomicRole(object.getProperty());
                LiteralConcept literalConcept=m_dataRangeConverter.convertDataRange(object.getFiller());
                AtLeastConcept atLeastConcept=AtLeastConcept.create(1,atomicRole,literalConcept);
                if (!atLeastConcept.isAlwaysFalse())
                    m_headAtoms.add(Atom.create(atLeastConcept,X));
            }
View Full Code Here

                if (dr.isDatatype()) {
                    String dt=dr.asOWLDatatype().getIRI().toString();
                    if (dt2maxRangeCardinality.containsKey(dt) && n>dt2maxRangeCardinality.get(dt))
                        return;
                }
                AtomicRole atomicRole=getAtomicRole(object.getProperty());
                LiteralConcept literalConcept=m_dataRangeConverter.convertDataRange(object.getFiller());
                AtLeastConcept atLeastConcept=AtLeastConcept.create(object.getCardinality(),atomicRole,literalConcept);
                if (!atLeastConcept.isAlwaysFalse())
                    m_headAtoms.add(Atom.create(atLeastConcept,X));
            }
View Full Code Here

TOP

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

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.