Skip to content

Commit

Permalink
Fix #26
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Feb 3, 2022
1 parent 08033b9 commit b8f3330
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.apache.commons.cli.*;
import org.apache.jena.query.Query;
import org.apache.jena.util.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

Expand Down Expand Up @@ -164,6 +165,9 @@ public String getFormat(Query q) {

// Set default format for query type and STDOUT or FILE
if (commandLine.getOptionValue(CLI.OUTPUT) != null) {
// Guess the format from the extension
return FileUtils.guessLang(commandLine.getOptionValue(CLI.OUTPUT));
} else {
if (q.isAskType() || q.isSelectType()) {
return "JSON";
} else if (q.isConstructType() || q.isDescribeType()) {
Expand Down

0 comments on commit b8f3330

Please sign in to comment.