         #endif
         let graph   = defaultGraphTerm ?? Term(value: path, type: .iri)
         
-        let parser = RDFParserCombined()
-        var quads = [Quad]()
-        if verbose {
-            warn("Parsing RDF...")
-        }
-        count = try parser.parse(file: filename, defaultGraph: graph, base: graph.value) { (s, p, o, g) in
-            let q = Quad(subject: s, predicate: p, object: o, graph: g)
-            quads.append(q)
-        }
-        
-        if verbose {
-            print("Loading RDF...")
-        }
-        try store.load(version: version, quads: quads)
+        if path.hasSuffix(".nt") {
+            let reader = FileReader(filename: filename)
+            let parser = NTriplesParser(reader: reader)
+            
+            let i = parser.makeIterator()
+            let quads = AnySequence(i.lazy.map { Quad(triple: $0, graph: graph) })
+            try store.load(version: version, quads: quads)
+        } else {
+            let parser = RDFParserCombined()
+            var quads = [Quad]()
+            if verbose {
+                warn("Parsing RDF...")
+            }
+            
+            count = try parser.parse(file: filename, defaultGraph: graph, base: graph.value) { (s, p, o, g) in
+                let q = Quad(subject: s, predicate: p, object: o, graph: g)
+                quads.append(q)
+            }
+            
+            if verbose {
+                print("Loading RDF...")
+            }
+            try store.load(version: version, quads: quads)
+        }
     }
     return count
 }

}

func quadStore(_ config: QuadStoreConfiguration) throws -> AnyMutableQuadStore {
    print("Using AnyQuadStore")
    let mqs = try config.anymutablestore()
    if case let .loadFiles(defaultFiles, namedFiles) = config.initialize {
        _ = try parse(into: mqs, files: defaultFiles, version: startSecond, graph: nil, verbose: verbose)
        try namedFiles.forEach { (graph, file) throws in
            _ = try parse(into: mqs, files: [file], version: startSecond, graph: graph, verbose: verbose)
        }

import Foundation
import SPARQLSyntax
import Kineo
import Diomede

/// Parse the supplied RDF files and load the resulting RDF triples into the database's
/// QuadStore in the supplied named graph (or into a graph named with the corresponding
