RDF is very good at stating facts, and we have great online databases where we can get facts.
s(CASP) is very good at human-like reasoning, especially with negation.
In trying to put those two together I made this little test:
% Test reasoning from rdf facts using scasp
:- use_module(library(scasp)).
:- use_module(library(semweb/rdf11)).
:- style_check(-discontiguous).
:- rdf_register_prefix(ex,'https://www.example.com/').
:- rdf_register_prefix(swi,'https://www.swi-prolog.org/rdf/entity').
% Scasp code
thinks(X) :- human(X).
human(X) :- programmer(X).
programmer(X) :- rdf(X,rdf:type,ex:programmer).
% prolog
test :-
Jan = swi:'Jan',
rdf_assert(swi:'Jan',rdf:type,ex:programmer),
scasp(thinks(Jan)).
But I get this error:
1 ?- test.
ERROR: No permission to scasp procedure `rdf_db:rdf/3'
ERROR: In:
ERROR: [37] throw(error(permission_error(scasp,procedure,...),_1512))
ERROR: [33] scasp_dyncall:body_calls((rdf_db: ...,post_object(_1570,_1572)),rdf11,_1554) at /home/u/.local/share/swi-prolog/pack/scasp/prolog/scasp/dyncall.pl:256
ERROR: [31] scasp_dyncall:predicate_calls(rdf11:rdf(_1614,_1616,_1618),_1604) at /home/u/.local/share/swi-prolog/pack/scasp/prolog/scasp/dyncall.pl:252
[...]
The reason is because rdf/3 can not be converted into an scasp goal.
I think a sensible solution is my old proposal of allowing {} to annotate goals that should be run in prolog only, and considered to be true scasp facts if they succeed. This would be in addition to the nice dyncall facility already there.
Somethinmg like:
programmer(X) :- { rdf(X,rdf:type,ex:programmer) }.
much like we do with DCGs.
any comments?