@@ -26,7 +26,8 @@ pathrex/
2626│ │ └── inmemory.rs # InMemory marker, InMemoryBuilder, InMemoryGraph
2727│ └── formats/
2828│ ├── mod.rs # FormatError enum, re-exports
29- │ └── csv.rs # Csv<R> — CSV → Edge iterator (CsvConfig, ColumnSpec)
29+ │ ├── csv.rs # Csv<R> — CSV → Edge iterator (CsvConfig, ColumnSpec)
30+ │ └── nt.rs # NTriples<R> — N-Triples → Edge iterator (LabelExtraction)
3031├── tests/
3132│ └── inmemory_tests.rs # Integration tests for InMemoryBuilder / InMemoryGraph
3233├── deps/
@@ -187,9 +188,13 @@ into a single graph.
187188
188189### Format parsers
189190
190- [ ` Csv<R> ` ] ( src/formats/csv.rs:52 ) is the only built-in parser. It yields
191- ` Iterator<Item = Result<Edge, FormatError>> ` and is directly pluggable into
192- ` GraphBuilder::load() ` via its ` GraphSource<InMemoryBuilder> ` impl.
191+ Two built-in parsers are available, both yielding
192+ ` Iterator<Item = Result<Edge, FormatError>> ` and pluggable into
193+ ` GraphBuilder::load() ` via their ` GraphSource<InMemoryBuilder> ` impls.
194+
195+ #### ` Csv<R> `
196+
197+ [ ` Csv<R> ` ] ( src/formats/csv.rs:52 ) parses delimiter-separated edge files.
193198
194199Configuration is via [ ` CsvConfig ` ] ( src/formats/csv.rs:17 ) :
195200
@@ -204,6 +209,27 @@ Configuration is via [`CsvConfig`](src/formats/csv.rs:17):
204209[ ` ColumnSpec ` ] ( src/formats/csv.rs:11 ) is either ` Index(usize) ` or ` Name(String) ` .
205210Name-based lookup requires ` has_header: true ` .
206211
212+ #### ` NTriples<R> `
213+
214+ [ ` NTriples<R> ` ] ( src/formats/nt.rs:57 ) parses [ W3C N-Triples] ( https://www.w3.org/TR/n-triples/ )
215+ RDF files using ` oxttl ` . Each triple ` (subject, predicate, object) ` becomes an
216+ [ ` Edge ` ] ( src/graph/mod.rs:154 ) where:
217+
218+ - ` source ` — subject IRI or blank-node ID (` _:label ` ).
219+ - ` target ` — object IRI or blank-node ID; triples whose object is an RDF
220+ literal yield ` Err(FormatError::LiteralAsNode) ` (callers may filter these out).
221+ - ` label ` — predicate IRI, transformed by [ ` LabelExtraction ` ] ( src/formats/nt.rs:36 ) :
222+
223+ | Variant | Behaviour |
224+ | ---| ---|
225+ | ` LocalName ` (default) | Fragment (` #name ` ) or last path segment of the predicate IRI |
226+ | ` FullIri ` | Full predicate IRI string |
227+
228+ Constructors:
229+
230+ - [ ` NTriples::new(reader) ` ] ( src/formats/nt.rs:72 ) — uses ` LabelExtraction::LocalName ` .
231+ - [ ` NTriples::with_label_extraction(reader, strategy) ` ] ( src/formats/nt.rs:76 ) — explicit strategy.
232+
207233### FFI layer
208234
209235[ ` lagraph_sys ` ] ( src/lagraph_sys.rs ) exposes raw C bindings for GraphBLAS and
@@ -254,7 +280,7 @@ Tests in `src/graph/mod.rs` use `CountingBuilder` / `CountOutput` / `VecSource`
254280[ ` src/utils.rs ` ] ( src/utils.rs ) — these do ** not** call into GraphBLAS and run without
255281native libraries.
256282
257- Tests in ` src/formats/csv.rs ` are pure Rust and need no native dependencies.
283+ Tests in ` src/formats/csv.rs ` and ` src/formats/nt.rs ` are pure Rust and need no native dependencies.
258284
259285Tests in ` src/graph/inmemory.rs ` and [ ` tests/inmemory_tests.rs ` ] ( tests/inmemory_tests.rs )
260286call real GraphBLAS/LAGraph and require the native libraries to be present.
0 commit comments