SQL
x
use wikidatawiki_p;
SELECT term_text#, count(*)
from wb_terms
WHERE term_entity_type = 'item'
AND term_language = 'ar'
AND term_type = 'label'
AND term_text NOT LIKE 'قالب:%'
and term_entity_id in (select * from wikidatawiki_p.pagelinks wdpl where wdpl.pl_from = term_entity_id AND (wdpl.pl_title = 'Q11266439')
AND wdpl.pl_namespace = 0)
and term_entity_id in (select * from wikidatawiki_p.pagelinks wdp where wdp.pl_from = term_entity_id AND (wdp.pl_title = 'P31')
AND wdp.pl_namespace = 120)
GROUP BY term_text
#ORDER BY count(*) DESC
LIMIT 50
By running queries you agree to the Cloud Services Terms of Use and you irrevocably agree to release your SQL under CC0 License.
All SQL code is licensed under CC0 License.