Last active
September 25, 2023 17:25
-
-
Save karlb/3dd3d382b08cddb3f90684ef8a44bee5 to your computer and use it in GitHub Desktop.
Wikidata queries
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
#defaultView:ImageGrid | |
SELECT DISTINCT * | |
WHERE { | |
SERVICE wikibase:mwapi { | |
bd:serviceParam wikibase:api "EntitySearch" . | |
bd:serviceParam wikibase:endpoint "www.wikidata.org" . | |
bd:serviceParam mwapi:search ?company_name . | |
bd:serviceParam mwapi:language "en" . | |
?comp wikibase:apiOutputItem mwapi:item . | |
?num wikibase:apiOrdinal true . | |
} | |
VALUES ?company_name {"baloise"} | |
?comp p:P31/ps:P31/wdt:P279* ?company_or_similar. # only companies | |
?comp wdt:P154 ?logo. | |
VALUES ?company_or_similar {wd:Q783794 wd:Q4830453} | |
# FILTER (?comp = wd:Q6326486) | |
} | |
LIMIT 3 |
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
SELECT ?p ?propLabel ?o WHERE { | |
wd:L21636 ?p ?o. | |
OPTIONAL { | |
?prop wikibase:directClaim ?p. | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment