Package org.semanticweb.owlapi.formats

Examples of org.semanticweb.owlapi.formats.ManchesterSyntaxDocumentFormat


                + "DataProperty: <http://www.owl-ontologies.com/Ontology1307394066.owl#hasDate>\n Range: \n xsd:dateTime\n"
                + "Class: <http://www.owl-ontologies.com/Ontology1307394066.owl#Person>\n"
                + "Individual: <http://www.owl-ontologies.com/Ontology1307394066.owl#p1>\n Types: \n <http://www.owl-ontologies.com/Ontology1307394066.owl#Person>\n"
                + "Rule: \n xsd:decimal(?<urn:swrl#x>), <http://www.owl-ontologies.com/Ontology1307394066.owl#hasAge>(?<urn:swrl#p>, ?<urn:swrl#x>) -> <http://www.owl-ontologies.com/Ontology1307394066.owl#Person>(?<urn:swrl#p>)";
        OWLOntology o = loadOntologyFromString(inputManSyntax);
        OWLOntology o1 = roundTrip(o, new ManchesterSyntaxDocumentFormat());
        assertEquals(o.getLogicalAxioms(), o1.getLogicalAxioms());
    }
View Full Code Here


                + "    Types: \n"
                + "        <http://www.owl-ontologies.com/Ontology1307394066.owl#Person>\n"
                + "Rule: \n"
                + "    xsd:decimal(?x), <http://www.owl-ontologies.com/Ontology1307394066.owl#hasAge>(?p, ?x) -> <http://www.owl-ontologies.com/Ontology1307394066.owl#Person>(?p)";
        OWLOntology o = loadOntologyFromString(inputManSyntax);
        OWLOntology o1 = roundTrip(o, new ManchesterSyntaxDocumentFormat());
        assertEquals(o.getLogicalAxioms(), o1.getLogicalAxioms());
    }
View Full Code Here

                + "Declaration(Class(<http://x.org/c>))\n"
                + "AnnotationAssertion(<http://x.org/p> <http://x.org/c> \"v1\")\n"
                + "AnnotationAssertion(<http://x.org/p> <http://x.org/c> \"orifice\")\n"
                + "AnnotationAssertion(Annotation(<http://x.org/p2> \"foo\") <http://x.org/p> <http://x.org/c> \"v1\"))";
        OWLOntology o = loadOntologyFromString(in);
        OWLOntology result = roundTrip(o, new ManchesterSyntaxDocumentFormat());
        for (OWLAxiom ax : o.getAxioms()) {
            assert ax != null;
            assertTrue(result.containsAxiom(ax));
        }
    }
View Full Code Here

        functionalFormat.asPrefixOWLOntologyFormat().setPrefix("example",
                "http://example.org/");
        OWLOntology loadOntology2 = roundTrip(ontology, functionalFormat);
        // won't reach here if functional syntax fails - comment it out and
        // uncomment this to test Manchester
        ManchesterSyntaxDocumentFormat manchesterFormat = new ManchesterSyntaxDocumentFormat();
        manchesterFormat.asPrefixOWLOntologyFormat().setPrefix("example",
                "http://example.org/");
        OWLOntology loadOntology3 = roundTrip(ontology, manchesterFormat);
        assertEquals(ontology, loadOntology);
        assertEquals(ontology, loadOntology2);
        assertEquals(ontology, loadOntology3);
View Full Code Here

    @Test
    public void shouldManchBeEquivalent() throws OWLOntologyCreationException {
        OWLOntology manch = loadOntologyFromString(MANCHESTER,
                IRI.create("urn:primer#manchester"),
                new ManchesterSyntaxDocumentFormat());
        assertTrue(profile.checkOntology(manch).getViolations().isEmpty());
        // XXX Manchester OWL Syntax does not support GCIs
        // the input adopts a trick to semantically get around this, by
        // asserting a new named class equivalent to the right hand side of the
        // GCI and subclass of the left hand side
View Full Code Here

    public OWLDocumentFormat parse(OWLOntologyDocumentSource documentSource,
            OWLOntology ontology, OWLOntologyLoaderConfiguration configuration)
            throws IOException {
        try {
            BufferedReader br = null;
            ManchesterSyntaxDocumentFormat format = new ManchesterSyntaxDocumentFormat();
            try {
                if (documentSource.isReaderAvailable()) {
                    br = new BufferedReader(documentSource.getReader());
                } else if (documentSource.isInputStreamAvailable()) {
                    br = new BufferedReader(new InputStreamReader(
View Full Code Here

        // OWLOntologyOutputTarget Note that we can write an ontology to a
        // stream in a similar way using the StreamOutputTarget class
        // OWLOntologyDocumentTarget documentTarget = new
        // SystemOutDocumentTarget();
        // Try another format - The Manchester OWL Syntax
        ManchesterSyntaxDocumentFormat manSyntaxFormat = new ManchesterSyntaxDocumentFormat();
        if (format.isPrefixOWLOntologyFormat()) {
            manSyntaxFormat
                    .copyPrefixesFrom(format.asPrefixOWLOntologyFormat());
        }
        manager.saveOntology(pizzaOntology, manSyntaxFormat,
                new StreamDocumentTarget(new ByteArrayOutputStream()));
    }
View Full Code Here

        // System.out.println("OWL/XML: ");
        manager.saveOntology(ont, new OWLXMLDocumentFormat(),
                new StringDocumentTarget());
        // Manchester Syntax
        // System.out.println("Manchester syntax: ");
        manager.saveOntology(ont, new ManchesterSyntaxDocumentFormat(),
                new StringDocumentTarget());
        // Turtle
        // System.out.println("Turtle: ");
        manager.saveOntology(ont, new TurtleDocumentFormat(),
                new StringDocumentTarget());
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.