Package org.semanticweb.owlapi.io

Examples of org.semanticweb.owlapi.io.StringDocumentSource


    protected OWLOntology loadOntologyFromString(
            @Nonnull StringDocumentTarget input)
            throws OWLOntologyCreationException {
        return OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new StringDocumentSource(input));
    }
View Full Code Here


    protected OWLOntology loadOntologyFromString(
            @Nonnull StringDocumentTarget input, OWLDocumentFormat f)
            throws OWLOntologyCreationException {
        return OWLManager.createOWLOntologyManager()
                .loadOntologyFromOntologyDocument(
                        new StringDocumentSource(input.toString(),
                                OWLOntologyDocumentSourceBase
                                        .getNextDocumentIRI("string:ontology"),
                                f, null));
    }
View Full Code Here

            @Nonnull StringDocumentTarget o,
            @Nonnull OWLOntologyLoaderConfiguration c)
            throws OWLOntologyCreationException {
        OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
        return manager.loadOntologyFromOntologyDocument(
                new StringDocumentSource(o), c);
    }
View Full Code Here

                + "  <owl:Thing rdf:about=\"http://example.com/#1#2\">"
                + "    <rdf:type rdf:resource=\"http://www.w3.org/2002/07/owl#NamedIndividual\"/>"
                + "  </owl:Thing>" + "</rdf:RDF>";
        OWLOntology ontology = m.createOntology();
        RDFXMLParser parser = new RDFXMLParser();
        parser.parse(new StringDocumentSource(rdfContent), ontology, config);
    }
View Full Code Here

                + "namespace: unit.ontology\n"
                + "def: \"A unit which is a standard measure of the distance between two points.\" [Wikipedia:Wikipedia]\n"
                + "subset: unit_group_slim\n" + "is_a: UO:0000000 ! unit\n"
                + "relationship: is_unit_of PATO:0001708 ! 1-D extent\n"
                + "created_by: george gkoutos";
        StringDocumentSource streamDocumentSource = new StringDocumentSource(
                input);
        OWLOntologyLoaderConfiguration loaderConfig = new OWLOntologyLoaderConfiguration()
                .setMissingImportHandlingStrategy(MissingImportHandlingStrategy.SILENT);
        OWLOntology ontology = rootOntologyManager
                .loadOntologyFromOntologyDocument(streamDocumentSource,
View Full Code Here

              iri, t.getIdentifier() );
          log.warning( msg );
          throw new OWLOntologyCreationException( msg );
        }
        else {
          StringDocumentSource source = new StringDocumentSource( str, iri );
          try {
            manager.loadOntologyFromOntologyDocument( source );
          } catch( OWLOntologyCreationException e ) {
            log.warning( format( "Failed to parse imported ontology for testcase (%s)",
                t.getIdentifier() ) );
View Full Code Here

      if( o == null ) {
        String l = getPremiseOntology( format );
        if( l == null )
          return null;

        StringDocumentSource source = new StringDocumentSource( l );
        o = manager.loadOntologyFromOntologyDocument( source );
        parsedPremise.put( format, o );
      }
      return o;
    } catch( OWLOntologyCreationException e ) {
View Full Code Here

      if( o == null ) {
        String l = getConclusionOntology( format );
        if( l == null )
          return null;

        StringDocumentSource source = new StringDocumentSource( l );
        o = OWLManager.createOWLOntologyManager().loadOntologyFromOntologyDocument( source );
        parsedConclusion.put( format, o );
      }
      return o;
    } catch( OWLOntologyCreationException e ) {
View Full Code Here

      if( o == null ) {
        String l = getPremiseOntology( format );
        if( l == null )
          return null;

        StringDocumentSource source = new StringDocumentSource( l );
        o = manager.loadOntologyFromOntologyDocument( source );
        parsedPremise.put( format, o );
      }
      return o;
    } catch( OWLOntologyCreationException e ) {
View Full Code Here

    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

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.