query-cd85b27cdca178c096a6a521d07946f7

rq turtle/ttl

Comparison with todays's date: select a reviewer

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 DISTINCT ?reviewer ?reviewerLabel (SAMPLE(?website) AS ?website) (SAMPLE(?orcid) AS ?orcid) (SAMPLE(?twitter) AS ?twitter) WHERE {
  BIND(wd:Q21198 AS ?field).
  ?subField wdt:P279* ?field.
  ?reviewer wdt:P31 wd:Q5.
  MINUS { ?reviewer wdt:P570 []. }
  ?work wdt:P50 ?reviewer;
        wdt:P577 ?workDate.
  FILTER(?workDate > (NOW() - "P5Y"^^xsd:duration)).
  { ?work wdt:P921 ?subField. } UNION 
  { ?reviewer wdt:P101 ?subField. }
  OPTIONAL { ?reviewer wdt:P856 ?website. }
  OPTIONAL { ?reviewer wdt:P496 ?orcid_. BIND(IRI(CONCAT("https://orcid.org/", ?orcid_)) AS ?orcid). }
  OPTIONAL { ?reviewer wdt:P2002 ?twitter_. BIND(IRI(CONCAT("https://twitter.com/", ?twitter_)) AS ?twitter). }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?reviewer ?reviewerLabel
ORDER BY RAND()

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?field") v11("?orcid"):::projected v7("?orcid_") v4("?reviewer"):::projected v3("?subField") v11("?twitter"):::projected v9("?twitter_") v11("?website"):::projected v5("?work") v1("?workDate") a1((" ")) c16(["en"]):::literal c14(["bd:serviceParam"]):::iri c4(["wd:Q5"]):::iri f0[["?workDate > NOW() - 'P5Y^^xsd:duration'"]] f0 --> v1 bind1[/"'wd:Q21198'"/] bind1 --as--o v2 v3 --"wdt:P279"--> v2 v4 --"wdt:P31"--> c4 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v4 --"wdt:P570"--> a1 end v5 --"wdt:P50"--> v4 v5 --"wdt:P577"--> v1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v4 --"wdt:P101"--> v3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v5 --"wdt:P921"--> v3 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P856".-> v11 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P496".-> v7 bind3[/"concat('https://orcid.org/',?orcid_)"/] v7 --o bind3 bind3 --as--o v11 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P2002".-> v9 bind4[/"concat('https://twitter.com/',?twitter_)"/] v9 --o bind4 bind4 --as--o v11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end bind8[/"sample(?website)"/] v11 --o bind8 bind8 --as--o v11 bind9[/"sample(?orcid)"/] v11 --o bind9 bind9 --as--o v11 bind10[/"sample(?twitter)"/] v11 --o bind10 bind10 --as--o v11