query-e018a5b6e1e6d2cab7572d9699c0d11e

rq turtle/ttl

Related events based on people

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX target: <http://www.wikidata.org/entity/Q48026503>

SELECT
  ?score

  ?event ?eventLabel
  (CONCAT("#scientificevent/", SUBSTR(STR(?event), 32)) AS ?eventUrl)
  ?eventDescription

  ?example_person ?example_personLabel
  (CONCAT("#author/", SUBSTR(STR(?example_person), 32)) AS ?example_personUrl)

WHERE {
  { 
    SELECT
      (COUNT(DISTINCT ?person) AS ?score) ?event
      (SAMPLE(?person) AS ?example_person)
    WHERE {
      ?person ^wdt:P823 | ^wdt:P664 | wdt:P1344 | ^wdt:P710 | (^wdt:P98 / wdt:P4745) | (^wdt:P50 / wdt:P1433 / wdt:P4745 ) | ^wdt:P5804 target: , ?event .
      FILTER (?event != target:)
    }
    GROUP BY ?event
    ORDER BY DESC(?score)
    LIMIT 200
  } 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,no,ru,sv,zh". }
}
ORDER BY DESC(?score)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?event"):::projected v5("?eventUrl") v4("?example_person"):::projected v6("?example_personUrl") v3("?person") v4("?score"):::projected a1((" ")) a2((" ")) a3((" ")) c1([http://www.wikidata.org/entity/Q48026503]):::iri c12(["bd:serviceParam"]):::iri c14(["en,da,de,es,fr,jp,no,ru,sv,zh"]):::literal f0[["?event != http://www.wikidata.org/entity/Q48026503"]] f0 --> v2 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; subgraph union4[" Union "] subgraph union4l[" "] style union4l fill:#abf,stroke-dasharray: 3 3; subgraph union5[" Union "] subgraph union5l[" "] style union5l fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P5804"--> v3 v2 --"wdt:P5804"--> v3 end subgraph union5r[" "] style union5r fill:#abf,stroke-dasharray: 3 3; a2 --"wdt:P50"--> v3 a2 --"wdt:P1433"--> a3 a3 --"wdt:P4745"--> c1 a2 --"wdt:P50"--> v3 a2 --"wdt:P1433"--> a3 a3 --"wdt:P4745"--> v2 end union5r <== or ==> union5l end end subgraph union4r[" "] style union4r fill:#abf,stroke-dasharray: 3 3; a1 --"wdt:P98"--> v3 a1 --"wdt:P4745"--> c1 a1 --"wdt:P98"--> v3 a1 --"wdt:P4745"--> v2 end union4r <== or ==> union4l end end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P710"--> v3 v2 --"wdt:P710"--> v3 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P1344"--> c1 v3 --"wdt:P1344"--> v2 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P664"--> v3 v2 --"wdt:P664"--> v3 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; c1 --"wdt:P823"--> v3 v2 --"wdt:P823"--> v3 end union0r <== or ==> union0l end bind3[/"count(?person)"/] v3 --o bind3 bind3 --as--o v4 bind4[/"sample(?person)"/] v3 --o bind4 bind4 --as--o v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind5[/"concat('#scientificevent/',substring(str(?event),'32^^xsd:integer'))"/] v2 --o bind5 bind5 --as--o v5 bind6[/"concat('#author/',substring(str(?example_person),'32^^xsd:integer'))"/] v4 --o bind6 bind6 --as--o v6