AngryLoki / wikidata-graph-builder

Visualize Wikidata items using d3.js
https://angryloki.github.io/wikidata-graph-builder/
MIT License
187 stars 24 forks source link

Limit items to the ones with English Wikipedia pages? #8

Open lubianat opened 1 year ago

lubianat commented 1 year ago

Hello!

First and foremost, awesome tool!! Super congrats.

I work with cells on Wikidata, and I want to build this query: https://angryloki.github.io/wikidata-graph-builder/?item=Q7868&property=P279&mode=reverse

But I want only to restrict for those items with Wikipedia pages.

I have a query that kind of get the items that I want: https://w.wiki/6K5z, but that leads to a see of 0-degree nodes: https://angryloki.github.io/wikidata-graph-builder/?item=Q7868&property=P279&mode=wdqs&wdqs=SELECT+%3Fitem++%3Fsitelink1+%3Fsitelinks+%28GROUP_CONCAT%28%3Fcell_ontology_id%3B+SEPARATOR+%3D+%22%3B%22%29+as+%3Fcell_ontology_ids%29%0AWHERE+%0A%7B%0A++++%3Fitem+wdt%3AP279*+wd%3AQ7868+.++%0A++++%0A+%7B+%3Fsitelink1+schema%3AisPartOf+%3Chttps%3A%2F%2Fen.wikipedia.org%2F%3E%3B%0A+++++schema%3Aabout+%3Fitem%3B%7D%0A%0A++OPTIONAl+%7B%3Fitem+wdt%3AP7963+%3Fcell_ontology_id+.%7D%0A++MINUS+%7B%3Fitem+wdt%3AP279*+wd%3AQ116723217+.+%7D%0A++MINUS+%7B%3Fitem+wdt%3AP279*+wd%3AQ116185221+.+%7D%0A++MINUS%7B%3Fitem+wdt%3AP279*+wd%3AQ116723575+.+%7D+%0A%0A++%3Fitem+rdfs%3Alabel+%3Flabel%0A++FILTER+%28lang%28%3Flabel%29+%3D+%27en%27%29%0A++++++++%0A+%3Fitem+wikibase%3Asitelinks+%3Fsitelinks+.+%0A++++++++%0A%7D%0AGROUP+BY+%3Fitem++%3Fsitelink1+%3Fsitelinks+%0AORDER+BY+DESC%28%3Fsitelinks%29&graph_direction=down

how should I formulate the query to get the links too?

Plus: It would be cool to have this filter as a parameter

Thanks!