Wikidata + GraphQL
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
scripts
src
.babelrc
.gitignore
LICENSE.txt
README.md
config.json
package
package.json
schema.js
yarn.lock

README.md

Wikidata + GraphQL: Dream API In 2017

Example query 1:

Get the all members of the Beatles and where they were born and their twitter username.

(permalink for this query at http://bit.ly/2eXTmbG )

{
  entity(id: "Q1299") {
    label(lang: "en")
    has_part {
      mainsnak {
        label(lang: "en")
        award_received {
          mainsnak {
            label(lang: "en")
          }
        }
        place_of_birth {
          mainsnak {
            label(lang: "en")
          }
        }
        twitter_username {
          mainsnak
        }
      }
    }
  }
}

Example query 2

Get China's all past head_of_government, and where they educated_at, and what other positions they've held before.

(permalink for this query at http://bit.ly/2xmxaT1 )

{
  entity(id: "Q148") {
    label(lang: "en")
    head_of_government {
      mainsnak {
        label(lang: "en")
        educated_at {
          mainsnak {
            id
            label(lang: "en")
          }
        }
        position_held {
         	mainsnak {
            label(lang: "en")
          }
        }
      }
    }
  }
}

TODOS

  1. need add reference and qualifiers
  2. support search entities
  3. other datatype like Time and Media, Geographic object to the graphql schema
  4. and maybe thing to help make some of reverse lookup possible