pchampin / sophia_rs

Sophia: a Rust toolkit for RDF and Linked Data
Other
228 stars 24 forks source link

redundant information and triple patterns #129

Closed KonradHoeffner closed 1 year ago

KonradHoeffner commented 1 year ago

When I use methods such as triples_with_s or triples_with_po, I already know one or two of the triple components. Wouldn't it be much more efficient to just return property-object pairs in the first case and a set of subjects in the second?

pchampin commented 1 year ago

That's a valid question (although the methods should then be renamed if they did not return triples anymore...).

There is a value in returning the full triples, though: the term you pass you triples_with_s may not have the same type as the subjects you get back from the graph (the only requirement is that it implements Term). What the method returns is the term that comes from the graph, with the same type as the other terms of the triples.

KonradHoeffner commented 1 year ago

Thanks for the clarification!