Last active
April 19, 2024 21:41
-
-
Save athalhammer/9cdfae45e4a776592d33b146bc51045b to your computer and use it in GitHub Desktop.
uberank
This file contains hidden or 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
git clone https://github.com/athalhammer/wikidata-rank-hdt.git | |
cd wikidata-rank-hdt | |
wget https://danker.s3.amazonaws.com/uberank.hdt.bz2 | |
bunzip2 uberank.hdt.bz2 | |
mv uberank.hdt rank.hdt | |
docker-compose up | |
# call http://localhost:80 | |
##### EXAMPLE QUERY ##### | |
# Rankings of castles in Switzerland | |
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#> | |
PREFIX vrank: <http://purl.org/voc/vrank#> | |
SELECT * WHERE { | |
SERVICE <https://query.wikidata.org/sparql> { | |
SELECT DISTINCT ?castle ?castleLabel WHERE { | |
?castle wdt:P17/wdt:P279* wd:Q39. | |
?castle wdt:P31/wdt:P279* wd:Q23413. | |
SERVICE wikibase:label { | |
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". | |
} | |
} | |
} | |
?castle vrank:pagerank ?pagerank . | |
?castle vrank:qrank ?qrank . | |
?castle vrank:sitelinkcount ?sitelinkcount . | |
} | |
ORDER BY DESC(?pagerank) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment