You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@any23.apache.org by GitBox <gi...@apache.org> on 2019/09/25 16:20:12 UTC

[GitHub] [any23] lewismc commented on a change in pull request #144: ANY23-433 upgrade rdf4j to v3.0.0

lewismc commented on a change in pull request #144: ANY23-433 upgrade rdf4j to v3.0.0
URL: https://github.com/apache/any23/pull/144#discussion_r328215543
 
 

 ##########
 File path: core/src/main/java/org/apache/any23/extractor/rdf/BaseRDFExtractor.java
 ##########
 @@ -93,36 +90,15 @@ public void run(
     ) throws IOException, ExtractionException {
         try {
             final RDFParser parser = getParser(extractionContext, extractionResult);
-
-            RDFFormat format = parser.getRDFFormat();
-
-            if (format.hasFileExtension("jsonld") || format.hasMIMEType("application/ld+json")) {
-                in = new JsonCleaningInputStream(in);
-            }
-
             parser.parse(in, extractionContext.getDocumentIRI().stringValue());
         } catch (Exception ex) {
-            // ANY23-420: jsonld-java can sometimes throw IllegalArgumentException,
-            // so don't limit catch block to RDFParseExceptions
-
-            Throwable cause = ex.getCause();
-            if (cause instanceof JsonProcessingException) {
-                JsonProcessingException err = (JsonProcessingException)cause;
-                JsonLocation loc = err.getLocation();
-                if (loc == null) {
-                    extractionResult.notifyIssue(IssueReport.IssueLevel.FATAL, err.getOriginalMessage(), -1L, -1L);
-                } else {
-                    extractionResult.notifyIssue(IssueReport.IssueLevel.FATAL, err.getOriginalMessage(), loc.getLineNr(), loc.getColumnNr());
-                }
-            } else {
-                extractionResult.notifyIssue(IssueReport.IssueLevel.FATAL, toString(ex), -1, -1);
-            }
+            extractionResult.notifyIssue(IssueReport.IssueLevel.FATAL, toString(ex), -1, -1);
         }
     }
 
     // keep private to avoid backwards compatibility woes (may move around later)
     @SuppressWarnings("Duplicates")
 
 Review comment:
   Can also remove this ```Duplicates``` annotation it is now unnecessary

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services