govdirectory / website

Website repository for Govdirectory - a crowdsourced and fact-checked directory of official governmental online accounts and services.
https://govdirectory.org
Creative Commons Zero v1.0 Universal
46 stars 31 forks source link

Add additional information about organizations #79

Closed Abbe98 closed 3 years ago

Abbe98 commented 3 years ago

Display all information as per the Penpot designs. Also, all optional information to not be a part of the generator queries so that the generators can be simplified and flushed separately.

Abbe98 commented 3 years ago
Abbe98 commented 3 years ago

Parent organization is covered by #80 as it's rather complex.

Abbe98 commented 3 years ago
SELECT
  # note that SAMPLE in Blazegraph always picks the first object
  (SAMPLE(?website) AS ?website)
  (SAMPLE(?email) AS ?email)
  (SAMPLE(?citizensInitiatives ) AS ?citizensInitiatives)
  (SAMPLE(?regulatoryText ) AS ?regulatoryText)
  (SAMPLE(?regulatoryTextTitle ) AS ?regulatoryTextTitle)
  (SAMPLE(?personLabel) AS ?leadBy)
  ?wikipedia
WHERE {
  BIND(wd:Q631844 AS ?org)

  OPTIONAL { ?org wdt:P856 ?website }
  OPTIONAL { ?org wdt:P968 ?email }
  OPTIONAL { ?org wdt:P9732 ?citizensInitiatives }

  OPTIONAL {
    ?org wdt:P92 ?regulatoryTextItem .
    ?regulatoryTextItem wdt:P953 ?regulatoryText ;
                        wdt:P1476 ?regulatoryTextTitle .
  }

  OPTIONAL {
    ?org wdt:P2388|wdt:P1313 ?office .
    ?positionStatement ps:P39 ?office .
    ?person p:P39 ?positionStatement .
    MINUS { ?positionStatement pq:P582 ?endtime }
  }

  OPTIONAL {
    ?wikipedia schema:about ?org ;
               schema:inLanguage "en" .
  }

  SERVICE wikibase:label {
    # this might need to be updated when new countries are added
    bd:serviceParam wikibase:language "en,sv" .
    ?person rdfs:label ?personLabel .
  }
} GROUP BY ?wikipedia