Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDatatype


     *         datatype or a built-in infinite datatype; {@code false} otherwise
     */
    protected static boolean isTopOrBuiltInInfiniteDatatype(
            @Nonnull OWLDataRange dataRange) {
        if (dataRange.isDatatype()) {
            OWLDatatype dataType = dataRange.asOWLDatatype();
            return dataType.isTopDatatype() || dataType.isBuiltIn()
                    && !dataType.getBuiltInDatatype().isFinite();
        } else {
            return false;
        }
    }
View Full Code Here


        if (onDatatypeObject != null) {
            if (isAnonymousNode(onDatatypeObject)) {
                // TODO LOG ERROR
                return dataFactory.getOWLDatatype(mainNode);
            }
            OWLDatatype restrictedDataRange = (OWLDatatype) translateDataRange(onDatatypeObject);
            // Now we have to get the restricted facets - there is some legacy
            // translation code here... the current
            // spec uses a list of triples where the predicate is a facet and
            // the object a literal that is restricted
            // by the facet. Originally, there just used to be multiple
View Full Code Here

            OWLLiteral literal = consumer.getLiteralObject(mainNode, predicate,
                    false);
            if (literal == null) {
                return false;
            }
            OWLDatatype datatype = literal.getDatatype();
            OWL2Datatype nni = OWL2Datatype.XSD_NON_NEGATIVE_INTEGER;
            return datatype.getIRI().equals(nni.getIRI())
                    && nni.isInLexicalSpace(literal.getLiteral());
        }
View Full Code Here

    @Test
    public void testDataPropertyRangeAxiomAccessors() {
        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty propP = DataProperty(iri("p"));
        OWLDatatype dt = Datatype(iri("dt"));
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDataPropertyRangeAxiom ax = DataPropertyRange(propP, dt);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getDataPropertyRangeAxioms(propP).contains(ax));
View Full Code Here

    }
    protected void axiomatizeBottomObjectProperty(OWLAxioms axioms) {
        axioms.m_conceptInclusions.add(new OWLClassExpression[] { m_factory.getOWLObjectAllValuesFrom(m_bottomObjectProperty,m_factory.getOWLNothing()) });
    }
    protected void axiomatizeTopDataProperty(OWLAxioms axioms) {
        OWLDatatype anonymousConstantsDatatype=m_factory.getOWLDatatype(IRI.create("internal:anonymous-constants"));
        OWLTypedLiteral newConstant=m_factory.getOWLTypedLiteral("internal:constant",anonymousConstantsDatatype);
        OWLDataOneOf oneOfNewConstant=m_factory.getOWLDataOneOf(newConstant);
        OWLDataSomeValuesFrom hasTopNewConstant=m_factory.getOWLDataSomeValuesFrom(m_topDataProperty,oneOfNewConstant);
        axioms.m_conceptInclusions.add(new OWLClassExpression[] { hasTopNewConstant });
    }
View Full Code Here

        }
        public void visit(SWRLDataRangeAtom atom) {
            if (!(atom.getPredicate() instanceof OWLDatatype)) {
                throw new IllegalStateException("Internal error: SWRL rule data range atoms should be normalized to contain only datatypes, but this atom has a (complex) data range: "+atom.getPredicate());
            }
            OWLDatatype dt=atom.getPredicate().asOWLDatatype();
            atom.getArgument().accept(this);
            m_lastAtom=Atom.create(AtomicConcept.create(dt.getIRI().toString()),m_lastVariable);
        }
View Full Code Here

                Map<AtomicRole,AtomicConcept> conceptsForRoles=new HashMap<AtomicRole,AtomicConcept>();
                final Map<AtomicConcept,AtomicRole> rolesForConcepts=new HashMap<AtomicConcept,AtomicRole>();
                // 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))
View Full Code Here

        if (reasoner.m_dlOntology.hasDatatypes()) {
            OWLDataFactory factory=reasoner.getDataFactory();
            OWLIndividual freshIndividual=factory.getOWLAnonymousIndividual("fresh-individual");
            OWLDataProperty freshDataProperty=factory.getOWLDataProperty(IRI.create("fresh-data-property"));
            OWLDataRange dataRange=axiom.getDataRange();
            OWLDatatype dt=axiom.getDatatype();
            OWLDataIntersectionOf dr1=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dataRange),dt);
            OWLDataIntersectionOf dr2=factory.getOWLDataIntersectionOf(factory.getOWLDataComplementOf(dt),dataRange);
            OWLDataUnionOf union=factory.getOWLDataUnionOf(dr1,dr2);
            OWLClassExpression c=factory.getOWLDataSomeValuesFrom(freshDataProperty,union);
            OWLClassAssertionAxiom ax=factory.getOWLClassAssertionAxiom(c,freshIndividual);
View Full Code Here

            axioms.add(factory.getOWLObjectPropertyAssertionAxiom(p,individualA,tmp));
            axioms.add(factory.getOWLObjectPropertyAssertionAxiom(p,individualB,tmp));
            i++;
        }
        for (OWLDataPropertyExpression p : axiom.getDataPropertyExpressions()) {
            OWLDatatype anonymousConstantsDatatype=factory.getOWLDatatype(IRI.create("internal:anonymous-constants"));
            OWLTypedLiteral constant=factory.getOWLTypedLiteral("internal:constant-"+i,anonymousConstantsDatatype);
            axioms.add(factory.getOWLDataPropertyAssertionAxiom(p,individualA,constant));
            axioms.add(factory.getOWLDataPropertyAssertionAxiom(p,individualB,constant));
            i++;
        }
View Full Code Here

    }


    public void handleTriple(IRI subject, IRI predicate, IRI object) throws UnloadableImportException {
        if (!getConsumer().isAnonymousNode(subject)) {
            OWLDatatype dt = getDataFactory().getOWLDatatype(subject);
            if (!dt.isBuiltIn()) {
                addAxiom(getDataFactory().getOWLDeclarationAxiom(dt));
            }
        }
        getConsumer().addOWLDatatype(subject);
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.model.OWLDatatype

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.