Wikidata:Synia:eiareport

From Wikidata
Jump to navigation Jump to search

Synia: Environmental impact assessment report

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q113616501>

SELECT DISTINCT
  ?description ?descriptionUrl

  ?value ?valueUrl

  ?wikidata ?wikidataUrl
WHERE {
  BIND(target: AS ?work)
  {
    BIND(1 AS ?order)
    BIND("Title" AS ?description)
    ?work wdt:P1476 ?value .
    BIND("Wikidata ↗" AS ?wikidata)
    BIND(CONCAT("https://www.wikidata.org/wiki/", SUBSTR(STR(target:), 32)) AS ?wikidataUrl)
  }
  UNION
  {
    SELECT
      (2 AS ?order)
      ("Authors" AS ?description)
      (GROUP_CONCAT(?value_; separator=", ") AS ?value)
      # (CONCAT("#authors/", GROUP_CONCAT(?q; separator=",")) AS ?valueUrl)
    {
      BIND(1 AS ?dummy)
      target: wdt:P50 ?iri .
      BIND(SUBSTR(STR(?iri), 32) AS ?q) 
      ?iri rdfs:label ?value_string . 
      FILTER (LANG(?value_string) = 'en')
      BIND(COALESCE(?value_string, ?q) AS ?value_)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    SELECT
      (3 AS ?order)
      ("Editors" AS ?description)
      (GROUP_CONCAT(?value_; separator=", ") AS ?value)
      # (CONCAT("#authors/", GROUP_CONCAT(?q; separator=",")) AS ?valueUrl)
    {
      BIND(1 AS ?dummy)
      target: wdt:P98 ?iri .
      BIND(SUBSTR(STR(?iri), 32) AS ?q) 
      ?iri rdfs:label ?value_string . 
      FILTER (LANG(?value_string) = 'en')
      BIND(COALESCE(?value_string, ?q) AS ?value_)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    SELECT
      (3 AS ?order)
      ("Reviewers" AS ?description)
      (GROUP_CONCAT(?value_; separator=", ") AS ?value)
      # (CONCAT("#authors/", GROUP_CONCAT(?q; separator=",")) AS ?valueUrl)
    {
      BIND(1 AS ?dummy)
      target: wdt:P4032 ?iri .
      BIND(SUBSTR(STR(?iri), 32) AS ?q) 
      ?iri rdfs:label ?value_string . 
      FILTER (LANG(?value_string) = 'en')
      BIND(COALESCE(?value_string, ?q) AS ?value_)
    }
    GROUP BY ?dummy
  }
  UNION
  {
 
    BIND(3.5 AS ?order)
    
    BIND("#language" AS ?descriptionUrl)
    BIND("Language" AS ?description)
    ?work wdt:P407 ?iri .
    BIND(SUBSTR(STR(?iri), 32) AS ?q) 
    ?iri rdfs:label ?value_string .
    FILTER (LANG(?value_string) = 'en')
    BIND(STR(?value_string) AS ?value)
    BIND(CONCAT("#language/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(4 AS ?order)
    BIND("Published in" AS ?description)
    ?work wdt:P1433 ?iri .
    BIND(SUBSTR(STR(?iri), 32) AS ?q) 
    ?iri rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, ?q) AS ?value)
    BIND(CONCAT("#venue/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(4 AS ?order)
    BIND("Series" AS ?description)
    ?work wdt:P179 ?iri .
    BIND(SUBSTR(STR(?iri), 32) AS ?q) 
    ?iri rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, ?q) AS ?value)
    BIND(CONCAT("#series/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(6 AS ?order)
    BIND("Publication date" AS ?description)
    ?work p:P577 / psv:P577 ?publication_date_value .
    ?publication_date_value wikibase:timePrecision ?time_precision ;
                            wikibase:timeValue ?publication_date .
    BIND(IF(?time_precision = 9, YEAR(?publication_date), xsd:date(?publication_date)) AS ?value)
  }
  UNION
  {
    BIND(7 AS ?order)
    BIND("Publisher" AS ?description)
    ?work wdt:P123 ?iri .
    BIND(SUBSTR(STR(?iri), 32) AS ?q) 
    ?iri rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, ?q) AS ?value)
    BIND(CONCAT("#publisher/", ?q) AS ?valueUrl)
  }
  UNION
  {
    SELECT
      (8 AS ?order)
      ("Topics" AS ?description)
      (GROUP_CONCAT(?value_; separator=", ") AS ?value)
      # (CONCAT("#topics/", GROUP_CONCAT(?q; separator=",")) AS ?valueUrl)
    {
      BIND(1 AS ?dummy)
      target: wdt:P921 ?iri .
      BIND(SUBSTR(STR(?iri), 32) AS ?q) 
      ?iri rdfs:label ?value_string . 
      FILTER (LANG(?value_string) = 'en')
      BIND(COALESCE(?value_string, ?q) AS ?value_)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    SELECT
      (9 AS ?order)
      ("Uses" AS ?description)
      (GROUP_CONCAT(?value_; separator=", ") AS ?value)
      # (CONCAT("#uses/", GROUP_CONCAT(?q; separator=",")) AS ?valueUrl)
    {
      BIND(1 AS ?dummy)
      target: wdt:P4510 ?iri .
      BIND(SUBSTR(STR(?iri), 32) AS ?q) 
      ?iri rdfs:label ?value_string . 
      FILTER (LANG(?value_string) = 'en')
      BIND(COALESCE(?value_string, ?q) AS ?value_)
    }
    GROUP BY ?dummy
  }
  UNION
  {
    BIND(10 AS ?order)
    BIND("DOI" AS ?description)
    ?work wdt:P356 ?valueUrl_ .
    BIND(CONCAT("https://doi.org/", ENCODE_FOR_URI(?valueUrl_)) AS ?valueUrl)
    BIND(CONCAT(?valueUrl_, " ↗") AS ?value)
  }
  UNION
  {
    BIND(11 AS ?order)
    BIND("Homepage" AS ?description)
    ?work wdt:P856 ?valueUrl .
    BIND(STR(?valueUrl) AS ?value)
  }
  UNION
  {
    BIND(12 AS ?order)
    BIND("Full text" AS ?description)
    ?work wdt:P953 ?valueUrl .
    BIND(CONCAT(STR(?valueUrl), " ↗") AS ?value)
  }
  UNION
  {
    BIND(13 AS ?order)
    BIND("🛑 Retracted" AS ?description)
    { ?work wdt:P31 wd:Q45182324 . }
    UNION
    { ?work wdt:P793 wd:Q7316896 . }
  }
  UNION
  {
    BIND(14 AS ?order)
    BIND("🛑 Retracted by" AS ?description)
    ?work wdt:P5824 ?iri .
    BIND(SUBSTR(STR(?iri), 32) AS ?q) 
    ?iri rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, ?q) AS ?value)
    BIND(CONCAT("#work/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(15 AS ?order)
    BIND("⚠️ Preprint" AS ?description)
    { ?work p:P31 ?statement . ?statement ps:P31 wd:Q580922 . MINUS { ?statement pq:P642 [] } }
  }
  UNION
  {
    SELECT (COUNT(DISTINCT ?citationStatement) AS ?value) ?order ?description ?valueUrl WHERE {
      VALUES ?work { wd:Q117221094 }
      VALUES ?intention { wd:Q96472102 wd:Q101149476 }
      ?work ^ps:P2860 ?citationStatement . ?citationStatement pq:P3712 ?intention .
      BIND(20 AS ?order)
      BIND("Data or method used by" AS ?description)
      BIND("#work/Q117221094/cito" AS ?valueUrl)
    } GROUP BY ?order ?description ?valueUrl
  }
  UNION
  {
    SELECT (COUNT(DISTINCT ?citationStatement) AS ?value) ?order ?description ?valueUrl WHERE {
      VALUES ?work { wd:Q117221094 }
      VALUES ?intention { wd:Q107687829 wd:Q107710355 }
      ?work ^ps:P2860 ?citationStatement . ?citationStatement pq:P3712 ?intention .
      BIND(21 AS ?order)
      BIND("Disagreed with by" AS ?description)
      BIND("#work/Q117221094/cito" AS ?valueUrl)
    } GROUP BY ?order ?description ?valueUrl
  }
  UNION
  {
    BIND(30 AS ?order)
    BIND("⚠️ Preprint of" AS ?description)
    { ?work p:P31 ?statement .
      ?statement pq:P642 ?pub ; ps:P31 wd:Q580922 .
    BIND(SUBSTR(STR(?pub), 32) AS ?pubqid) 
    ?pub rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(COALESCE(?value_string, ?pubqid) AS ?value)
    BIND(CONCAT("#work/", ?pubqid) AS ?valueUrl)}
  }
  UNION
  {
    BIND(31 AS ?order)
    BIND("⚠️ Cites retracted article" AS ?description)
    { ?work wdt:P2860 ?retracted . ?retracted wdt:P31 wd:Q45182324 . }
    UNION
    { ?work wdt:P2860 ?retracted . ?retracted wdt:P793 wd:Q7316896 . }
    UNION
    { ?work wdt:P2860 ?retracted . ?retracted wdt:P5824 [] . }
    ?retracted rdfs:label ?value_string . 
    FILTER (LANG(?value_string) = 'en')
    BIND(SUBSTR(STR(?retracted), 32) AS ?q) 
    BIND(COALESCE(?value_string, ?q) AS ?value)
    BIND(CONCAT("#work/", ?q) AS ?valueUrl)
  }
  UNION
  {
    BIND(40 AS ?order) 
    BIND("Number of pages" AS ?description)
    ?work wdt:P1104 ?value .
  }
  UNION
  {
    BIND(50 AS ?order)
    BIND("Miljøportal" AS ?description)
    ?work wdt:P10930 ?value_ .
    BIND(CONCAT(STR(?value_), " ↗") AS ?value)
    BIND(CONCAT("https://daieproddreamspdfsto.blob.core.windows.net/files/", STR(?value_)) AS ?valueUrl)
  }
} 
ORDER BY ?order
Try it!

Map

[edit]
#defaultView:Map
PREFIX target: <http://www.wikidata.org/entity/Q110954128>

SELECT 
  ?topic ?topicLabel 
  ?geo
WHERE {
  target: wdt:P921 ?topic .
  ?topic wdt:P625 ?geo .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }     
}
Try it!

Topics

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q113616501>

SELECT
  ?score
  ?topic ?topicLabel
  (CONCAT("#topic/", SUBSTR(STR(?topic), 32)) AS ?topicUrl)
  ?topicDescription
WITH {
  SELECT
    (SUM(?score_) AS ?score)
    ?topic
  WHERE {
    { 
      target: wdt:P921 ?topic .
      BIND(20 AS ?score_)
    }
    UNION
    { 
      target: wdt:P921 / wdt:P31 ?topic .
      BIND(5 AS ?score_)
    }
    UNION
    { 
     target: wdt:P921/wdt:P279 ?topic .
     BIND(3 AS ?score_)
    }
    UNION
    {
      # Topic of a cited work
      target: wdt:P2860/wdt:P921 ?topic .
      BIND(1 AS ?score_)
    }
    UNION
    {
      SELECT (1 AS ?score_) ?topic WHERE {
        ?citing_work wdt:P2860 target: .
        ?citing_work wdt:P921 ?topic . 
      }
    }
  }
  GROUP BY ?topic
} AS %results 
WHERE {
  INCLUDE %results
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,da,de,es,jp,no,ru,sv,zh". }
}
ORDER BY DESC(?score)
LIMIT 200
Try it!
[edit]
PREFIX target: <http://www.wikidata.org/entity/Q110954128>

SELECT 
  ?score
  
  ?work ?workLabel
  (CONCAT("#work/", SUBSTR(STR(?work), 32)) AS ?workUrl)
  ?workDescription

  ("Wikidata&nbsp;↗" AS ?wikidata)
  (CONCAT("https://www.wikidata.org/wiki/", SUBSTR(STR(?work), 32)) AS ?wikidataUrl)

  ("Scholia&nbsp;↗" AS ?scholia)
  (CONCAT("https://scholia.toolforge.org/work/", SUBSTR(STR(?work), 32)) AS ?scholiaUrl)
WITH {  
  SELECT 
    (COUNT(*) AS ?score)
    ?work
  WHERE {
    target: (^wdt:P2860 | wdt:P2860) / (^wdt:P2860 | wdt:P2860)? ?work .
    FILTER (target: != ?work)
  }
  GROUP BY ?work
  ORDER BY DESC(?count)
  LIMIT 500
} AS %works
WHERE {
  INCLUDE %works
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }     
}
ORDER BY DESC(?score) DESC(?titleUrl)
Try it!