query-1836cdc6d707dee203af93643c26b6f2

rq turtle/ttl

Propertiesinstance of (P31)occupation (P106)formatter URL (P1630)CageMatch worker ID (P2728)start time (P580)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?wrestler ?article (SAMPLE(?link) AS ?link) ?wrestlerLabel
WHERE {
   ?wrestler wdt:P31 wd:Q5 .
   ?wrestler wdt:P106 wd:Q13474373 .
   ?article schema:about ?wrestler .
   ?article schema:inLanguage "en" .
   ?article schema:isPartOf <https://en.wikipedia.org/> .
OPTIONAL { wd:P2728 wdt:P1630 ?url .
           ?wrestler wdt:P2728 ?cgid .
           BIND(IRI(REPLACE(?cgid, '^(.+)$', ?url)) AS ?link).
         }
MINUS {
   ?wrestler p:P106 ?occupation_statement .
   ?occupation_statement ps:P106 wd:Q13474373 .
   ?occupation_statement pq:P580 ?start .
      }
   SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
   }
 } 
GROUP BY ?wrestler ?article ?wrestlerLabel
ORDER BY ?wrestlerLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?article"):::projected v5("?cgid") v9("?link"):::projected v7("?occupation_statement") v8("?start") v4("?url") v2("?wrestler"):::projected v1("?wrestlerLabel"):::projected c7(["en"]):::literal c9([https://en.wikipedia.org/]):::iri c17(["bd:serviceParam"]):::iri c10(["wd:P2728"]):::iri c2(["wd:Q5"]):::iri c4(["wd:Q13474373"]):::iri v2 --"p:direct/P31"--> c2 v2 --"p:direct/P106"--> c4 v3 --"schema:about"--> v2 v3 --"schema:inLanguage"--> c7 v3 --"schema:isPartOf"--> c9 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; c10 -."p:direct/P1630".-> v4 v2 --"p:direct/P2728"--> v5 bind0[/"replace(?cgid,'^(.+)$',?url)"/] v5 --o bind0 v4 --o bind0 bind0 --as--o v9 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"p:P106"--> v7 v7 --"p:statement/P106"--> c4 v7 --"p:qualifier/P580"--> v8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c7 end bind3[/"sample(?link)"/] v9 --o bind3 bind3 --as--o v9