diff --git a/commons-rdf-rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java b/commons-rdf-rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java index 3ba31cb6..2f1eb526 100644 --- a/commons-rdf-rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java +++ b/commons-rdf-rdf4j/src/main/java/org/apache/commons/rdf/rdf4j/experimental/RDF4JParser.java @@ -135,12 +135,12 @@ protected void parseSynchronusly() throws IOException { // we'll always do it with our own input stream // // That means we may have to guess format by extensions: - final Optional formatByFilename = getSourceFile().map(Path::getFileName).map(Path::toString) + final Optional formatByFileName = getSourceFile().map(Path::getFileName).map(Path::toString) .flatMap(Rio::getParserFormatForFileName); // TODO: for the excited.. what about the extension after following // symlinks? - final RDFFormat format = formatByMimeType.orElse(formatByFilename.orElse(null)); + final RDFFormat format = formatByMimeType.orElse(formatByFileName.orElse(null)); try (InputStream in = Files.newInputStream(getSourceFile().get())) { loader.load(in, base, format, rdfHandler); }