Examples of TurtleDocumentFormat


Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

    @Parameters(name = "{0}")
    public static Collection<Object[]> data() {
        return Arrays.asList(new Object[][] {
                { new FunctionalSyntaxDocumentFormat() },
                { new OWLXMLDocumentFormat() }, { new RDFXMLDocumentFormat() },
                { new TurtleDocumentFormat() }, });
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

                parser = new TurtleParser(is, new ConsoleTripleHandler(),
                        documentSource.getDocumentIRI());
            }
            OWLRDFConsumerAdapter consumer = new OWLRDFConsumerAdapter(
                    ontology, configuration);
            TurtleDocumentFormat format = new TurtleDocumentFormat();
            consumer.setOntologyFormat(format);
            consumer.startModel(documentSource.getDocumentIRI());
            parser.setTripleHandler(consumer);
            parser.parseDocument();
            PrefixManager prefixManager = parser.getPrefixManager();
            for (String prefixName : prefixManager.getPrefixNames()) {
                format.setPrefix(prefixName,
                        prefixManager.getPrefix(prefixName));
            }
            return format;
        } catch (ParseException e) {
            throw new TurtleParserException(e);
View Full Code Here

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

    // 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

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

                + "  :prov [\n prov:gen :FMDomain ;\n prov:att :DM .\n ]\n ] .\n"
                + ":ManagementType rdf:type owl:Class .\n"
                + ":DM rdf:type owl:NamedIndividual , prov:Person .\n"
                + ":FMDomain rdf:type owl:NamedIndividual , prov:Activity ; prov:ass :DM .";
        OWLOntology ontology = loadOntologyFromString(input);
        OWLOntology o = roundTrip(ontology, new TurtleDocumentFormat());
        Set<OWLSubClassOfAxiom> axioms = o.getAxioms(AxiomType.SUBCLASS_OF);
        assertEquals(1, axioms.size());
        OWLAnnotation next = axioms.iterator().next().getAnnotations()
                .iterator().next();
        assertTrue(next.getValue() instanceof OWLAnonymousIndividual);
View Full Code Here

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

        m.addAxiom(
                ontology,
                df.getOWLSubClassOfAxiom(
                        df.getOWLClass(IRI.create(string + 't')),
                        df.getOWLClass(IRI.create(string + 'q'))));
        OWLOntology o = roundTrip(ontology, new TurtleDocumentFormat());
        equal(o, in);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

    }

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

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

    @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

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

    @Test
    public void testOutputStreamRemainsOpen() throws Exception {
        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

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

        // 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

Examples of org.semanticweb.owlapi.formats.TurtleDocumentFormat

        runTestOntologyContainsAxioms1(new FunctionalSyntaxDocumentFormat());
    }

    @Test
    public void testOntologyContainsAxiomsForTurtleSyntax1() throws Exception {
        TurtleDocumentFormat format = createTurtleOntologyFormat();
        runTestOntologyContainsAxioms1(format);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.