Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLOntology


    }

    @Test
    public void shouldParseFixedQuotesLiterals4()
            throws OWLOntologyCreationException {
        OWLOntology o = loadOntologyFromString(new StringDocumentSource(
                "<urn:test#s> <urn:test#p> \"\"\"\"\"\\\"\"\"\" .", iri, tf,
                null));
        for (OWLAnnotationAssertionAxiom ax : o.getAnnotationAssertionAxioms(s)) {
            assertEquals("\"\"\"", ((OWLLiteral) ax.getValue()).getLiteral());
        }
    }
View Full Code Here


    }

    @Test
    public void shouldParseFixedQuotesLiterals5()
            throws OWLOntologyCreationException {
        OWLOntology o = loadOntologyFromString(new StringDocumentSource(
                "<urn:test#s> <urn:test#p> \"\"\"\"\"\\u0061\"\"\" .", iri, tf,
                null));
        for (OWLAnnotationAssertionAxiom ax : o.getAnnotationAssertionAxioms(s)) {
            assertEquals("\"\"a", ((OWLLiteral) ax.getValue()).getLiteral());
        }
    }
View Full Code Here

public class NestedClassExpressionRoundTrippingTestCase extends
        AbstractRoundTrippingTestCase {

    @Override
    protected OWLOntology createOntology() {
        OWLOntology ont = getOWLOntology("OntA");
        OWLObjectProperty prop = ObjectProperty(iri("propP"));
        OWLClass clsA = Class(iri("A"));
        OWLClass clsB = Class(iri("B"));
        OWLClassExpression desc = ObjectSomeValuesFrom(prop,
                ObjectSomeValuesFrom(prop, clsB));
View Full Code Here

        String working = "@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .\n @prefix foaf:    <http://xmlns.com/foaf/0.1/> .\n foaf:fundedBy rdfs:isDefinedBy <http://xmlns.com/foaf/0.1/> .";
        OWLAxiom expected = AnnotationAssertion(df.getRDFSIsDefinedBy(),
                IRI("http://xmlns.com/foaf/0.1/fundedBy"),
                IRI("http://xmlns.com/foaf/0.1/"));
        // when
        OWLOntology o = loadOntologyFromString(working);
        // then
        assertTrue(o.getAxioms().contains(expected));
    }
View Full Code Here

                + "rdfs:label \"\"\"" + literal + "\"\"\"@en .";
        OWLAxiom expected = AnnotationAssertion(df.getRDFSLabel(),
                IRI("http://xmlns.com/foaf/0.1/fundedBy"),
                Literal(literal, "en"));
        // when
        OWLOntology o = loadOntologyFromString(working);
        // then
        assertEquals(expected, o.getAxioms().iterator().next());
    }
View Full Code Here

        String input = "@prefix f:    <urn:test/> . f:r f:p f: .";
        OWLAxiom expected = df.getOWLAnnotationAssertionAxiom(
                df.getOWLAnnotationProperty(IRI("urn:test/p")),
                IRI("urn:test/r"), IRI("urn:test/"));
        // when
        OWLOntology o = loadOntologyFromString(input);
        // then
        assertTrue(o.getAxioms().contains(expected));
    }
View Full Code Here

    @Test
    public void shouldResolveAgainstBase() throws OWLOntologyCreationException {
        // given
        String input = "@base <http://test.org/path#> .\n <a1> <b1> <c1> .";
        // when
        OWLOntology o = loadOntologyFromString(input);
        // then
        String axioms = o.getAxioms().toString();
        assertTrue(axioms.contains("http://test.org/a1"));
        assertTrue(axioms.contains("http://test.org/b1"));
        assertTrue(axioms.contains("http://test.org/c1"));
    }
View Full Code Here

    // test for 3543488
    @Test
    public void shouldRoundTripTurtleWithsharedBnodes() throws Exception {
        String input = "@prefix ex: <http://example.com/test> .\n ex:ex1 a ex:Something ; ex:prop1 _:a .\n _:a a ex:Something1 ; ex:prop2 _:b .\n _:b a ex:Something ; ex:prop3 _:a .";
        OWLOntology ontology = loadOntologyFromString(input);
        OWLOntology onto2 = roundTrip(ontology, new TurtleDocumentFormat());
        equal(ontology, onto2);
    }
View Full Code Here

    // test for 335
    @Test
    public void shouldParseScientificNotation()
            throws OWLOntologyCreationException {
        String input = "<http://dbpedia.org/resource/South_Africa> <http://dbpedia.org/ontology/areaTotal> 1e+07 .";
        OWLOntology ontology = loadOntologyFromString(input);
        OWLAnnotationProperty p = AnnotationProperty(IRI("http://dbpedia.org/ontology/areaTotal"));
        assertTrue(ontology.getAnnotationPropertiesInSignature(EXCLUDED)
                .contains(p));
        IRI i = IRI("http://dbpedia.org/resource/South_Africa");
        assertTrue(ontology.containsAxiom(AnnotationAssertion(p, i,
                Literal("1.0E7", OWL2Datatype.XSD_DOUBLE))));
    }
View Full Code Here

                + "<owl:AllDifferent><owl:members rdf:parseType=\"Collection\">"
                + "<rdf:Description rdf:about=\"Peter\" />"
                + "<rdf:Description rdf:about=\"Peter_Griffin\" />"
                + "<rdf:Description rdf:about=\"Petre\" />"
                + "</owl:members></owl:AllDifferent></rdf:RDF>";
        OWLOntology o1 = loadOntologyFromString(onto1);
        OWLOntology o2 = loadOntologyFromString(onto2);
        assertEquals(o2.getLogicalAxiomCount(), o1.getLogicalAxiomCount());
    }
View Full Code Here

TOP

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

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.