Examples of RDFXMLDocumentFormat


Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

    public OWLDocumentFormat parse(OWLOntologyDocumentSource documentSource,
            OWLOntology ontology, OWLOntologyLoaderConfiguration configuration)
            throws IOException {
        InputSource is = null;
        try {
            final RDFXMLDocumentFormat format = new RDFXMLDocumentFormat();
            RDFParser parser = new RDFParser() {

                @Override
                public void startPrefixMapping(String prefix, String uri)
                        throws SAXException {
                    assert prefix != null;
                    assert uri != null;
                    super.startPrefixMapping(prefix, uri);
                    format.setPrefix(prefix, uri);
                }

                @Override
                public void startElement(String uri, String localName,
                        String qName, Attributes attributes)
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

    protected OWLOntology convertOBOFile(String fn) {
        OWLOntology ontology = convert(parseOBOFile(fn));
        StringDocumentTarget target = new StringDocumentTarget();
        try {
            ontology.getOWLOntologyManager().saveOntology(ontology,
                    new RDFXMLDocumentFormat(), target);
            return OWLManager.createOWLOntologyManager()
                    .loadOntologyFromOntologyDocument(
                            new StringDocumentSource(target));
        } catch (OWLException e) {
            throw new OWLRuntimeException(e);
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

                }
            }
        }
        assertTrue(okDeprecated);
        // CONVERT TO OWL FILE
        writeOWL(ontology, new RDFXMLDocumentFormat());
        // CONVERT BACK TO OBO
        OBODoc obodoc = convert(ontology);
        Frame tf = obodoc.getTermFrame("XX:0000034");
        Clause c = tf.getClause(OboFormatTag.TAG_IS_OBSELETE);
        Object v = c.getValue();
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

                + "    >true</swrla:isRuleEnabled>\n"
                + "    <rdfs:comment rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\"\n"
                + "    >:i62, :i61</rdfs:comment>\n" + "  </swrl:Imp>\n"
                + "</rdf:RDF>";
        OWLOntology ontology = loadOntologyFromString(new StringDocumentSource(
                input, IRI.create("test"), new RDFXMLDocumentFormat(), null));
        assertTrue(ontology
                .getAxioms(AxiomType.SWRL_RULE)
                .toString()
                .contains(
                        "DLSafeRule(Annotation(<http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled> \"true\"^^xsd:boolean) Annotation(rdfs:comment \":i62, :i61\"^^xsd:string)  Body() Head(ObjectPropertyAtom(<#drives> <#i61> <#i62>)) )"));
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

                + "    </swrl:head>\n"
                + "    <swrla:isRuleEnabled rdf:datatype=\"http://www.w3.org/2001/XMLSchema#boolean\">true</swrla:isRuleEnabled>\n"
                + "    <rdfs:comment rdf:datatype=\"http://www.w3.org/2001/XMLSchema#string\">:i62, :i61</rdfs:comment>\n"
                + "  </swrl:Imp>\n" + "</rdf:RDF>";
        OWLOntology ontology = loadOntologyFromString(new StringDocumentSource(
                input, IRI.create("test"), new RDFXMLDocumentFormat(), null));
        assertTrue(ontology
                .getAxioms(AxiomType.SWRL_RULE)
                .toString()
                .contains(
                        "DLSafeRule(Annotation(<http://swrl.stanford.edu/ontologies/3.3/swrla.owl#isRuleEnabled> \"true\"^^xsd:boolean) Annotation(rdfs:comment \":i62, :i61\"^^xsd:string)  Body() Head(ObjectPropertyAtom(<#drives> <#i61> <#i62>)) )"));
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        String chinese = "Rx\u8655\u65b9";
        System.setProperty("file.encoding", "UTF-8");
        OWLOntology ontology = createOriginalOntology(ns, c, chinese);
        checkOntology(ontology, c, chinese);
        OWLOntology newOntology = roundTrip(ontology,
                new RDFXMLDocumentFormat());
        checkOntology(newOntology, c, chinese);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        m.addAxiom(ont, ax);
    }

    public void roundTripOntology(@Nonnull OWLOntology ont)
            throws OWLOntologyStorageException, OWLOntologyCreationException {
        roundTripOntology(ont, new RDFXMLDocumentFormat());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

                EXCLUDED, IGNORE_AXIOM_ANNOTATIONS));
    }

    @Test
    public void testOntologyContainsAxiomsForRDFXML1() throws Exception {
        RDFXMLDocumentFormat format = createRDFXMLFormat();
        runTestOntologyContainsAxioms1(format);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        runTestOntologyContainsAxioms1(format);
    }

    @Nonnull
    private static RDFXMLDocumentFormat createRDFXMLFormat() {
        RDFXMLDocumentFormat format = new RDFXMLDocumentFormat();
        // This test case relies on certain declarations being in certain
        // ontologies. The default
        // behaviour is to add missing declarations. Therefore, this needs to be
        // turned off.
        format.setAddMissingTypes(false);
        return format;
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        m.addAxiom(ont, annoAx3);
        OWLAnnotationProperty myComment = AnnotationProperty(IRI("http://ont.com#myComment"));
        OWLSubAnnotationPropertyOfAxiom annoAx4 = df
                .getOWLSubAnnotationPropertyOfAxiom(myComment, rdfsComment);
        m.addAxiom(ont, annoAx4);
        reload(ont, new RDFXMLDocumentFormat());
        reload(ont, new OWLXMLDocumentFormat());
        reload(ont, new TurtleDocumentFormat());
        reload(ont, new FunctionalSyntaxDocumentFormat());
    }
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.