Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.StringDocumentSource


    Set<OWLAxiom> expectedExplanation = expectedExplanations.iterator().next();
    StringWriter sw = new StringWriter();
    ModelFactory.createModelForGraph( actual ).write( System.out, "TTL" );
    ModelFactory.createModelForGraph( actual ).write( sw, "RDF/XML" );
    OWLOntology ont = manager.loadOntologyFromOntologyDocument( new StringDocumentSource( sw.toString() ) );
    Set<? extends OWLAxiom> actualExplanation = ont.getLogicalAxioms();

    System.out.println( actualExplanation );

    StringBuilder sb = new StringBuilder();
View Full Code Here


    assertEquals( Collections.singletonList(alice), ontModel.listObjectsOfProperty( bob, sibling ).toList() );
  }

  @Test
  public void testRepeatedVars() throws Exception {
    StringDocumentSource source = new StringDocumentSource("Prefix(owl:=<http://www.w3.org/2002/07/owl#>)\n" +
            "Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)\n" +
            "Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)\n" +
            "Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)\n" +
            "Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)\n" +
            "\n" +
View Full Code Here

        OWLOntologyDocumentTarget tgt = new StringDocumentTarget();
        try {
            ontology.getOWLOntologyManager().saveOntology(ontology, tgt);

            newOnt = ontologyManager
                    .loadOntologyFromOntologyDocument(new StringDocumentSource(tgt.toString()));
        } catch (OWLOntologyStorageException e) {
            log.error("Failed to re-serialize ontology.", e);
        } catch (OWLOntologyCreationException e) {
            log.error("Failed to deserialize ontology.", e);
        }
View Full Code Here

TOP

Related Classes of org.semanticweb.owlapi.io.StringDocumentSource

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.