@@ -164,8 +164,21 @@ int main(int argc, char **argv) {
164164 if (dot_position != string::npos)
165165 // Extract extension from file name
166166 rdfFormat = inputFile.substr (dot_position + 1 , string::npos);
167+
168+ /* *
169+ * If rdfFormat is still "", it means -f was not specified and the file
170+ * didn't have any extension. The default format is defined at the top
171+ * of this file: RDFNotation notation = NTRIPLES;
172+ */
173+ if (rdfFormat == " " )
174+ {
175+ rdfFormat = " nt" ;
176+ vout << " No input format detected. Using default: NTRIPLES." << endl;
177+ }
167178 }
168-
179+
180+ // ASSERT: here rdfFormat must be != ""
181+
169182 // Lower-case rdfFormat
170183 transform (rdfFormat.begin (), rdfFormat.end (), rdfFormat.begin (), ::tolower);
171184
@@ -180,15 +193,6 @@ int main(int argc, char **argv) {
180193 notation = TURTLE;
181194 else if (rdfFormat == " rdfxml" || rdfFormat == " xml" )
182195 notation = XML;
183-
184- /* *
185- * If rdfFormat is still "", it means -f was not specified and the file
186- * didn't have any extension. The default format is defined at the top
187- * of this file: RDFNotation notation = NTRIPLES;
188- */
189- else if (rdfFormat == " " )
190- vout << " No input format detected. Using default: NTRIPLES." << endl;
191-
192196 // -f or file extension detected, but didn't match any valid format.
193197 else {
194198 cerr << " ERROR: Detected \" " << rdfFormat << " \" input format. Must be one of:" << endl
0 commit comments