zazuko / clownface

Simple but powerful graph traversing library for RDF
https://zazuko.github.io/clownface/
37 stars 8 forks source link

Do not throw when calling list() on missing term #2

Closed tpluscode closed 5 years ago

tpluscode commented 5 years ago

Current state

<> :list () .
<> :list () .

Having the graph above, Clownface throws the same error in two cases (pseudo rdf-ext below)

cf(dataset).node('<>').out(':list').list()
cf(dataset).node('<>').out(':something-else').list()

Both calls will throw iterator over multiple terms is not supported which actually only applies to the first line

Desired state

This PR changes the implementation so that an iterator which will end immediately without returning anything.