-
Notifications
You must be signed in to change notification settings - Fork 78
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59db86c
commit 1a3e2d6
Showing
3 changed files
with
32 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#defaultView:Table | ||
|
||
PREFIX target: <http://www.wikidata.org/entity/{{ q }}> | ||
|
||
SELECT ?count | ||
?wikiproject ?wikiprojectLabel (CONCAT("/wikiproject/", SUBSTR(STR(?wikiproject), 32)) AS ?wikiprojectUrl) | ||
?example_work ?example_workLabel (CONCAT("/work/", SUBSTR(STR(?example_work), 32)) AS ?example_workUrl) | ||
WITH { | ||
SELECT (COUNT(?work) AS ?count) ?wikiproject (SAMPLE(?work) AS ?example_work) WHERE { | ||
# Find works for the specific queried wikiproject | ||
VALUES ?p { wdt:P6104 wdt:P5008 } | ||
SERVICE bd:sample { ?work ?p target: . bd:serviceParam bd:sample.limit 100000 } | ||
|
||
# Find co-occuring wikiprojects | ||
?work ?p ?wikiproject . | ||
|
||
# Avoid listing the queried wikiproject | ||
FILTER (target: != ?wikiproject) | ||
} | ||
GROUP BY ?wikiproject | ||
} AS %result | ||
WHERE { | ||
# Label the results | ||
INCLUDE %result | ||
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } | ||
} | ||
ORDER BY DESC(?count) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters