Browse Source

Added support for "ntriples" for when typo is forgotten

Even though “ntriples" should not be used, it’s a common typo. I deem
it common enough to support it. Also, rather than returning null, we
now return “.unknown”. Even though that should never happen, it is at
least better than “null”…
Christophe Debruyne 7 years ago
parent
commit
815d1fbe93
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/r2rml/Main.java

+ 2 - 2
src/r2rml/Main.java

@@ -179,7 +179,7 @@ public class Main {
 	private static String getExtensionForFormat(String format) {
 		if(equals(format, new String[]{"turtle", "ttl"}))
 			return ".ttl";
-		if(equals(format, new String[]{"n-triples", "n-triple", "nt"}))
+		if(equals(format, new String[]{"n-triples", "n-triple", "nt", "ntriples"}))
 			return ".nt";
 		if(equals(format, new String[]{"rdf", "rdf/xml", "rdf/xml-abbrev"}))
 			return ".rdf";
@@ -190,7 +190,7 @@ public class Main {
 		if(equals(format, new String[]{"jsonld"}))
 			return ".jsonld";
 		
-		return null;
+		return ".unknown";
 	}
 
 	private static boolean equals(String format, String[] strings) {