Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In topic aspect, add table with oldest publications #727

Open
Daniel-Mietchen opened this issue May 26, 2019 · 0 comments

Comments

1 participant
@Daniel-Mietchen
Copy link
Collaborator

commented May 26, 2019

Here is a suitable query, basically the same as the existing one for most recent publications, just with inverted sort order:

SELECT ?date ?work ?workLabel ?topics
WITH {
  SELECT DISTINCT ?work WHERE {
    ?work wdt:P921 / (wdt:P361+ | wdt:P1269+ | (wdt:P31* / wdt:P279*) ) wd:Q202864 .
  }
} AS %works
WITH {
  SELECT (MAX(?dates) as ?datetime) ?work (GROUP_CONCAT(?topic_label; separator=" // ") AS ?topics) WHERE {
    INCLUDE %works
    ?work wdt:P921 ?topic . 
    ?work wdt:P577 ?dates . 
    ?topic rdfs:label ?topic_label .  FILTER (lang(?topic_label) = 'en')
  }
  GROUP BY ?work
} AS %result
WHERE {
  INCLUDE %result

  # There is a problem with BC dates
  # BIND(xsd:date(?datetime) AS ?date)
  BIND(REPLACE(STR(?datetime), 'T.*', '') AS ?date)
    
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,da,de,es,fr,jp,nl,no,ru,sv,zh". }
}
ORDER BY ASC(?date)
LIMIT 500

@Daniel-Mietchen Daniel-Mietchen added this to To do in Topics via automation May 26, 2019

@Daniel-Mietchen Daniel-Mietchen added this to To do in Authors via automation May 26, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.