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/26 01:40:30 UTC

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

HansBrende 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_r328404625
 
 

 ##########
 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:
   Actually we still need that annotation to avoid Intellij warnings... unfortunately the `BaseRDFaExtractor` still can't see it because it's in a different package, and I don't want to make it protected, otherwise it'll be a backwards incompatible change if we delete it later (which we will probably do).

----------------------------------------------------------------
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