Examples of RDFXMLDocumentFormat


Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        changes.add(new AddAxiom(ontology, SubClassOf(c, ObjectHasValue(p, i))));
        changes.add(new AddAxiom(ontology, ClassAssertion(d, i)));
        changes.add(new AddAxiom(ontology, DataPropertyAssertion(q, i,
                Literal("hello"))));
        m.applyChanges(changes);
        RDFXMLDocumentFormat format = new RDFXMLDocumentFormat();
        format.setDefaultPrefix(NS + '#');
        ontology = roundTrip(ontology, format);
        FunctionalSyntaxDocumentFormat format2 = new FunctionalSyntaxDocumentFormat();
        format2.setDefaultPrefix(NS + '#');
        ontology = roundTrip(ontology, format2);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        m.addAxiom(ontology, Declaration(a));
        m.addAxiom(ontology, Declaration(b));
        m.addAxiom(ontology,
                SubClassOf(b, factory.getOWLObjectSomeValuesFrom(p, a)));
        OWLOntology loadOntology = roundTrip(ontology,
                new RDFXMLDocumentFormat());
        FunctionalSyntaxDocumentFormat functionalFormat = new FunctionalSyntaxDocumentFormat();
        functionalFormat.asPrefixOWLOntologyFormat().setPrefix("example",
                "http://example.org/");
        OWLOntology loadOntology2 = roundTrip(ontology, functionalFormat);
        // won't reach here if functional syntax fails - comment it out and
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

                + "</skos:Concept>\n" + "\n" + "</rdf:RDF>";
        // when
        OWLOntology o = loadOntologyFromString(input,
                OWLOntologyDocumentSourceBase
                        .getNextDocumentIRI("testuriwithblankspace"),
                new RDFXMLDocumentFormat());
        // then
        assertEquals(15, o.getAxiomCount());
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

    }

    @Test
    public void shouldRDFXMLBeEquivalent() {
        OWLOntology rdf = loadOntologyFromString(RDFXML,
                IRI.create("urn:primer#rdfxml"), new RDFXMLDocumentFormat());
        assertTrue(profile.checkOntology(rdf).getViolations().isEmpty());
        equal(func, rdf);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

                + "<rdf:RDF xmlns=\"http://www.org/\" xml:base=\"http://www.org/\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:ns=\"http://example.com/ns#\" xmlns:owl=\"http://www.w3.org/2002/07/owl#\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\">\n"
                + "    <owl:Ontology rdf:about=\"http://www.org/\"/>\n"
                + "    <rdf:Description rdf:about=\"&ns;test\"><ns:rel><rdf:Description ns:pred =\"Not visible\"/></ns:rel></rdf:Description>\n"
                + "</rdf:RDF>";
        OWLOntology oo = loadOntologyFromString(input);
        @SuppressWarnings("null")
        @Nonnull
        RDFXMLDocumentFormat format = (RDFXMLDocumentFormat) oo
                .getOWLOntologyManager().getOntologyFormat(oo);
        assertEquals("Should have no unparsed triples", 0, format
                .getOntologyLoaderMetaData().getUnparsedTriples().size());
        Set<OWLAnnotationAssertionAxiom> annotationAxioms = oo
                .getAxioms(AxiomType.ANNOTATION_ASSERTION);
        assertEquals("annotation axiom count should be 2", 2,
                annotationAxioms.size());
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        Set<OWLClassExpression> classExpressions = new HashSet<>();
        classExpressions.add(descA);
        classExpressions.add(descB);
        OWLAxiom ax = df.getOWLDisjointClassesAxiom(classExpressions);
        m.applyChange(new AddAxiom(ontA, ax));
        OWLOntology ontB = roundTrip(ontA, new RDFXMLDocumentFormat());
        assertTrue(ontB.getAxioms().contains(ax));
    }
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        OWLOntology owlapiOntologyPrimer = m.createOntology();
        RDFXMLParser owlapiParser = new RDFXMLParser();
        OWLDocumentFormat owlapiOntologyFormat = owlapiParser.parse(
                getStream("/koala.owl"), owlapiOntologyPrimer, config);
        assertEquals(70, owlapiOntologyPrimer.getAxiomCount());
        assertEquals(new RDFXMLDocumentFormat(), owlapiOntologyFormat);
        RioParserImpl rioParser = new RioParserImpl(
                new RioRDFXMLDocumentFormatFactory());
        // OWLOntology ontology = OWLOntologyManagerFactoryRegistry
        // .createOWLOntologyManager().createOntology(
        OWLOntology ontology = m1
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        OWLOntology owlapiOntologyPrimer = m.createOntology();
        RDFXMLParser owlapiParser = new RDFXMLParser();
        OWLDocumentFormat owlapiOntologyFormat = owlapiParser.parse(
                getStream("/primer.rdfxml.xml"), owlapiOntologyPrimer, config);
        assertEquals(93, owlapiOntologyPrimer.getAxiomCount());
        assertEquals(new RDFXMLDocumentFormat(), owlapiOntologyFormat);
        RioParserImpl rioParser = new RioParserImpl(
                new RioRDFXMLDocumentFormatFactory());
        // OWLOntology rioOntologyPrimer = OWLOntologyManagerFactoryRegistry
        // .createOWLOntologyManager()
        OWLOntology rioOntologyPrimer = m1.createOntology(IRI
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        RDFXMLParser owlapiParser = new RDFXMLParser();
        OWLDocumentFormat owlapiOntologyFormat = owlapiParser.parse(
                getStream("/rioParserTest1-minimal.rdf"), owlapiOntologyPrimer,
                config);
        assertEquals(4, owlapiOntologyPrimer.getAxiomCount());
        assertEquals(new RDFXMLDocumentFormat(), owlapiOntologyFormat);
        RioParserImpl rioParser = new RioParserImpl(
                new RioRDFXMLDocumentFormatFactory());
        // OWLOntology rioOntologyPrimer = OWLOntologyManagerFactoryRegistry
        // .createOWLOntologyManager().createOntology(
        OWLOntology rioOntologyPrimer = OWLManager.createOWLOntologyManager()
View Full Code Here

Examples of org.semanticweb.owlapi.formats.RDFXMLDocumentFormat

        RDFXMLParser owlapiParser = new RDFXMLParser();
        OWLDocumentFormat owlapiOntologyFormat = owlapiParser.parse(
                getStream("/rioParserTest1-minimal.rdf"), owlapiOntologyPrimer,
                config);
        assertEquals(4, owlapiOntologyPrimer.getAxiomCount());
        assertEquals(new RDFXMLDocumentFormat(), owlapiOntologyFormat);
        RioParserImpl rioParser = new RioParserImpl(
                new RioRDFXMLDocumentFormatFactory());
        // OWLOntology rioOntologyPrimer = OWLOntologyManagerFactoryRegistry
        // .createOWLOntologyManager().createOntology(
        OWLOntology rioOntologyPrimer = m1.createOntology(IRI
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.