Package org.coode.owlapi.turtle

Examples of org.coode.owlapi.turtle.TurtleOntologyFormat


            }

            OWLRDFConsumerAdapter consumer = new OWLRDFConsumerAdapter(getOWLOntologyManager(), ontology, parser);
            parser.setTripleHandler(consumer);
            parser.parseDocument();
            return new TurtleOntologyFormat();

        }
        catch(ParseException e) {
            throw new TurtleParserException(e);
        }
View Full Code Here


    case NTRIPLE_FORMAT:
      throw new IOntologyException("Unsupported export format");
    case OBO_FORMAT:
      ontologyFormat = new OBOOntologyFormat();break;
    case TURTLE_FORMAT:
      ontologyFormat = new TurtleOntologyFormat();break;
    }
   
   
    try {
      manager.saveOntology(ontology, ontologyFormat, out);
View Full Code Here

    case NTRIPLE_FORMAT:
      throw new IOntologyException("Unsupported export format");
    case OBO_FORMAT:
      ontologyFormat = new OBOOntologyFormat();break;
    case TURTLE_FORMAT:
      ontologyFormat = new TurtleOntologyFormat();break;
    }
   
   
    try {
      manager.saveOntology(ontology, ontologyFormat, out);
View Full Code Here

                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.TURTLE)) {
                try {
                    manager.saveOntology(ontology, new TurtleOntologyFormat(), out);
                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.RDF_JSON)) {
View Full Code Here

                    } catch (OWLOntologyStorageException e) {
                        log.error("Failed to store ontology for rendering.", e);
                    }
                } else if (mediaType.toString().equals(KRFormat.TURTLE)) {
                    try {
                        manager.saveOntology(ontology, new TurtleOntologyFormat(), out);
                    } catch (OWLOntologyStorageException e) {
                        log.error("Failed to store ontology for rendering.", e);
                    }
                } else if (mediaType.toString().equals(KRFormat.RDF_JSON)) {
   
View Full Code Here

                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.TURTLE)) {
                try {
                    manager.saveOntology(ontology, new TurtleOntologyFormat(), out);
                } catch (OWLOntologyStorageException e) {
                    log.error("Failed to store ontology for rendering.", e);
                }
            } else if (mediaType.toString().equals(KRFormat.RDF_JSON)) {
View Full Code Here

            OWLOntologyFormat format = null;
            if (RDF_XML_TYPE.equals(mediaType)) format = new RDFXMLOntologyFormat();
            else if (OWL_XML_TYPE.equals(mediaType)) format = new OWLXMLOntologyFormat();
            else if (MANCHESTER_OWL_TYPE.equals(mediaType)) format = new ManchesterOWLSyntaxOntologyFormat();
            else if (FUNCTIONAL_OWL_TYPE.equals(mediaType)) format = new OWLFunctionalSyntaxOntologyFormat();
            else if (TURTLE_TYPE.equals(mediaType) || X_TURTLE_TYPE.equals(mediaType)) format = new TurtleOntologyFormat();

            if (format != null) try {
                manager.saveOntology(ontology, format, out);
            } catch (OWLOntologyStorageException e) {
                log.error("Failed to store ontology for rendering.", e);
View Full Code Here

            format = format.trim();

            if (format.equals("TURTLE") || format.equals("RDF/XML")) {

                if (format.equals("TURTLE")) owlmanager.setOntologyFormat(owlmodel,
                    new TurtleOntologyFormat());
                if (format.equals("RDF/XML")) owlmanager.setOntologyFormat(owlmodel,
                    new RDFXMLOntologyFormat());

                OWLOntologyFormat owlformat = owlmanager.getOntologyFormat(owlmodel);
View Full Code Here

            }

            OWLRDFConsumerAdapter consumer = new OWLRDFConsumerAdapter(ontology, parser, configuration);
            parser.setTripleHandler(consumer);
            parser.parseDocument();
            TurtleOntologyFormat format = new TurtleOntologyFormat();
            DefaultPrefixManager prefixManager = parser.getPrefixManager();
            for(String prefixName : prefixManager.getPrefixNames()) {
                format.setPrefix(prefixName, prefixManager.getPrefix(prefixName));
            }
            return format;

        }
        catch(ParseException e) {
View Full Code Here

  }
 
  private Graph convertOntology(OWLOntology ontology, boolean filterTypes) throws Exception {
    StringDocumentTarget output = new StringDocumentTarget();

    manager.saveOntology( ontology, new TurtleOntologyFormat(),  output );

    Model model = ModelFactory.createDefaultModel();
    model.read( new StringReader( output.toString() ), ontologyURI.toString(), "TTL" );

    if( filterTypes ) {
View Full Code Here

TOP

Related Classes of org.coode.owlapi.turtle.TurtleOntologyFormat

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.