Wikidata icon

Wikidata

Wikidata is a free and open knowledge base that can be read and edited by both humans and machines

Query → Get

AI-generated

Overview

This node allows users to execute SPARQL queries against the Wikidata knowledge base. It is useful for retrieving structured data from Wikidata by specifying custom SPARQL queries. Typical use cases include fetching information about entities, relationships, or any data modeled in Wikidata's RDF format.

For example, a user might query for all cities with a population greater than 1 million or retrieve details about a specific historical figure. The node sends the SPARQL query to the specified Wikibase server and returns the results in JSON format.

Properties

Name Meaning
Server The URL of the Wikibase server to which the SPARQL query will be sent. Default is https://query.wikidata.org.
SPARQL Query The SPARQL query string to execute on the Wikibase server.

Output

The output is a JSON array where each element corresponds to a binding (result row) returned by the SPARQL query. Each binding contains key-value pairs representing variables selected in the query along with their values and types as provided by the Wikidata SPARQL endpoint.

No binary data is produced by this node.

Dependencies

  • Requires access to a Wikibase SPARQL endpoint, typically the public Wikidata query service.
  • No special API keys or authentication tokens are needed since the default endpoint is publicly accessible.
  • The node uses standard HTTP GET requests with an Accept: application/json header to fetch query results.

Troubleshooting

  • Common issues:

    • Malformed SPARQL queries will cause errors. Ensure your query syntax is correct.
    • Network connectivity problems or incorrect server URLs can lead to request failures.
    • Large or complex queries may time out or return incomplete results.
  • Error messages:

    • If the node throws an error related to the request, verify the server URL and network connection.
    • SPARQL syntax errors will usually be reported by the Wikibase server; check the query carefully.
    • If the node is set to continue on fail, it will return the error alongside the input data for easier debugging.

Links and References

Discussion