Package org.semanticweb.owlapi.formats

Examples of org.semanticweb.owlapi.formats.ManchesterSyntaxDocumentFormat


        for (OntologyAxiomPair pair : axioms) {
            changes.add(new AddAxiom(ont, pair.getAxiom()));
        }
        changes.add(new SetOntologyID(ont, ontologyID));
        ont.getOWLOntologyManager().applyChanges(changes);
        ManchesterSyntaxDocumentFormat format = new ManchesterSyntaxDocumentFormat();
        format.copyPrefixesFrom(pm);
        return format;
    }
View Full Code Here


    }

    @Test
    public void shouldRoundTrip() throws Exception {
        OWLOntology ontology = buildOntology();
        PrefixDocumentFormat format = new ManchesterSyntaxDocumentFormat();
        format.setPrefix("piz", NS + '#');
        OWLOntology roundtripped = roundTrip(ontology, format);
        assertEquals(ontology.getLogicalAxioms(),
                roundtripped.getLogicalAxioms());
    }
View Full Code Here

    }

    @Test
    public void shouldPreserveOrderingInManchesterSyntaxRoundTrip()
            throws OWLOntologyCreationException, OWLOntologyStorageException {
        roundTrip(new ManchesterSyntaxDocumentFormat());
    }
View Full Code Here

                df.getOWLDatatype(XSDVocabulary.STRING.getIRI()), y));
        Set<SWRLAtom> head = new TreeSet<>();
        head.add(df.getSWRLClassAtom(a, x));
        SWRLRule rule = df.getSWRLRule(body, head);
        ontology.getOWLOntologyManager().addAxiom(ontology, rule);
        ontology = roundTrip(ontology, new ManchesterSyntaxDocumentFormat());
        OWLOntology onto2 = roundTrip(ontology,
                new ManchesterSyntaxDocumentFormat());
        equal(ontology, onto2);
    }
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

        OWLOntology ontology = m.createOntology();
        saveOntology(ontology, new RDFXMLDocumentFormat());
        saveOntology(ontology, new OWLXMLDocumentFormat());
        saveOntology(ontology, new TurtleDocumentFormat());
        saveOntology(ontology, new FunctionalSyntaxDocumentFormat());
        saveOntology(ontology, new ManchesterSyntaxDocumentFormat());
    }
View Full Code Here

        roundTripOntology(ont, new TurtleDocumentFormat());
    }

    @Test
    public void testManchesterOWLSyntax() throws Exception {
        roundTripOntology(ont, new ManchesterSyntaxDocumentFormat());
    }
View Full Code Here

        m.addAxiom(ontology, ClassAssertion(a, h));
        m.addAxiom(ontology, ObjectPropertyAssertion(q, h, i));
        OWLAnnotation annotation2 = df.getOWLAnnotation(df.getRDFSLabel(),
                Literal("Second", "en"));
        m.addAxiom(ontology, df.getOWLAnnotationAssertionAxiom(h, annotation2));
        roundTrip(ontology, new ManchesterSyntaxDocumentFormat());
    }
View Full Code Here

        OWLObjectSomeValuesFrom r = df.getOWLObjectSomeValuesFrom(prop,
                df.getOWLObjectUnionOf(led, crt));
        OWLSubClassOfAxiom axiom = df.getOWLSubClassOfAxiom(display, r);
        m.addAxiom(ontology, axiom);
        StringDocumentTarget target = saveOntology(ontology,
                new ManchesterSyntaxDocumentFormat());
        assertFalse(target.toString().contains(
                "((<urn:test#crt> or <urn:test#led>))"));
    }
View Full Code Here

        o.getOWLOntologyManager().addAxiom(o, Declaration(a));
        o.getOWLOntologyManager().addAxiom(o, Declaration(b));
        o.getOWLOntologyManager().addAxiom(o, Declaration(c));
        o.getOWLOntologyManager().addAxiom(o, Declaration(d));
        OWLOntology roundtripped = roundTrip(o,
                new ManchesterSyntaxDocumentFormat());
        assertEquals(o.getAxioms(), roundtripped.getAxioms());
    }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.formats.ManchesterSyntaxDocumentFormat

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.