Package org.restlet.ext.rdf.internal.n3

Examples of org.restlet.ext.rdf.internal.n3.RdfN3Reader


     * @throws Exception
     */
    public void parse(GraphHandler graphHandler) throws Exception {
        if (rdfRepresentation != null) {
            if (MediaType.TEXT_RDF_N3.equals(rdfRepresentation.getMediaType())) {
                new RdfN3Reader(rdfRepresentation, graphHandler).parse();
            } else if (MediaType.TEXT_XML.equals(rdfRepresentation
                    .getMediaType())) {
                new RdfXmlReader(rdfRepresentation, graphHandler).parse();
            } else if (MediaType.APPLICATION_ALL_XML.includes(rdfRepresentation
                    .getMediaType())) {
                new RdfXmlReader(rdfRepresentation, graphHandler).parse();
            } else if (MediaType.TEXT_PLAIN.equals(rdfRepresentation
                    .getMediaType())) {
                new RdfNTriplesReader(rdfRepresentation, graphHandler).parse();
            } else if (MediaType.TEXT_RDF_NTRIPLES.equals(rdfRepresentation
                    .getMediaType())) {
                new RdfNTriplesReader(rdfRepresentation, graphHandler).parse();
            } else if (MediaType.APPLICATION_RDF_TURTLE
                    .equals(rdfRepresentation.getMediaType())) {
                new RdfTurtleReader(rdfRepresentation, graphHandler).parse();
            } else if (MediaType.valueOf("text/rdf+n3").equals(
                    rdfRepresentation.getMediaType())) {
                // Deprecated media type still in usage
                new RdfN3Reader(rdfRepresentation, graphHandler).parse();
            }
            // Parsing for other media types goes here.
        }
    }
View Full Code Here


     * @throws IOException
     */
    public GraphHandler createWriter(MediaType mediaType, Writer writer)
            throws IOException {
        if (MediaType.TEXT_RDF_N3.equals(getMediaType())) {
            return new RdfN3Writer(writer);
        } else if (MediaType.TEXT_XML.equals(getMediaType())) {
            return new RdfXmlWriter(writer);
        } else if (MediaType.APPLICATION_ALL_XML.includes(getMediaType())) {
            return new RdfXmlWriter(writer);
        } else if (MediaType.TEXT_PLAIN.equals(getMediaType())) {
View Full Code Here

TOP

Related Classes of org.restlet.ext.rdf.internal.n3.RdfN3Reader

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.