I get the following error after trying a bagof (or findall) on rdf triples where the triple predicate has a namespace prefix:
ERROR: rdf_db:rdf/3: Type error: `atom' expected, found `foo:rating' (a compound)
^ Exception: (12) setup_call_catcher_cleanup('$bags':'$new_findall_bag', '$bags':findall_loop(_G413, user:rdf(test, foo:rating, _G413), _G342, []), _G481, '$bags':'$destroy_findall_bag') ?
The following example generates this error.
% small rdf program that generates error on bagof
:- use_module(library(semweb/rdf_db)).
:- use_module(library(semweb/rdfs)).
rate(Page,User,Rate):-
rdf_bnode(B),
rdf_assert(B,rdfs:member,rdf:'Bag'),
rdf_assert(Page,foo:rating,B),
rdf_assert(B,foo:by,User),
rdf_assert(B,foo:rated,literal(type(integer,Rate))),
!.
rdfnodes(Sub,Pred,Bags):-
bagof(B,rdf(Sub,Pred,B),Bags),
!.
:- rate(test,john,50), rate(test,jane,60).
:- rdfnodes(test,foo:rating,Bags).
The same program without the "foo" prefixes works fine. Also, doing the bagoff call from the REPL prompt works fine.
Any ideas on how to fix this?