File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
rdf-processing-toolkit-cli/src/main/java/org/aksw/sparql_integrate/cli/main Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -244,14 +244,23 @@ public static int sparqlIntegrate(CmdSparqlIntegrateMain cmd) throws Exception {
244244
245245 // If a format is given it takes precedence - otherwise try to use the filename
246246 String outFormat = cmd .outFormat ;
247+
248+ // Format source can be either a filename "foo.nt", a file extension "ttl" or a format string "turtle/pretty"
247249 String formatSource = outFormat == null
248250 ? outFilename
249251 : outFormat ;
250252
251- if (outFormat == null && formatSource != null ) {
253+ // Try to parse the format source as a file name or file extension
254+ if (formatSource != null ) {
252255 // Try to derive the outFormat from the filename - if given.
253256 FileName fn = fileNameParser .parse (formatSource );
254- outFormat = fn .getContentPart ();
257+ String tmpOutFormat = fn .getContentPart ();
258+
259+ // Replace the outFormat with the result of the successful parse
260+ if (tmpOutFormat != null ) {
261+ outFormat = tmpOutFormat ;
262+ }
263+
255264 rawOutEncodings .addAll (fn .getEncodingParts ());
256265 }
257266
You can’t perform that action at this time.
0 commit comments