Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDatatype


    @Test
    public void testCorrectAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLClass clsA = Class(iri("A"));
        OWLDatatype dt = Datatype(iri("B"));
        OWLDataProperty propP = DataProperty(iri("p"));
        axioms.add(SubClassOf(clsA, DataAllValuesFrom(propP, dt)));
        axioms.add(Declaration(dt));
        axioms.add(Declaration(propP));
        assertEquals(getOnt().getAxioms(), axioms);
View Full Code Here


    }

    @Test
    public void isString() {
        assertFalse(plainLiteral.isString());
        OWLDatatype string = OWL2Datatype.XSD_STRING.getDatatype(df);
        assertTrue(string.isString());
    }
View Full Code Here

    }

    @Test
    public void isInteger() {
        assertFalse(plainLiteral.isInteger());
        OWLDatatype integer = OWL2Datatype.XSD_INTEGER.getDatatype(df);
        assertTrue(integer.isInteger());
    }
View Full Code Here

    }

    @Test
    public void isFloat() {
        assertFalse(plainLiteral.isFloat());
        OWLDatatype floatDatatype = OWL2Datatype.XSD_FLOAT.getDatatype(df);
        assertTrue(floatDatatype.isFloat());
    }
View Full Code Here

    }

    @Test
    public void isDouble() {
        assertFalse(plainLiteral.isDouble());
        OWLDatatype doubleDatatype = OWL2Datatype.XSD_DOUBLE.getDatatype(df);
        assertTrue(doubleDatatype.isDouble());
    }
View Full Code Here

    }

    @Test
    public void isBoolean() {
        assertFalse(plainLiteral.isBoolean());
        OWLDatatype booleanDatatype = OWL2Datatype.XSD_BOOLEAN.getDatatype(df);
        assertTrue(booleanDatatype.isBoolean());
    }
View Full Code Here

    }

    @Test
    public void isRDFPlainLiteral() {
        assertTrue(plainLiteral.isRDFPlainLiteral());
        OWLDatatype stringDatatype = OWL2Datatype.XSD_STRING.getDatatype(df);
        assertFalse(stringDatatype.isRDFPlainLiteral());
    }
View Full Code Here

        assertEquals(plainLiteral, plainLiteral.asOWLDatatype());
    }

    @Test
    public void isTopDatatype() {
        OWLDatatype rdfsLiteralDatatype = OWL2Datatype.RDFS_LITERAL
                .getDatatype(df);
        assertTrue(rdfsLiteralDatatype.isTopDatatype());
        assertFalse(plainLiteral.isTopDatatype());
    }
View Full Code Here

    @Test
    public void contains() {
        IRI iri = OWL2Datatype.XSD_BYTE.getIRI();
        Set<OWLDatatype> datatypes = new HashSet<>();
        OWLDatatypeImpl dtImpl = new OWLDatatypeImpl(iri);
        OWLDatatype dt2Impl = OWL2Datatype.XSD_BYTE.getDatatype(df);
        assertEquals(dtImpl, dt2Impl);
        datatypes.add(dt2Impl);
        assertTrue(datatypes.contains(dtImpl));
        assertEquals(dt2Impl.hashCode(), dtImpl.hashCode());
    }
View Full Code Here

        }

        @Override
        public void handleTriple(IRI subject, IRI predicate, IRI object) {
            if (!consumer.isAnonymousNode(subject)) {
                OWLDatatype dt = df.getOWLDatatype(subject);
                Set<OWLAnnotation> annos = consumer.getPendingAnnotations();
                addAxiom(df.getOWLDeclarationAxiom(dt, annos));
            }
            consumer.addDataRange(subject, true);
        }
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.