* @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.
}
}