Skip to content

Conversation

@lu-pl
Copy link
Owner

@lu-pl lu-pl commented Nov 19, 2025

Closes #32.

@lu-pl lu-pl force-pushed the lupl/chainable-ttl branch from 9e1ba53 to 0915bd0 Compare November 21, 2025 12:28
The feature introduces an overload of lodkit.ttl.__or__ to allow for
iterator chaining. Chaining triple iterables with __or__ returns a
TripleChain iterator that allows further chaining and also implements
.to_graph for rdflib.Graph generation. Note that TripleChain objects
are iterators that will be exhausted after iteration.

Example:

some_triples: ttl = ...
more_triples: ttl = ...
yet_more_triples: ttl = ...

all_triples: TripleChain = some_triples | more_triples | yet_more_triples
graph: Graph = all_triples.to_graph()

assert not list(all_triples)

Closes #32.
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.

lodkit.ttl could overload __or__ for chaining

2 participants