Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLLiteral


@SuppressWarnings("javadoc")
public class GetAxiomsIgnoringAnnotationsTestCase extends TestBase {

    @Test
    public void testGetAxiomsIgnoringAnnoations() {
        OWLLiteral annoLiteral = Literal("value");
        OWLAnnotationProperty annoProp = AnnotationProperty(iri("annoProp"));
        OWLAnnotation anno = df.getOWLAnnotation(annoProp, annoLiteral);
        OWLAxiom axiom = df.getOWLSubClassOfAxiom(Class(iri("A")),
                Class(iri("B")), singleton(anno));
        OWLOntology ont = getOWLOntology("testont");
View Full Code Here


        OWLAnnotationProperty prop = AnnotationProperty(OWLRDFVocabulary.RDFS_LABEL
                .getIRI());
        addAxiom(ont, Declaration(prop));
        Set<OWLAnnotation> annotations = new HashSet<>();
        for (int i = 0; i < 2; i++) {
            OWLLiteral lit = Literal("Annotation " + (i + 1));
            annotations.add(df.getOWLAnnotation(RDFSLabel(), lit));
        }
        OWLEntity entity = NamedIndividual(IRI("http://www.another.com/ont#peter"));
        addAxiom(ont, Declaration(entity));
        OWLAnnotationAssertionAxiom ax = df.getOWLAnnotationAssertionAxiom(
View Full Code Here

    @Override
    protected OWLOntology createOntology() {
        OWLClass cls = Class(IRI("http://owlapi.sourceforge.net/ontology#A"));
        OWLAnnotationProperty prop = AnnotationProperty(IRI("http://owlapi.sourceforge.net/ontology#prop"));
        OWLLiteral lit1 = Literal(getEscape());
        OWLLiteral lit2 = Literal("Start" + getEscape());
        OWLLiteral lit3 = Literal(getEscape() + "End");
        OWLLiteral lit4 = Literal("Start" + getEscape() + "End");
        OWLAnnotationAssertionAxiom ax1 = AnnotationAssertion(prop,
                cls.getIRI(), lit1);
        OWLAnnotationAssertionAxiom ax2 = AnnotationAssertion(prop,
                cls.getIRI(), lit2);
        OWLAnnotationAssertionAxiom ax3 = AnnotationAssertion(prop,
View Full Code Here

        OWLClass cheesy = Class(IRI(NS + "#CheeseyPizza"));
        OWLClass cheese = Class(IRI(NS + "#CheeseTopping"));
        OWLObjectProperty hasTopping = df.getOWLObjectProperty(IRI(NS
                + "#hasTopping"));
        OWLAnonymousIndividual i = df.getOWLAnonymousIndividual();
        OWLLiteral lit = df.getOWLLiteral(ANONYMOUS_INDIVIDUAL_ANNOTATION);
        OWLAxiom annAss = df.getOWLAnnotationAssertionAxiom(df.getRDFSLabel(),
                i, lit);
        m.addAxiom(ontology, annAss);
        OWLAxiom classAss = df.getOWLClassAssertionAxiom(cheesy, i);
        m.addAxiom(ontology, classAss);
View Full Code Here

    @Test
    public void testFloatZeros() {
        // +0 and -0 are not equal
        OWLDatatype type = df.getFloatOWLDatatype();
        OWLLiteral lit1 = df.getOWLLiteral("0.0", type);
        OWLLiteral lit2 = df.getOWLLiteral("-0.0", type);
        assertFalse(lit1.equals(lit2));
    }
View Full Code Here

    @Test
    public void testIntegerRange() {
        String expected = "2147483648";
        OWLDatatype type = df.getIntegerOWLDatatype();
        OWLLiteral lit = df.getOWLLiteral(expected, type);
        assertEquals(expected, lit.getLiteral());
    }
View Full Code Here

            for (IRI i : predicates) {
                assert i != null;
                if (consumer.isAnnotationProperty(i)) {
                    OWLAnnotationProperty p = consumer.getDataFactory()
                            .getOWLAnnotationProperty(i);
                    OWLLiteral literal = consumer.getLiteralObject(
                            remappedNode, i, true);
                    while (literal != null) {
                        annotations.add(consumer.getDataFactory()
                                .getOWLAnnotation(p, literal));
                        literal = consumer.getLiteralObject(remappedNode, i,
View Full Code Here

    }

    @Test
    public void testGetDataPropertyValues() {
        OWLDatatype type = df.getIntegerOWLDatatype();
        OWLLiteral lit1 = df.getOWLLiteral("01", type);
        OWLLiteral lit2 = df.getOWLLiteral("1", type);
        assertFalse(lit1.equals(lit2));
    }
View Full Code Here

    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        Set<OWLAxiom> axioms = new HashSet<>();
        OWLNamedIndividual ind = NamedIndividual(iri("i"));
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLLiteral literal = Literal("Test \"literal\"");
        axioms.add(DataPropertyAssertion(prop, ind, literal));
        OWLLiteral literal2 = Literal("Test 'literal'");
        axioms.add(DataPropertyAssertion(prop, ind, literal2));
        OWLLiteral literal3 = Literal("Test \"\"\"literal\"\"\"");
        axioms.add(DataPropertyAssertion(prop, ind, literal3));
        return axioms;
    }
View Full Code Here

    @Nonnull
    @Override
    protected Set<? extends OWLAxiom> createAxioms() {
        OWLAnnotationProperty ap = AnnotationProperty(IRI("http://annotation.com/annos#prop"));
        OWLLiteral val = Literal("Test", "");
        OWLAnnotation anno = Annotation(ap, val);
        Set<OWLAnnotation> annos = new HashSet<>();
        annos.add(anno);
        OWLClassExpression ce = Class(iri("A"));
        OWLObjectProperty p1 = ObjectProperty(iri("p1"));
View Full Code Here

TOP

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

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.