query-3551dfc4befab000a39eda4fc0f03de1

rq turtle/ttl

TODO

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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?id ?idLabel ?country ?countryLabel ?occupation ?parentId ?optionAward ?optionAwardLabel ?mgid ?optionNotable_work ?optionNotable_workLabel ?optionWikipedia_article ?influencer (SAMPLE(?student) AS ?student) (SAMPLE(?img) AS ?img) 
WHERE
{
   {SELECT DISTINCT ?id WHERE 
{
  { ?id wdt:P106 wd:Q170790 . }
  UNION
  { ?id wdt:P549 ?mgid . }
  } LIMIT 500 }  ?id wdt:P27 ?country.
  OPTIONAL {
       ?optionWikipedia_article schema:about ?id;
       schema:isPartOf <https://en.wikipedia.org/>.
            }
   OPTIONAL { ?id wdt:P18 ?img. }
   OPTIONAL {
     ?id p:P800 _:b102.
     _:b102 ps:P800 ?optionNotable_work.
            }
   OPTIONAL { ?id wdt:P166 ?optionAward. }
   OPTIONAL {
     ?id (wdt:P802|wdt:P185) ?student.
     ?student wdt:P106 wd:Q170790.
            }
 OPTIONAL {
   ?id (p:P1066|p:P184) _:b103.
   _:b103 (ps:P1066|ps:P184) ?parentId.
   ?parentId wdt:P106 wd:Q170790.
           }
 OPTIONAL { ?id wdt:P737 ?influencer. }
 SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }

} GROUP BY ?id ?idLabel ?country ?countryLabel ?occupation ?parentId ?optionAward ?optionAwardLabel ?mgid ?optionNotable_work ?optionNotable_workLabel ?optionWikipedia_article ?influencer

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?country"):::projected v1("?id"):::projected v11("?img"):::projected v10("?influencer"):::projected v2("?mgid"):::projected v7("?optionAward"):::projected v6("?optionNotable_work"):::projected v4("?optionWikipedia_article"):::projected v9("?parentId"):::projected v11("?student"):::projected a1((" ")) a2((" ")) c2(["wd:Q170790"]):::iri c22(["en"]):::literal c7([https://en.wikipedia.org/]):::iri c20(["bd:serviceParam"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P549"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P106"--> c2 end union0r <== or ==> union0l end v1 --"p:direct/P27"--> v3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."schema:about".-> v1 v4 --"schema:isPartOf"--> c7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P18".-> v11 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:P800".-> a1 a1 --"p:statement/P800"--> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P166".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v1 -."p:direct/P185".-> v11 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v1 --"p:direct/P802"--> v11 end union1r <== or ==> union1l end v11 --"p:direct/P106"--> c2 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v1 -."p:P184".-> a2 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v1 --"p:P1066"--> a2 end union2r <== or ==> union2l end subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; a2 --"p:statement/P184"--> v9 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; a2 --"p:statement/P1066"--> v9 end union3r <== or ==> union3l end v9 --"p:direct/P106"--> c2 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v1 -."p:direct/P737".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c20 --"wikibase:language"--> c22 end bind2[/"sample(?student)"/] v11 --o bind2 bind2 --as--o v11 bind3[/"sample(?img)"/] v11 --o bind3 bind3 --as--o v11