query-1de96e1aedcfe599eed49c3a0c20eafe
find items with Goratings ID, and show Goratings links
SELECT ?goplayer ?goplayerLabel ?goratings_ID ?goratings_link
WHERE {
# define ?goplayer's Goratings ID (P2805) value as ?goratings_ID
?goplayer wdt:P2805 ?goratings_ID.
# define Goratings ID (P2805)'s formatter URL (P1630) as ?url
wd:P2805 wdt:P1630 ?url
# replace ?goratings_ID with ?url, and get
# IRI (Internationalized Resource Identifier) of ?url; and
# bind ?url's IRI as ?goratings_link
BIND(IRI(REPLACE(?goratings_ID, '^(.+)$', ?url)) AS ?goratings_link).
# show label in simplified Chinese (zh-hans) as default, and English when no default label exists
SERVICE wikibase:label {bd:serviceParam wikibase:language "zh-hans,en".}
}
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# find items with Goratings ID, and show Goratings links
SELECT ?goplayer ?goplayerLabel ?goratings_ID ?goratings_link
WHERE {
# define ?goplayer's Goratings ID (P2805) value as ?goratings_ID
?goplayer wdt:P2805 ?goratings_ID.
# define Goratings ID (P2805)'s formatter URL (P1630) as ?url
wd:P2805 wdt:P1630 ?url
# replace ?goratings_ID with ?url, and get
# IRI (Internationalized Resource Identifier) of ?url; and
# bind ?url's IRI as ?goratings_link
BIND(IRI(REPLACE(?goratings_ID, '^(.+)$', ?url)) AS ?goratings_link).
# show label in simplified Chinese (zh-hans) as default, and English when no default label exists
SERVICE wikibase:label {bd:serviceParam wikibase:language "zh-hans,en".}
}
Query found at
- https://www.wikidata.org/wiki/User:Neo-Jay/Goratings.org/Query
- https://www.wikidata.org/wiki/User:Neo-Jay/Query
- https://www.wikidata.org/wiki/User:Neo-Jay/Query/1
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?goplayer"):::projected
v2("?goratings_ID"):::projected
v4("?goratings_link"):::projected
v3("?url")
c5(["bd:serviceParam"]):::iri
c2(["wd:P2805"]):::iri
c7(["zh-hans,en"]):::literal
v1 --"wdt:P2805"--> v2
c2 --"wdt:P1630"--> v3
bind0[/"replace(?goratings_ID,'^(.+)$',?url)"/]
v2 --o bind0
v3 --o bind0
bind0 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end