query-b74891ba9b3ec4e72c12f571eb83b753

rq turtle/ttl

Links to sports-reference.com:

Use at

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#>
SELECT ?item ?itemLabel ?section ?typeLabel ?url WHERE {
  VALUES ?type { wd:Q5389 wd:Q159821 wd:Q82414 wd:Q26132862 wd:Q1123217 } # wd:Q18536594 wd:Q26213387
  VALUES ?wdt { wdt:P31 wdt:P279 }
  ?item ?wdt ?type .
  BIND(CONCAT(STRAFTER(STR(?wdt), 'direct/'), '-', STRAFTER(STR(?type), 'entity/')) AS ?section) .
  OPTIONAL {
    ?item wdt:P973 ?url .
    FILTER(CONTAINS(STR(?url), 'sports-reference.com')) .
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?item"):::projected v5("?section"):::projected v2("?type") v1("?url"):::projected v3("?wdt") c4(["bd:serviceParam"]):::iri c6(["en"]):::literal bind0[/VALUES ?type/] bind0-->v2 bind00(["wd:Q5389"]) bind00 --> bind0 bind01(["wd:Q159821"]) bind01 --> bind0 bind02(["wd:Q82414"]) bind02 --> bind0 bind03(["wd:Q26132862"]) bind03 --> bind0 bind04(["wd:Q1123217"]) bind04 --> bind0 bind1[/VALUES ?wdt/] bind1-->v3 bind10(["wdt:P31"]) bind10 --> bind1 bind11(["wdt:P279"]) bind11 --> bind1 v4 -->v3--> v2 bind2[/"concat(substring-after(str(?wdt),'direct/'),'-',substring-after(str(?type),'entity/'))"/] v3 --o bind2 v2 --o bind2 bind2 --as--o v5 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P973".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end