title:
  "Get PubMed info for a PMID."
description:
  "Get title, author, journal, and date by PMID."
endpoint:
  "https://query.wikidata.org/sparql"
variables:
  - name: pmid
    comment: The intended PMID, just the local part.
query: >
  PREFIX wd: <http://www.wikidata.org/entity/>
  PREFIX wdt: <http://www.wikidata.org/prop/direct/>

  SELECT ?rtcl ?title ?author ?journal ?date
  WHERE
  {
    ?rtcl wdt:P698 "{{ pmid }}".
    OPTIONAL { ?rtcl wdt:P1476 ?title. }
    OPTIONAL { ?rtcl wdt:P2093 ?author. }
    OPTIONAL { ?rtcl wdt:P1433 ?journal. }
    OPTIONAL { ?rtcl wdt:P577 ?date. }
  }
