public static ErrorReport merge(ErrorReport first, ErrorReport second) { ErrorReport newReport = new ErrorReport(); for(ReportMessage msg : first.reports) { newReport.addReportMessage(msg); } for(ReportMessage otherMsg :second.reports) { newReport.addReportMessage(otherMsg); } return newReport; } public String toJSONString() throws JSONException {
public void shutdown(ErrorReport errorReport) { List<Runnable> unfinishedWorkers = service.shutdownNow(); for(Runnable unfinishedWorker : unfinishedWorkers) { if(unfinishedWorker instanceof TriplesMapWorker) { TriplesMapWorker unfinishedTriplesMapWorker = (TriplesMapWorker) unfinishedWorker; errorReport.addReportMessage(new ReportMessage("Triples Map Plan Execution Error", unfinishedTriplesMapWorker.toString() + " was unable to complete", Priority.high)); } } }
public String getExpandedAndNormalizedUri(String uri) { // Check if the predicate contains a predicate. if (replacePrefixesWithNamespaces && !uri.startsWith("<") && !uri.startsWith("http:") && !uri.startsWith("https:") && uri.contains(":") && !uri.startsWith("_:")) { // Replace the prefix with proper namespace by looking into the ontology manager String prefix = uri.substring(0, uri.indexOf(":")); String namespace = this.prefixToNamespaceMap.get(prefix); if (namespace == null || namespace.isEmpty()) { if(reportErrors) { this.errorReport.addReportMessage(new ReportMessage("Error creating predicate's URI: " + uri, "No namespace found for the prefix: " + prefix, Priority.high)); } } else { uri = namespace + uri.substring(uri.indexOf(":")+1); } } // Remove all unwanted characters uri = normalizeUri(uri); // Put angled brackets if required if (!uri.startsWith(Uris.BLANK_NODE_PREFIX) && !uri.startsWith("<") && !uri.endsWith(">")) { uri = "<" + uri + ">"; } return uri; }
errorReport.addReportMessage(new ReportMessage("Triples Map Plan Execution Error", e.getMessage(), Priority.high));
errorReport.addReportMessage(new ReportMessage("General RDF Generation Error", e.getMessage(), Priority.high)); throw new IOException("Unable to generate RDF: " +e.getMessage());