Created
February 15, 2023 17:53
-
-
Save tommorris/2df994f52f04a023fe329d5a445e350c to your computer and use it in GitHub Desktop.
wikidata query for follows/followed by mistakes
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
# finds all things that have a "follows" or "followed by" relationship, where the thing it follows is a year. | |
# these exist because parsers pulled next/prev links from wikipedia and decided to infer the thing it follows is a year. | |
# action: check and remove | |
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
PREFIX wikibase: <http://wikiba.se/ontology#> | |
PREFIX bd: <http://www.bigdata.com/rdf#> | |
SELECT DISTINCT ?a ?aLabel ?aType ?aTypeLabel ?b ?bLabel | |
WHERE | |
{ | |
?a wdt:P31 ?aType . | |
{ ?a wdt:P155 ?b . } UNION { ?a wdt:P156 ?b . } | |
?b wdt:P31 wd:Q3186692 . | |
SERVICE wikibase:label { | |
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". | |
} | |
MINUS { | |
{ ?a wdt:P31 wd:Q3186692. } UNION { ?a wdt:P31 wd:Q577 . } | |
} | |
} | |
LIMIT 100 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment