Talk:Wikidata Query Service/Categories
Add topicThis page used the Structured Discussions extension to give structured discussions. It has since been converted to wikitext, so the content and history here are only an approximation of what was actually displayed at the time these comments were made. |
Dumps requested
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
- Added to configs. Smalyshev (WMF) (talk) 06:36, 21 September 2017 (UTC)
Commons
[edit]Very nice to see this up and running Stas!. I don't see Wikimedia Commons at https://noc.wikimedia.org/conf/categories-rdf.dblist . Could you please add it? It's the wiki I most often query in Petscan. Multichill (talk) 20:26, 21 September 2017 (UTC)
- I've not added commons yet to the list because commons category list is huge, so I want to make sure the system works smoothly first. After this is ensured, we can add commons too. Smalyshev (WMF) (talk) 20:55, 21 September 2017 (UTC)
Can we whitelist the endpoint ?
[edit]Hi User:Smalyshev (WMF) !
Could we add the categories/sparql
endpoint to the whitelist allowed for federation, so that it would be possible to make queries like
PREFIX gas: <http://www.bigdata.com/rdf/gas#>
prefix mediawiki: <https://www.mediawiki.org/ontology#>
SELECT ?out ?depth WHERE {
service <https://query.wikidata.org/bigdata/namespace/categories/sparql> {
SELECT ?out ?depth WHERE {
SERVICE gas:service {
gas:program gas:gasClass "com.bigdata.rdf.graph.analytics.BFS" .
gas:program gas:linkType mediawiki:isInCategory .
gas:program gas:traversalDirection "Reverse" .
gas:program gas:in <https://en.wikipedia.org/wiki/Category:Ducks>. # one or more times, specifies the initial frontier.
gas:program gas:out ?out . # exactly once - will be bound to the visited vertices.
gas:program gas:out1 ?depth . # exactly once - will be bound to the depth of the visited vertices.
gas:program gas:maxIterations 8 . # optional limit on breadth first expansion.
}
}
}
} ORDER BY ASC(?depth)
or
prefix mediawiki: <https://www.mediawiki.org/ontology#>
SELECT ?out ?depth WHERE {
service <https://query.wikidata.org/bigdata/namespace/categories/sparql> {
SELECT ?out ?depth WHERE {
SERVICE mediawiki:categoryTree {
bd:serviceParam mediawiki:start <https://en.wikipedia.org/wiki/Category:Ducks> .
bd:serviceParam mediawiki:direction "Reverse" .
bd:serviceParam mediawiki:depth 5 .
}
}
}
} ORDER BY ASC(?depth)
Thanks! I have some people on en-wiki who would really like some Listeria pages for a set of queries, with articles in one particular category excluded. If federation were enabled, this ought to do the trick perfectly. Jheald (talk) 11:02, 21 February 2018 (UTC)
- Yes, I've added those to whitelist and they'll be added to the production config after deployment on Monday. Smalyshev (WMF) (talk) 21:08, 23 February 2018 (UTC)
Dead link
[edit]The following discussion is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.
The link in the introduction (https://noc.wikimedia.org/conf/categories-rdf.dblist) is dead. Michael Schönitzer (WMDE) (talk) 17:05, 12 March 2018 (UTC)
- Fixed, thank you Smalyshev (WMF) (talk) 17:19, 12 March 2018 (UTC)
Query pages, subcategories and HiddenCategory attributes
[edit]Hi, is it possible to include mediawiki:pages, mediawiki:subcategories and mediawiki:HiddenCategory attributes in query results using gas:service or mediawiki:categoryTree services?
I see these attributes in dumps, but have no luck with accessing them from SPARQL queries so far...
Thank you very much in advance! ZebraApfelschnecke (talk) 10:31, 8 June 2020 (UTC)