Some 11 days ago I asked a question about showing in a category which files have de depicts field as structured data. I think that we need to be able to more easily access this piece of data to make the next step in Commons.
I finally got some answers thanks to the help of multiple people. As I heard multiple people are interested in this too, let me share it here with you what I have found. Not all options are useful for me, but maybe for you they are.
*Option 1:* haswbstatement:P180 in the search field What it does: it shows all files with property P180 (depicts) in the structured data. What it does not do: showing files that are missing P180. Example url: https://commons.wikimedia.org/w/index.php?title=Special%3ASearch&limit=5...
*Option 2:* use the has Depictsscript script by user TiagoLubiana What it does: script adds a dot below each file in a category (and more places), the dot is green if the file has the depicts statement (P180), the dot is red if the file hasn't. In this way you can quickly see which files have or haven't the depicts structured data. What it does not do: it does not show what the depicts is. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:TiagoLubiana/hasDepicts.js');
*Option 3:* use the sdc_tool script by user Magnus Manske What it does: in the right corner at the bottom is a button, clicking on it activates the scripts and shows what the file depicts (if any). You can also easily add statements through the script to the files. Issue: in my screen it shows the depicts statements right through the file name, making them both unreadable. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:Magnus Manske/sdc_tool.js');
*Option 4:* run a query to see what the depicts statements are of the files in a category. What it does: it shows all files in a category, and if the files have any depicts statement it shows the labels of them. Example query: https://w.wiki/F45M Because manually changing the category (line 8) each time you want to use the query, I made a small script to be added to http://commons.wikimedia.org/wiki/Special:MyPage/common.js in what you can autorun this query with the category name added automatically. The link is present in the expandable menu under More. [image: Depicts.PNG]
Script to add:
// in Category namespace (ns:14) link to query for depicts of all files in category https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-21if ( mw.config.get( 'wgNamespaceNumber' ) === 14 ) { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-22$(function() { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-23 mw.util.addPortletLink('p-cactions', 'https://commons-query.wikimedia.org/embed.html#SELECT%20DISTINCT%20%3Fdepict...' + mw.config.get( 'wgPageName' ) + '%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agenerator%20%22categorymembers%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmtype%20%22file%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmlimit%20%22max%22%20.%0A%20%20%20%20%20%20%3Ftitle%20wikibase%3AapiOutput%20mwapi%3Atitle%20.%0A%20%20%20%20%20%20%3Fpageid%20wikibase%3AapiOutput%20%22%40pageid%22%20.%0A%20%20%20%20%7D%0A%20%20%20%20BIND%20%28URI%28CONCAT%28%27https%3A%2F%2Fcommons.wikimedia.org%2Fentity%2FM%27%2C%20%3Fpageid%29%29%20AS%20%3Ffile%29%0A%20%20%7D%0A%7D%20AS%20%25get_files%0AWHERE%0A%7B%0A%20%20INCLUDE%20%25get_files%0A%20%20%3Ffile%20schema%3Aurl%20%3Furl%20.%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%3Ffile%20wdt%3AP180%20%3Fdepicts%20.%0A%20%20%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%20%20%3Fdepicts%20rdfs%3Alabel%20%3FdepictsLabel%20.%0A%20%20%20%20%20%20FILTER%20%28lang%28%3FdepictsLabel%29%20%3D%20%22en%22%29%20%20%20%20%20%20%20%20%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D', "depicts:", "FileDepicts", "depicts:"); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-24}); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-25};
Further more I can also recommend using the gadget AC/DC for adding (not showing) structured data (based on the files in a category or PagePile). Enabling in your gadgets: https://commons.wikimedia.org/wiki/Special:Preferences#mw-prefsection-gadget... (section Interface: Structured Data).
More suggestions remain welcome!
Romaine
Op wo 6 aug 2025 om 12:16 schreef Romaine Wiki romaine.wiki@gmail.com:
Hi all,
Is there a script/gadget/tool to easily see which files in a category has or hasn't the depicts field added as structured data?
Thanks!
Romaine
In terms of adding depicts statements to a category (including human selection of which images to add it to). See https://wikicrowd.toolforge.org, and note the custom button at the bottom of the page.
Addshore
On Sun, 17 Aug 2025, 21:29 Romaine Wiki, romaine.wiki@gmail.com wrote:
Some 11 days ago I asked a question about showing in a category which files have de depicts field as structured data. I think that we need to be able to more easily access this piece of data to make the next step in Commons.
I finally got some answers thanks to the help of multiple people. As I heard multiple people are interested in this too, let me share it here with you what I have found. Not all options are useful for me, but maybe for you they are.
*Option 1:* haswbstatement:P180 in the search field What it does: it shows all files with property P180 (depicts) in the structured data. What it does not do: showing files that are missing P180. Example url: https://commons.wikimedia.org/w/index.php?title=Special%3ASearch&limit=5...
*Option 2:* use the has Depictsscript script by user TiagoLubiana What it does: script adds a dot below each file in a category (and more places), the dot is green if the file has the depicts statement (P180), the dot is red if the file hasn't. In this way you can quickly see which files have or haven't the depicts structured data. What it does not do: it does not show what the depicts is. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:TiagoLubiana/hasDepicts.js');
*Option 3:* use the sdc_tool script by user Magnus Manske What it does: in the right corner at the bottom is a button, clicking on it activates the scripts and shows what the file depicts (if any). You can also easily add statements through the script to the files. Issue: in my screen it shows the depicts statements right through the file name, making them both unreadable. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:Magnus Manske/sdc_tool.js');
*Option 4:* run a query to see what the depicts statements are of the files in a category. What it does: it shows all files in a category, and if the files have any depicts statement it shows the labels of them. Example query: https://w.wiki/F45M Because manually changing the category (line 8) each time you want to use the query, I made a small script to be added to http://commons.wikimedia.org/wiki/Special:MyPage/common.js in what you can autorun this query with the category name added automatically. The link is present in the expandable menu under More. [image: Depicts.PNG]
Script to add:
// in Category namespace (ns:14) link to query for depicts of all files in category https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-21if ( mw.config.get( 'wgNamespaceNumber' ) === 14 ) { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-22$(function() { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-23 mw.util.addPortletLink('p-cactions', 'https://commons-query.wikimedia.org/embed.html#SELECT%20DISTINCT%20%3Fdepict...' + mw.config.get( 'wgPageName' ) + '%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agenerator%20%22categorymembers%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmtype%20%22file%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmlimit%20%22max%22%20.%0A%20%20%20%20%20%20%3Ftitle%20wikibase%3AapiOutput%20mwapi%3Atitle%20.%0A%20%20%20%20%20%20%3Fpageid%20wikibase%3AapiOutput%20%22%40pageid%22%20.%0A%20%20%20%20%7D%0A%20%20%20%20BIND%20%28URI%28CONCAT%28%27https%3A%2F%2Fcommons.wikimedia.org%2Fentity%2FM%27%2C%20%3Fpageid%29%29%20AS%20%3Ffile%29%0A%20%20%7D%0A%7D%20AS%20%25get_files%0AWHERE%0A%7B%0A%20%20INCLUDE%20%25get_files%0A%20%20%3Ffile%20schema%3Aurl%20%3Furl%20.%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%3Ffile%20wdt%3AP180%20%3Fdepicts%20.%0A%20%20%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%20%20%3Fdepicts%20rdfs%3Alabel%20%3FdepictsLabel%20.%0A%20%20%20%20%20%20FILTER%20%28lang%28%3FdepictsLabel%29%20%3D%20%22en%22%29%20%20%20%20%20%20%20%20%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D', "depicts:", "FileDepicts", "depicts:"); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-24}); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-25};
Further more I can also recommend using the gadget AC/DC for adding (not showing) structured data (based on the files in a category or PagePile). Enabling in your gadgets: https://commons.wikimedia.org/wiki/Special:Preferences#mw-prefsection-gadget... (section Interface: Structured Data).
More suggestions remain welcome!
Romaine
Op wo 6 aug 2025 om 12:16 schreef Romaine Wiki romaine.wiki@gmail.com:
Hi all,
Is there a script/gadget/tool to easily see which files in a category has or hasn't the depicts field added as structured data?
Thanks!
Romaine
Wikidata mailing list -- wikidata@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/mes... To unsubscribe send an email to wikidata-leave@lists.wikimedia.org
Addshore - I don't know if this is the right thread for talking about tools to add "Depicts" statements, but I tried out WikiCrowd, and it works great! I just added it to the relevant listings in both the main page, and the navigation box, for Structured Data on Commons:
https://commons.wikimedia.org/wiki/Commons:Structured_data
There are a fair number of tools for adding structured data, but each one has its own advantages. WikiCrowd, in my opinion, is nice because of its simplicity: you can just go to the site and (after an automated login) start clicking on images.
On Mon, Aug 18, 2025 at 2:24 AM Addshore addshorewiki@gmail.com wrote:
In terms of adding depicts statements to a category (including human selection of which images to add it to). See https://wikicrowd.toolforge.org, and note the custom button at the bottom of the page.
Addshore
On Sun, 17 Aug 2025, 21:29 Romaine Wiki, romaine.wiki@gmail.com wrote:
Some 11 days ago I asked a question about showing in a category which files have de depicts field as structured data. I think that we need to be able to more easily access this piece of data to make the next step in Commons.
I finally got some answers thanks to the help of multiple people. As I heard multiple people are interested in this too, let me share it here with you what I have found. Not all options are useful for me, but maybe for you they are.
*Option 1:* haswbstatement:P180 in the search field What it does: it shows all files with property P180 (depicts) in the structured data. What it does not do: showing files that are missing P180. Example url: https://commons.wikimedia.org/w/index.php?title=Special%3ASearch&limit=5...
*Option 2:* use the has Depictsscript script by user TiagoLubiana What it does: script adds a dot below each file in a category (and more places), the dot is green if the file has the depicts statement (P180), the dot is red if the file hasn't. In this way you can quickly see which files have or haven't the depicts structured data. What it does not do: it does not show what the depicts is. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:TiagoLubiana/hasDepicts.js');
*Option 3:* use the sdc_tool script by user Magnus Manske What it does: in the right corner at the bottom is a button, clicking on it activates the scripts and shows what the file depicts (if any). You can also easily add statements through the script to the files. Issue: in my screen it shows the depicts statements right through the file name, making them both unreadable. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:Magnus Manske/sdc_tool.js');
*Option 4:* run a query to see what the depicts statements are of the files in a category. What it does: it shows all files in a category, and if the files have any depicts statement it shows the labels of them. Example query: https://w.wiki/F45M Because manually changing the category (line 8) each time you want to use the query, I made a small script to be added to http://commons.wikimedia.org/wiki/Special:MyPage/common.js in what you can autorun this query with the category name added automatically. The link is present in the expandable menu under More. [image: Depicts.PNG]
Script to add:
// in Category namespace (ns:14) link to query for depicts of all files in category https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-21if ( mw.config.get( 'wgNamespaceNumber' ) === 14 ) { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-22$(function() { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-23 mw.util.addPortletLink('p-cactions', 'https://commons-query.wikimedia.org/embed.html#SELECT%20DISTINCT%20%3Fdepict...' + mw.config.get( 'wgPageName' ) + '%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agenerator%20%22categorymembers%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmtype%20%22file%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmlimit%20%22max%22%20.%0A%20%20%20%20%20%20%3Ftitle%20wikibase%3AapiOutput%20mwapi%3Atitle%20.%0A%20%20%20%20%20%20%3Fpageid%20wikibase%3AapiOutput%20%22%40pageid%22%20.%0A%20%20%20%20%7D%0A%20%20%20%20BIND%20%28URI%28CONCAT%28%27https%3A%2F%2Fcommons.wikimedia.org%2Fentity%2FM%27%2C%20%3Fpageid%29%29%20AS%20%3Ffile%29%0A%20%20%7D%0A%7D%20AS%20%25get_files%0AWHERE%0A%7B%0A%20%20INCLUDE%20%25get_files%0A%20%20%3Ffile%20schema%3Aurl%20%3Furl%20.%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%3Ffile%20wdt%3AP180%20%3Fdepicts%20.%0A%20%20%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%20%20%3Fdepicts%20rdfs%3Alabel%20%3FdepictsLabel%20.%0A%20%20%20%20%20%20FILTER%20%28lang%28%3FdepictsLabel%29%20%3D%20%22en%22%29%20%20%20%20%20%20%20%20%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D', "depicts:", "FileDepicts", "depicts:"); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-24}); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-25};
Further more I can also recommend using the gadget AC/DC for adding (not showing) structured data (based on the files in a category or PagePile). Enabling in your gadgets: https://commons.wikimedia.org/wiki/Special:Preferences#mw-prefsection-gadget... (section Interface: Structured Data).
More suggestions remain welcome!
Romaine
Op wo 6 aug 2025 om 12:16 schreef Romaine Wiki romaine.wiki@gmail.com:
Hi all,
Is there a script/gadget/tool to easily see which files in a category has or hasn't the depicts field added as structured data?
Thanks!
Romaine
Wikidata mailing list -- wikidata@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/mes... To unsubscribe send an email to wikidata-leave@lists.wikimedia.org
Wikidata mailing list -- wikidata@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/mes... To unsubscribe send an email to wikidata-leave@lists.wikimedia.org
Looks like I was not subscribed to the commons list when sending my earlier email, however now I am.
So, relating to tool more tightly to the subject of this thread. The tool will not show you images that already depict a thing, and the input is a category, thus you can see all images in a category recursively which do not depict the thing.
An interesting detail of this, is it takes into account the ontological tree on Wikidata, so as an example: - Lookup https://commons.wikimedia.org/wiki/Category:Laptops (which will be recursively evaluated) - https://commons.wikimedia.org/wiki/File:A_2021_14-inch_Silver_MacBook_Pro_(c... will not appear in the list, - this is as it already depicts Q3065317 Macbook https://www.wikidata.org/wiki/Q3065317, which is in turn a Q3962 laptop https://www.wikidata.org/wiki/Q3962 I believe wikicrowd is likely one of the few tools that tries to evaluate the depicts tree in this way currently
So, though there is no way to export a list of the things it decides are not depicted by X in a category, its likely one of the most accurate ways to answer the question. It may be possible to add such logic to the SPARQL that is within option 4, however behind the scenes, wikicrowd doesnt use SPARQL to answer the question, as the queries take too long.
On Mon, 18 Aug 2025 at 15:52, Yaron Koren yaron57@gmail.com wrote:
Addshore - I don't know if this is the right thread for talking about tools to add "Depicts" statements, but I tried out WikiCrowd, and it works great! I just added it to the relevant listings in both the main page, and the navigation box, for Structured Data on Commons:
https://commons.wikimedia.org/wiki/Commons:Structured_data
There are a fair number of tools for adding structured data, but each one has its own advantages. WikiCrowd, in my opinion, is nice because of its simplicity: you can just go to the site and (after an automated login) start clicking on images.
On Mon, Aug 18, 2025 at 2:24 AM Addshore addshorewiki@gmail.com wrote:
In terms of adding depicts statements to a category (including human selection of which images to add it to). See https://wikicrowd.toolforge.org, and note the custom button at the bottom of the page.
Addshore
On Sun, 17 Aug 2025, 21:29 Romaine Wiki, romaine.wiki@gmail.com wrote:
Some 11 days ago I asked a question about showing in a category which files have de depicts field as structured data. I think that we need to be able to more easily access this piece of data to make the next step in Commons.
I finally got some answers thanks to the help of multiple people. As I heard multiple people are interested in this too, let me share it here with you what I have found. Not all options are useful for me, but maybe for you they are.
*Option 1:* haswbstatement:P180 in the search field What it does: it shows all files with property P180 (depicts) in the structured data. What it does not do: showing files that are missing P180. Example url: https://commons.wikimedia.org/w/index.php?title=Special%3ASearch&limit=5...
*Option 2:* use the has Depictsscript script by user TiagoLubiana What it does: script adds a dot below each file in a category (and more places), the dot is green if the file has the depicts statement (P180), the dot is red if the file hasn't. In this way you can quickly see which files have or haven't the depicts structured data. What it does not do: it does not show what the depicts is. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:TiagoLubiana/hasDepicts.js');
*Option 3:* use the sdc_tool script by user Magnus Manske What it does: in the right corner at the bottom is a button, clicking on it activates the scripts and shows what the file depicts (if any). You can also easily add statements through the script to the files. Issue: in my screen it shows the depicts statements right through the file name, making them both unreadable. How to add: go to your http://commons.wikimedia.org/wiki/Special:MyPage/common.js and add there: importScript('User:Magnus Manske/sdc_tool.js');
*Option 4:* run a query to see what the depicts statements are of the files in a category. What it does: it shows all files in a category, and if the files have any depicts statement it shows the labels of them. Example query: https://w.wiki/F45M Because manually changing the category (line 8) each time you want to use the query, I made a small script to be added to http://commons.wikimedia.org/wiki/Special:MyPage/common.js in what you can autorun this query with the category name added automatically. The link is present in the expandable menu under More. [image: Depicts.PNG]
Script to add:
// in Category namespace (ns:14) link to query for depicts of all files in category https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-21if ( mw.config.get( 'wgNamespaceNumber' ) === 14 ) { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-22$(function() { https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-23 mw.util.addPortletLink('p-cactions', 'https://commons-query.wikimedia.org/embed.html#SELECT%20DISTINCT%20%3Fdepict...' + mw.config.get( 'wgPageName' ) + '%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agenerator%20%22categorymembers%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmtype%20%22file%22%20.%0A%20%20%20%20%20%20bd%3AserviceParam%20mwapi%3Agcmlimit%20%22max%22%20.%0A%20%20%20%20%20%20%3Ftitle%20wikibase%3AapiOutput%20mwapi%3Atitle%20.%0A%20%20%20%20%20%20%3Fpageid%20wikibase%3AapiOutput%20%22%40pageid%22%20.%0A%20%20%20%20%7D%0A%20%20%20%20BIND%20%28URI%28CONCAT%28%27https%3A%2F%2Fcommons.wikimedia.org%2Fentity%2FM%27%2C%20%3Fpageid%29%29%20AS%20%3Ffile%29%0A%20%20%7D%0A%7D%20AS%20%25get_files%0AWHERE%0A%7B%0A%20%20INCLUDE%20%25get_files%0A%20%20%3Ffile%20schema%3Aurl%20%3Furl%20.%0A%20%20OPTIONAL%20%7B%0A%20%20%20%20%3Ffile%20wdt%3AP180%20%3Fdepicts%20.%0A%20%20%20%20SERVICE%20%3Chttps%3A%2F%2Fquery.wikidata.org%2Fsparql%3E%20%7B%0A%20%20%20%20%20%20%3Fdepicts%20rdfs%3Alabel%20%3FdepictsLabel%20.%0A%20%20%20%20%20%20FILTER%20%28lang%28%3FdepictsLabel%29%20%3D%20%22en%22%29%20%20%20%20%20%20%20%20%0A%20%20%20%20%7D%0A%20%20%7D%0A%7D', "depicts:", "FileDepicts", "depicts:"); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-24}); https://commons.wikimedia.org/wiki/User:Romaine/vector.js#L-25};
Further more I can also recommend using the gadget AC/DC for adding (not showing) structured data (based on the files in a category or PagePile). Enabling in your gadgets: https://commons.wikimedia.org/wiki/Special:Preferences#mw-prefsection-gadget... (section Interface: Structured Data).
More suggestions remain welcome!
Romaine
Op wo 6 aug 2025 om 12:16 schreef Romaine Wiki romaine.wiki@gmail.com:
Hi all,
Is there a script/gadget/tool to easily see which files in a category has or hasn't the depicts field added as structured data?
Thanks!
Romaine
Wikidata mailing list -- wikidata@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/mes... To unsubscribe send an email to wikidata-leave@lists.wikimedia.org
Wikidata mailing list -- wikidata@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/mes... To unsubscribe send an email to wikidata-leave@lists.wikimedia.org
-- WikiWorks · MediaWiki Consulting · http://wikiworks.com _______________________________________________ Wikidata mailing list -- wikidata@lists.wikimedia.org Public archives at https://lists.wikimedia.org/hyperkitty/list/wikidata@lists.wikimedia.org/mes... To unsubscribe send an email to wikidata-leave@lists.wikimedia.org