I am a newbie to SPARQL and struggling to achieve these 2 goals and need your help. I have 2 classes where I have stored the keywords of python and CPP respectively. Now I intend to find the common keywords from these 2 sets and also the difference between the 2 (meaning, keywords which exists in python but not in CPP and vice versa). I have tried MINUS and NOT EXISTS version of the queries but to no help. To find the difference in 2 sets, I tried the below query:
SELECT ?subject
WHERE
{ ?subject a python:Keywords.
{ FILTER NOT EXISTS {?subject a cpp:Keywords} }
}
To find the common elements in 2 sets, I tried the below query:
select ?subject
where{ ?subject a python:Keywords. FILTER EXISTS { ?object a cpp:Keywords}
}
None of them are working. Please help