Search in sources :

Example 1 with XMLRDFizer

use of com.thoughtworks.studios.shine.semweb.XMLRDFizer in project gocd by gocd.

the class XMLArtifactImporter method importXML.

private void importXML(Graph graph, URIReference parentJob, Document doc) {
    for (XMLRDFizer handler : handlers) {
        if (handler.canHandle(doc)) {
            try {
                Graph artifactGraph = handler.importFile(parentJob.getURIText(), doc);
                LOGGER.debug("Imported a total of {} triples in artifact.", artifactGraph.size());
                graph.addTriplesFromGraph(artifactGraph);
                return;
            } catch (Exception e) {
                LOGGER.warn("{} was unable to handle document it said it could.  Exception happened while importing artifacts for job: {}...", handler.getClass().getName(), parentJob, e);
            }
        }
    }
}
Also used : Graph(com.thoughtworks.studios.shine.semweb.Graph) XMLRDFizer(com.thoughtworks.studios.shine.semweb.XMLRDFizer) IOException(java.io.IOException) DocumentException(org.dom4j.DocumentException) SAXException(org.xml.sax.SAXException)

Aggregations

Graph (com.thoughtworks.studios.shine.semweb.Graph)1 XMLRDFizer (com.thoughtworks.studios.shine.semweb.XMLRDFizer)1 IOException (java.io.IOException)1 DocumentException (org.dom4j.DocumentException)1 SAXException (org.xml.sax.SAXException)1