Niels, SPARQL (https://www.w3.org/TR/rdf-sparql-query/) provides a simple way to join the triples of different statements and can be called from within your java code (http://jena.apache.org/documentation/query/index.html).
As noted previously using a filter should do the trick. There is documentation for how to write your own filter if you need to but you may find that your filter requirements are already met by existing filters. Claude On Sun, Nov 13, 2016 at 6:59 AM, Niels Andersen <[email protected]> wrote: > Dear user community, > > Our current approach to joining multiple model.listStatements (with > SimpleSelector) calls is to take the content of the iterators returned and > add them to separate HashSets and then use functions such as retainAll to > find the intersection between the two sets. > > This works relative well when model.listStatements return a small to > medium number of statements. > > My problem is that this seems to be a very inefficient way of joining to > sets of data that are already ordered in TDB. I assume that there must be a > better way to do this. I have searched the web, but all uses of > listStatements are very simple. > > I have also not found an effective way to do filtering (for instance > literal less than 5) without comparing every statement that listStatements > returns > > My questions are: > > * What is the recommended way to do a join between two lists of > statements? > > * What is the recommended way to implement filtering? > > * Is there anything else than SimpleSelector? Are there any > Advanced selectors? > > Thanks in advance, > Niels > > > > > -- I like: Like Like - The likeliest place on the web <http://like-like.xenei.com> LinkedIn: http://www.linkedin.com/in/claudewarren
