Prolog triple facts vs. RDF library -- retrieval performance of ground truths

Hello,

I wrote, what could be characterized, as a simple triple store, where prolog facts are asserted into the store (in my case this are quad facts).

Retrieval is rather leisurely, and retrival pattern typically requires finding all facts that originate from a same subject. Or, all facts that terminate in the same object.

I am wondering whether using instead of my “naive” triple the use of the RDF library would speed up such find calls.

It would be a non trivial rewrite for me, but i am starting to think about optimizations i can do within prolog.

any thoughts would be much appreciated,

Dan