Skip to content

feat: add rdf n-tripples graph load source#7

Open
VanyaGlazunov wants to merge 2 commits intomainfrom
feat-add-rdf-graph-load
Open

feat: add rdf n-tripples graph load source#7
VanyaGlazunov wants to merge 2 commits intomainfrom
feat-add-rdf-graph-load

Conversation

@VanyaGlazunov
Copy link
Collaborator

Adds support for loading graphs from RDF N-Triples format as a new edge source.

closes #3 I think.

@VanyaGlazunov VanyaGlazunov force-pushed the feat-add-rdf-graph-load branch 2 times, most recently from e470334 to 9b98673 Compare March 19, 2026 02:54
#[derive(Debug, Clone, Default)]
pub enum LabelExtraction {
/// Use only the local name: the fragment (`#name`) or last path segment.
/// For example, `http://example.org/ns/knows` → `"knows"`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// For example, `http://example.org/ns/knows` → `"knows"`.
/// For example, `http://example.org/ns/knows` → `knows`.

I don't think there should be any quotation marks here so as not to confuse it with literals.

#[default]
LocalName,
/// Use the full IRI string as the label.
/// For example, `http://example.org/ns/knows` → `"http://example.org/ns/knows"`.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

}
}

impl<R: Read> Iterator for NTriples<R> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<...> <http://a.org/knows> <...>
<...> <http://b.org/knows> <...>

We lose info about difference between these two predicates if use LocalName. Is it good?

} else if let Some(pos) = iri.rfind('/') {
iri[pos + 1..].to_owned()
} else {
iri.to_owned()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we obtain something like <...> <http://a.org/> <...>? In this case predicate will be empty "". Should we handle this case?

@suvorovrain
Copy link
Collaborator

@VanyaGlazunov Nice. Can you answer on my questions in review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RDF N-Triples graph data loading

2 participants