Package org.semanticweb.owlapi.model

Examples of org.semanticweb.owlapi.model.OWLDocumentFormat


    }

    @Override
    public void saveOntology(OWLOntology ontology, IRI documentIRI)
            throws OWLOntologyStorageException {
        OWLDocumentFormat format = getOntologyFormat(ontology);
        saveOntology(ontology, format, documentIRI);
    }
View Full Code Here


    @Test
    public void testAxioms() throws OWLOntologyCreationException {
        OWLOntology ont = createOntology();
        assertTrue(ont.getAxioms(AxiomType.SUBCLASS_OF).isEmpty());
        OWLDocumentFormat format = ont.getOWLOntologyManager()
                .getOntologyFormat(ont);
        assertTrue(format instanceof RDFXMLDocumentFormat);
        RDFXMLDocumentFormat rdfxmlFormat = (RDFXMLDocumentFormat) format;
        Set<RDFTriple> triples = rdfxmlFormat.getOntologyLoaderMetaData()
                .getUnparsedTriples();
View Full Code Here

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsTurtle()
            throws Exception {
        OWLOntology ontology = prepareOntology();
        OWLDocumentFormat f = new TurtleDocumentFormat();
        OWLOntology ontology2 = loadOntologyFromString(saveOntology(ontology, f));
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.SWRL_RULE)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
        }
View Full Code Here

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsFunctional()
            throws Exception {
        OWLOntology ontology = prepareOntology();
        OWLDocumentFormat f = new FunctionalSyntaxDocumentFormat();
        OWLOntology ontology2 = loadOntologyFromString(saveOntology(ontology, f));
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.SWRL_RULE)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
        }
View Full Code Here

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsRDFXML()
            throws Exception {
        OWLOntology ontology = prepareOntology();
        OWLDocumentFormat f = new RDFXMLDocumentFormat();
        OWLOntology ontology2 = loadOntologyFromString(saveOntology(ontology, f));
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.SWRL_RULE)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
        }
View Full Code Here

    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsDatatypeRDFXML()
            throws Exception {
        OWLOntology ontology = prepareOntology1();
        OWLDocumentFormat f = new RDFXMLDocumentFormat();
        OWLOntology ontology2 = loadOntologyFromString(saveOntology(ontology, f));
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.DATATYPE_DEFINITION)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
        }
View Full Code Here

    @Ignore("man syntax does not like annotations")
    @Test
    public void shouldDoCompleteRoundtripWithAnnotationsMan() throws Exception {
        OWLOntology ontology = prepareOntology();
        OWLDocumentFormat f = new ManchesterSyntaxDocumentFormat();
        StringDocumentTarget save = saveOntology(ontology, f);
        OWLOntology ontology2 = loadOntologyFromString(save);
        equal(ontology, ontology2);
        for (OWLAxiom r : ontology2.getAxioms(AxiomType.SWRL_RULE)) {
            assertFalse(r.getAnnotations(df.getRDFSLabel()).isEmpty());
View Full Code Here

                man.makeLoadImportRequest(importsDeclaration,
                        consumer.getConfiguration());
                OWLOntology importedOntology = man
                        .getImportedOntology(importsDeclaration);
                if (importedOntology != null) {
                    OWLDocumentFormat importedOntologyFormat = man
                            .getOntologyFormat(importedOntology);
                    if (importedOntologyFormat instanceof AbstractRDFPrefixDocumentFormat
                            && importedOntology.isAnonymous()) {
                        if (consumer.getConfiguration()
                                .getMissingOntologyHeaderStrategy() == INCLUDE_GRAPH) {
View Full Code Here

        InputStream in = getClass().getResourceAsStream(CIDOC_FILE);
        assertNotNull("can't find CIDOC_FILE", in);
        cidocOntology = manager.loadOntologyFromOntologyDocument(
                new StreamDocumentSource(in), config);
        assertNotNull(cidocOntology);
        OWLDocumentFormat format = manager.getOntologyFormat(cidocOntology);
        assertNotNull(format);
        assertTrue(format.isPrefixOWLOntologyFormat());
        prefixOWLOntologyFormat = format.asPrefixOWLOntologyFormat();
        prefixOWLOntologyFormat.setDefaultPrefix(CIDOC_PREFIX);
    }
View Full Code Here

        // we iterate over objects in the same order for the same set of axioms!
        axioms1 = new AnonymousIndividualsNormaliser(df)
                .getNormalisedAxioms(ont1.getAxioms());
        axioms2 = new AnonymousIndividualsNormaliser(df)
                .getNormalisedAxioms(ont2.getAxioms());
        OWLDocumentFormat ontologyFormat = ont2.getOWLOntologyManager()
                .getOntologyFormat(ont2);
        applyEquivalentsRoundtrip(axioms1, axioms2, ontologyFormat);
        if (ontologyFormat instanceof ManchesterSyntaxDocumentFormat) {
            // drop GCIs from the expected axioms, they won't be there
            Iterator<OWLAxiom> it = axioms1.iterator();
View Full Code Here

TOP

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

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.