% CPSC 312 - examples of interacting with wikidata
:- use_module(library(semweb/rdf_http_plugin)).
:- use_module(library(semweb/rdf_db)).

% Load the appropriate files:
%:- rdf_load('https://www.w3.org/People/Berners-Lee/card.rdf').
%:- rdf_load('https://cs.ubc.ca/~poole/foaf.rdf').
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q24639.rdf').  % Vancouver
% rdf('http://www.wikidata.org/entity/Q24639',P,V).  % Vancouver
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q3099714.rdf'). % Justin Trudeau
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q262802.rdf'). % Christine Sinclair
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q499946.rdf'). % Canada women's national soccer team
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q11571.rdf'). % Cristiano Ronaldo
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q1255625.rdf'). % Samuel Eto'o
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q34086.rdf').   % Justin Bieber
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/Q17198340.rdf').   % Shawn Mendez
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/P25.rdf').   % mother property
%:- rdf_load('http://www.wikidata.org/wiki/Special:EntityData/P54.rdf').   % member of sports team

%?- rdf(S,P,O).
%?- rdf(S,'http://xmlns.com/foaf/0.1/member',O).
%?- rdf('https://www.w3.org/People/Berners-Lee/card#i',P,O).
%?- rdf('https://www.w3.org/People/Berners-Lee/card#i','http://xmlns.com/foaf/0.1/family_name',O).
%?- rdf('http://www.wikidata.org/entity/Q34086','http://schema.org/name',N).
%?- rdf('http://www.wikidata.org/entity/Q34086','http://schema.org/name',literal(lang(ko,N))).  % Korean
%?- rdf('http://www.wikidata.org/entity/Q34086','http://schema.org/name',literal(lang(az,N))).  % Azerbaijani
%?- rdf('http://www.wikidata.org/entity/Q34086', 'http://www.wikidata.org/prop/direct/P25',M).  % mother
%?- rdf('http://www.wikidata.org/entity/Q34086', 'http://www.wikidata.org/prop/direct/P25',M),rdf(M,'http://schema.org/name',V).  % JB's mother
%?- rdf('http://www.wikidata.org/entity/Q34086', 'http://www.wikidata.org/prop/direct/P27',M),rdf(M,'http://schema.org/name',V).  % JB's citizenship
%?- rdf('http://www.wikidata.org/entity/Q3099714', 'http://www.wikidata.org/prop/direct/P25',M),rdf(M,'http://schema.org/name',V).  % JT's mother
%?- rdf('http://www.wikidata.org/entity/P25',P,V).
%?- rdf('http://www.wikidata.org/entity/P25','http://schema.org/name',V).
%?- rdf('http://www.wikidata.org/entity/Q262802', 'http://www.wikidata.org/prop/direct/P27',M),rdf(M,'http://schema.org/name',V).  % CS's citizenship
   
%?- rdf('http://www.wikidata.org/entity/Q11571', 'http://www.wikidata.org/prop/direct/P54',M),rdf(M,'http://schema.org/name', literal(lang('en-gb',N))).

%?- rdf('http://www.wikidata.org/entity/Q1255625','http://schema.org/name',N).
