Package org.semanticweb.HermiT.model

Examples of org.semanticweb.HermiT.model.DatatypeRestriction


        Object[] tupleBuffer=m_assertionsDeltaOldRetrieval.getTupleBuffer();
        m_assertionsDeltaOldRetrieval.open();
        while (!m_extensionManager.containsClash() && !m_assertionsDeltaOldRetrieval.afterLast()) {
            Object dataRangeObject=tupleBuffer[0];
            if (dataRangeObject instanceof DatatypeRestriction) {
                DatatypeRestriction datatypeRestriction=(DatatypeRestriction)dataRangeObject;
                if (m_unknownDatatypeRestrictionsPermanent.contains(datatypeRestriction) || (m_unknownDatatypeRestrictionsAdditional!=null && m_unknownDatatypeRestrictionsAdditional.contains(datatypeRestriction)))
                    generateInequalitiesFor(datatypeRestriction,(Node)tupleBuffer[1],m_assertionsDeltaOldRetrieval.getDependencySet(),NegationDataRange.create(datatypeRestriction));
            }
            else if (dataRangeObject instanceof NegationDataRange) {
                NegationDataRange negationDataRange=(NegationDataRange)dataRangeObject;
                DataRange negatedDataRange=negationDataRange.getNegatedDataRange();
                if (negatedDataRange instanceof DatatypeRestriction) {
                    DatatypeRestriction datatypeRestriction=(DatatypeRestriction)negatedDataRange;
                    if (m_unknownDatatypeRestrictionsPermanent.contains(datatypeRestriction) || (m_unknownDatatypeRestrictionsAdditional!=null && m_unknownDatatypeRestrictionsAdditional.contains(datatypeRestriction)))
                        generateInequalitiesFor(negationDataRange,(Node)tupleBuffer[1],m_assertionsDeltaOldRetrieval.getDependencySet(),datatypeRestriction);
                }
            }
            m_assertionsDeltaOldRetrieval.next();
View Full Code Here


        }
        return variable;
    }
    protected void addDataRange(DVariable variable,DataRange dataRange) {
        if (dataRange instanceof DatatypeRestriction) {
            DatatypeRestriction datatypeRestriction=(DatatypeRestriction)dataRange;
            if (!m_unknownDatatypeRestrictionsPermanent.contains(datatypeRestriction) && (m_unknownDatatypeRestrictionsAdditional==null || !m_unknownDatatypeRestrictionsAdditional.contains(datatypeRestriction))) {
                variable.m_positiveDatatypeRestrictions.add(datatypeRestriction);
                if (variable.m_mostSpecificRestriction==null)
                    variable.m_mostSpecificRestriction=datatypeRestriction;
                else if (DatatypeRegistry.isDisjointWith(variable.m_mostSpecificRestriction.getDatatypeURI(),datatypeRestriction.getDatatypeURI())) {
                    m_unionDependencySet.clearConstituents();
                    m_unionDependencySet.addConstituent(m_extensionManager.getAssertionDependencySet(variable.m_mostSpecificRestriction,variable.m_node));
                    m_unionDependencySet.addConstituent(m_extensionManager.getAssertionDependencySet(datatypeRestriction,variable.m_node));
                    Object[] tuple1;
                    Object[] tuple2;
                    if (m_tableauMonitor!=null) {
                        tuple1=new Object[] { variable.m_mostSpecificRestriction,variable.m_node };
                        tuple2=new Object[] { datatypeRestriction,variable.m_node };
                        m_tableauMonitor.clashDetectionStarted(tuple1,tuple2);
                    }
                    m_extensionManager.setClash(m_unionDependencySet);
                    if (m_tableauMonitor!=null) {
                        tuple1=new Object[] { variable.m_mostSpecificRestriction,variable.m_node };
                        tuple2=new Object[] { datatypeRestriction,variable.m_node };
                        m_tableauMonitor.clashDetectionFinished(tuple1,tuple2);
                    }
                }
                else if (DatatypeRegistry.isSubsetOf(datatypeRestriction.getDatatypeURI(),variable.m_mostSpecificRestriction.getDatatypeURI()))
                    variable.m_mostSpecificRestriction=datatypeRestriction;
            }
        }
        else if (dataRange instanceof ConstantEnumeration)
            variable.m_positiveConstantEnumerations.add((ConstantEnumeration)dataRange);
        else if (dataRange instanceof NegationDataRange) {
            DataRange negatedDataRange=((NegationDataRange)dataRange).getNegatedDataRange();
            if (negatedDataRange instanceof DatatypeRestriction) {
                DatatypeRestriction datatypeRestriction=(DatatypeRestriction)negatedDataRange;
                if (!m_unknownDatatypeRestrictionsPermanent.contains(datatypeRestriction) && (m_unknownDatatypeRestrictionsAdditional==null || !m_unknownDatatypeRestrictionsAdditional.contains(datatypeRestriction)))
                    variable.m_negativeDatatypeRestrictions.add(datatypeRestriction);
            }
            else if (negatedDataRange instanceof ConstantEnumeration) {
                ConstantEnumeration negatedConstantEnumeration=(ConstantEnumeration)negatedDataRange;
View Full Code Here

            }
        }
        variable.m_forbiddenDataValues.clear();
        List<DatatypeRestriction> positiveDatatypeRestrictions=variable.m_positiveDatatypeRestrictions;
        for (int index=positiveDatatypeRestrictions.size()-1;!explicitDataValues.isEmpty() && index>=0;--index) {
            DatatypeRestriction positiveDatatypeRestriction=positiveDatatypeRestrictions.get(index);
            ValueSpaceSubset valueSpaceSubset=DatatypeRegistry.createValueSpaceSubset(positiveDatatypeRestriction);
            eliminateDataValuesUsingValueSpaceSubset(valueSpaceSubset,explicitDataValues,false);
        }
        List<DatatypeRestriction> negativeDatatypeRestrictions=variable.m_negativeDatatypeRestrictions;
        for (int index=negativeDatatypeRestrictions.size()-1;!explicitDataValues.isEmpty() && index>=0;--index) {
            DatatypeRestriction negativeDatatypeRestriction=negativeDatatypeRestrictions.get(index);
            ValueSpaceSubset valueSpaceSubset=DatatypeRegistry.createValueSpaceSubset(negativeDatatypeRestriction);
            eliminateDataValuesUsingValueSpaceSubset(valueSpaceSubset,explicitDataValues,true);
        }
        if (explicitDataValues.isEmpty())
            setClashFor(variable);
View Full Code Here

    protected void normalizeAsValueSpaceSubset(DVariable variable) {
        String mostSpecificDatatypeURI=variable.m_mostSpecificRestriction.getDatatypeURI();
        variable.m_valueSpaceSubset=DatatypeRegistry.createValueSpaceSubset(variable.m_mostSpecificRestriction);
        List<DatatypeRestriction> positiveDatatypeRestrictions=variable.m_positiveDatatypeRestrictions;
        for (int index=positiveDatatypeRestrictions.size()-1;index>=0;--index) {
            DatatypeRestriction datatypeRestriction=positiveDatatypeRestrictions.get(index);
            if (datatypeRestriction!=variable.m_mostSpecificRestriction)
                variable.m_valueSpaceSubset=DatatypeRegistry.conjoinWithDR(variable.m_valueSpaceSubset,datatypeRestriction);
        }
        List<DatatypeRestriction> negativeDatatypeRestrictions=variable.m_negativeDatatypeRestrictions;
        for (int index=negativeDatatypeRestrictions.size()-1;index>=0;--index) {
            DatatypeRestriction datatypeRestriction=negativeDatatypeRestrictions.get(index);
            String datatypeRestrictionDatatypeURI=datatypeRestriction.getDatatypeURI();
            if (!DatatypeRegistry.isDisjointWith(mostSpecificDatatypeURI,datatypeRestrictionDatatypeURI))
                variable.m_valueSpaceSubset=DatatypeRegistry.conjoinWithDRNegation(variable.m_valueSpaceSubset,datatypeRestriction);
        }
        if (!variable.m_valueSpaceSubset.hasCardinalityAtLeast(1)) {
            variable.m_forbiddenDataValues.clear();
View Full Code Here

            String datatypeURI=object.getIRI().toString();
            if (DatatypeRestriction.RDFS_LITERAL.getDatatypeURI().equals(datatypeURI))
                return DatatypeRestriction.RDFS_LITERAL;
            if (datatypeURI.startsWith("internal:defdata#") || m_definedDatatypeIRIs.contains(object.getIRI().toString()))
                return AtomicConcept.create(datatypeURI);
            DatatypeRestriction datatype=DatatypeRestriction.create(datatypeURI,DatatypeRestriction.NO_FACET_URIs,DatatypeRestriction.NO_FACET_VALUES);
            if (datatypeURI.startsWith("internal:unknown-datatype#"))
                m_allUnknownDatatypeRestrictions.add(datatype);
            else {
                try {
                    DatatypeRegistry.validateDatatypeRestriction(datatype);
View Full Code Here

            for (OWLFacetRestriction facet : object.getFacetRestrictions()) {
                facetURIs[index]=facet.getFacet().getIRI().toURI().toString();
                facetValues[index]=(Constant)facet.getFacetValue().accept(this);
                index++;
            }
            DatatypeRestriction datatype=DatatypeRestriction.create(datatypeURI,facetURIs,facetValues);
            DatatypeRegistry.validateDatatypeRestriction(datatype);
            return datatype;
        }
View Full Code Here

TOP

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

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.