How to use the wikidata-sdk/dist/wikidata-sdk.js.simplifyClaims function in wikidata-sdk

To help you get started, we’ve selected a few wikidata-sdk examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github benjamintd / benmaps.fr / src / middlewares / apiCaller.js View on Github external
.then(data => {
      // Success
      const entity = data.entities[id];
      const claims = wdk.simplifyClaims(entity.claims);
      const description = entity.descriptions.en.value;
      const label = entity.labels.en.value;
      next({
        type: "SET_STATE_VALUE",
        key: "placeInfo",
        value: {
          description,
          label,
          image: getWikiMediaImageUrl(_.get(claims, "P18[0]")),
          phoneNumber: _.get(claims, "P1329[0]"),
          website: _.get(claims, "P856[0]"),
          address: _.get(claims, "P969[0]"),
          wikidata: id
        }
      });
    })