Skip to content

Wikipedia

Connect Wikipedia articles with Wikidata statements and graph queries from SQL

Connector software
Free and open source
Service credentials
Not needed
Use with an agent

Install the Orchard skill in your project to help your agent find connectors, configure them, and verify SQL results.

npx skills add Query-farm/vgi-skills --skill orchard

Copy this request into your coding agent to get started.

Use https://query.farm/products/orchard/connectors/wikipedia/index.md to help me query Wikipedia with DuckDB or Haybarn 2.0.1 and VGI protocol 3.4. Ask only for missing details about the result I need or whether I want local execution, self-hosting or Query Farm hosting. Check the connector's actual hosting availability, credentials and input requirements. Read one format of each needed reference and the exact object declarations before writing SQL. Use a released connector, and distinguish a saved example result from anything you actually execute. If you cannot run the query, tell me what remains to verify.

Full-text search English Wikipedia for 'apache arrow' (top 10).

Example output · captured
Connector release
v0.6.0
Engine
2.0.1
VGI protocol
3.4.0
SELECT title, snippet, url
FROM wiki.main.wiki_search('apache arrow', lang := 'en', count := 10)
Result · first 5 rows
title snippet url
Apache Arrow Free and open-source software portal Apache Arrow is a language-agnostic softwa… https://en.wikipedia.org/wiki/Apache_Arrow
Apache Parquet open-source software portal Apache Arrow Apache Pig Apache Hive Apache Impala A… https://en.wikipedia.org/wiki/Apache_Parquet
Data orientation processing (OLAP). Examples of column-oriented formats include Apache ORC, Apac… https://en.wikipedia.org/wiki/Data_orientation
Apache DataFusion Apache DataFusion is an open-source, extensible analytical query engine written… https://en.wikipedia.org/wiki/Apache_DataFusion
Wes McKinney the reference book Python for Data Analysis. He is also the creator of Apache A… https://en.wikipedia.org/wiki/Wes_McKinney

Quick start

Choose where to run Wikipedia, then follow the steps below.

The connector runs alongside DuckDB or Haybarn. No Query Farm account is needed.

1. Install the vgi extension

Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.

setup.sql
SET allow_extension_repositories = 'allowed';

CREATE EXTENSION REPOSITORY IF NOT EXISTS query_farm
    WITH PREFIX 'https://duckdb-extensions.query.farm';

INSTALL vgi FROM query_farm;
LOAD vgi FROM query_farm;

2. Attach the connector

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'wiki' AS wiki (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-wikipedia-worker'
);

3. Run a query

query.sql
SELECT title, snippet, url
FROM wiki.main.wiki_search('apache arrow', lang := 'en', count := 10)
More example queries →
Technical details
Verified connector release
v0.6.0
Engine
2.0.1
VGI protocol
3.4.0
Verified on
December 1, 2026
Release notes on GitHub
Pin a version for production

When running the connector yourself, keep a specific release until you’re ready to upgrade. Replace the ATTACH statement above with this one and follow the same extension and credential setup.

Attach with uvx

Needs uv. uvx builds the worker from its release tag on first attach and reuses the cached environment after that.

ATTACH 'wiki' AS wiki (
  TYPE vgi,
  LOCATION 'uvx --from git+https://github.com/Query-farm/[email protected] vgi-wikipedia-worker'
);

Overview

Wikipedia articles, Wikidata statements and graph queries for SQL

Catalog

Everything wiki exposes once attached — read straight from the worker's released build.

wiki 2 schemas
main 4 functions

Wikipedia / MediaWiki full-text search and page retrieval for SQL / RAG

Schema examples (5)
Examples (5)

Full-text search English Wikipedia for 'apache arrow' (top 10).

SELECT title, snippet, url
FROM wiki.main.wiki_search('apache arrow', lang := 'en', count := 10);
Result · first 5 rows
title snippet url
Apache Arrow Free and open-source software portal Apache Arrow is a language-agnostic softwa… https://en.wikipedia.org/wiki/Apache_Arrow
Apache Parquet open-source software portal Apache Arrow Apache Pig Apache Hive Apache Impala A… https://en.wikipedia.org/wiki/Apache_Parquet
Data orientation processing (OLAP). Examples of column-oriented formats include Apache ORC, Apac… https://en.wikipedia.org/wiki/Data_orientation
Apache DataFusion Apache DataFusion is an open-source, extensible analytical query engine written… https://en.wikipedia.org/wiki/Apache_DataFusion
Wes McKinney the reference book Python for Data Analysis. He is also the creator of Apache A… https://en.wikipedia.org/wiki/Wes_McKinney

Fetch the English Wikipedia summary extract for the DuckDB article.

SELECT wiki.main.wiki_page('DuckDB');

Fetch the rich English summary row (title, extract, url) for DuckDB.

SELECT title, extract, url
FROM wiki.main.wiki_page_summary('DuckDB', lang := 'en');

Search English Wikipedia for 'apache arrow' and fetch the lead-paragraph summary of each of the top 3 matching articles with the wiki_page scalar

SELECT h.title, wiki.main.wiki_page(h.title) AS summary
FROM wiki.main.wiki_search('apache arrow', count := 3) AS h
ORDER BY h.title;
1 more example

Ground an article for RAG: the English summary extract and URL of the DuckDB article joined by page ID to the Wikidata item that article is linked to

SELECT s.title, e.entity_id, s.url, s.extract
FROM wiki.main.wiki_page_summary('DuckDB') AS s
JOIN wiki.main.wiki_entity('DuckDB') AS e USING (pageid)
ORDER BY s.title;
Scalar functions
wiki_page (title VARCHAR, lang VARCHAR) +1 overload 5 examples

Plain-text summary extract of an English Wikipedia page (NULL if missing)

Arguments
title VARCHAR
Page title to fetch.
lang VARCHAR
Wiki language code, e.g. 'en' or 'de'.
Overloads
wiki_page(title VARCHAR) → VARCHARwiki_page(title VARCHAR, lang VARCHAR) → VARCHAR
ReturnsVARCHAR
Examples (5)

The English Wikipedia summary of DuckDB

SELECT wiki.main.wiki_page('DuckDB');

The German Wikipedia summary of DuckDB

SELECT wiki.main.wiki_page('DuckDB', 'de');
SELECT wiki.main.wiki_page('DuckDB') AS summary;
2 more examples
SELECT wiki.main.wiki_page('DuckDB', 'de') AS summary;
SELECT wiki.main.wiki_page('ThisPageDoesNotExist_zzz') IS NULL AS is_null;
Link
Table functions
wiki_entity (title VARCHAR, api_url := VARCHAR, cache_seconds := BIGINT, lang := VARCHAR, max_bytes := BIGINT, max_rows := BIGINT, timeout_ms := BIGINT) 2 examples

Resolve a Wikipedia article to its Wikidata identity

Positional arguments
title VARCHAR
Wikipedia/MediaWiki article title; redirects are resolved.
Named arguments
api_url := VARCHAR
MediaWiki Action API override; uses VGI_WIKIPEDIA_API_URL by default. · default ""
cache_seconds := BIGINT
Maximum process-local cached response age; zero bypasses cache. · default 300
lang := VARCHAR
Wikipedia language edition. · default "en"
max_bytes := BIGINT
Combined response bytes and Arrow snapshot ceiling. · default 16777216
max_rows := BIGINT
Result row ceiling; overflow fails explicitly. · default 10000
timeout_ms := BIGINT
Operation request/retry budget in milliseconds; checked between reads. · default 30000
Returns columns
title VARCHAR
Resolved article title after normalization and redirects.
pageid BIGINT
MediaWiki page ID.
entity_id VARCHAR
Associated wikibase_item ID; NULL if the article has none.
url VARCHAR
Canonical article URL.
lang VARCHAR
Requested wiki language.
Examples (2)

Resolve a Wikipedia article to its Wikidata identity

SELECT title, entity_id
FROM wiki.main.wiki_entity('Douglas Adams')
ORDER BY title;

Ground an article for RAG: the English summary extract and URL of the DuckDB article joined by page ID to the Wikidata item that article is linked to

SELECT s.title, e.entity_id, s.url, s.extract
FROM wiki.main.wiki_page_summary('DuckDB') AS s
JOIN wiki.main.wiki_entity('DuckDB') AS e USING (pageid)
ORDER BY s.title;
Link
wiki_page_summary (title VARCHAR, api_url := VARCHAR, lang := VARCHAR) 3 examples

Page summary as a row: title, extract, url, thumbnail_url, pageid

Positional arguments
title VARCHAR
The page title to fetch.
Named arguments
api_url := VARCHAR
Override the MediaWiki api.php URL; default Wikipedia. · default ""
lang := VARCHAR
Wiki language code (default 'en'). · default "en"
Returns columns
title VARCHAR
Resolved page title.
extract VARCHAR
Plain-text summary extract.
url VARCHAR
Canonical page URL.
thumbnail_url VARCHAR
Thumbnail image URL, if any (else NULL).
pageid BIGINT
MediaWiki page id.
Examples (3)

The English Wikipedia summary row for DuckDB

SELECT title, extract, url
FROM wiki.main.wiki_page_summary('DuckDB', lang := 'en');
SELECT title, url, pageid
FROM wiki.main.wiki_page_summary('DuckDB', lang := 'en');
SELECT count(*) AS n
FROM wiki.main.wiki_page_summary('ThisPageDoesNotExist_zzz');
Link
wikidata 6 functions

Structured Wikibase knowledge and remote graph queries

Schema examples (4)
Examples (4)

Retrieve Wikidata entities in batches

SELECT entity_id, label
FROM wiki.wikidata.entity(['Q42'])
ORDER BY entity_id;

Douglas Adams's (Q42) best-ranked birth/death dates and places (places as item IDs), each labelled with its property's human-readable name by joining statements to the property entities

SELECT p.label AS property,
  coalesce(s.value.time, s.value.entity_id) AS value
FROM wiki.wikidata.statements(['Q42'], rank := 'best') AS s
JOIN wiki.wikidata.entity(['P19', 'P20', 'P569', 'P570']) AS p ON s.property_id = p.entity_id
ORDER BY s.property_id;

Each spouse (P26) of Douglas Adams (Q42) with that statement's qualifiers, such as the P580 start time and P582 end time of the marriage

SELECT s.value.entity_id AS spouse, q.property_id AS qualifier,
  coalesce(q.value.time, q.value.entity_id) AS qualifier_value
FROM wiki.wikidata.statements(['Q42'], property_id := 'P26') AS s
JOIN wiki.wikidata.qualifiers(['Q42'], property_id := 'P26') AS q USING (source_api, entity_revision, requested_id, statement_id)
ORDER BY spouse, qualifier;

How many distinct reference groups (sources) back each of Douglas Adams's (Q42) instance-of (P31) statements; statements with no source count 0

SELECT s.statement_id, s.value.entity_id AS class,
  count(DISTINCT r.reference_hash) AS sources
FROM wiki.wikidata.statements(['Q42'], property_id := 'P31') AS s
LEFT JOIN wiki.wikidata.statement_references(['Q42'], property_id := 'P31') AS r USING (source_api, entity_revision, requested_id, statement_id)
GROUP BY s.statement_id, class
ORDER BY s.statement_id;
Table functions
entity (ids VARCHAR[], api_url := VARCHAR, cache_seconds := BIGINT, lang := VARCHAR, max_bytes := BIGINT, max_rows := BIGINT, timeout_ms := BIGINT) 1 example

Retrieve Wikidata entities in batches

Positional arguments
ids VARCHAR[]
One to 500 Q/P IDs; duplicates are fetched once.
Named arguments
api_url := VARCHAR
Wikibase Action API override; defaults to VGI_WIKIDATA_API_URL or Wikidata. · default ""
cache_seconds := BIGINT
Maximum process-local cached response age; zero bypasses cache. · default 300
lang := VARCHAR
Requested language; labels/aliases may use shared mul values, with actual language returned. · default "en"
max_bytes := BIGINT
Combined response bytes and Arrow snapshot ceiling. · default 16777216
max_rows := BIGINT
Result row ceiling; overflow fails explicitly. · default 10000
timeout_ms := BIGINT
Operation request/retry budget in milliseconds; checked between reads. · default 30000
Returns columns
requested_id VARCHAR
Requested ID, before entity redirects.
entity_id VARCHAR
Canonical Wikibase entity ID.
entity_revision BIGINT
Entity revision returned by the API; use when joining snapshots.
source_api VARCHAR
Wikibase API supplying this row.
missing BOOLEAN
True when the requested entity does not exist.
label VARCHAR
Label in the requested language, falling back only to the shared mul label.
label_language VARCHAR
Actual label language, including mul for a shared label.
description VARCHAR
Description in the requested language.
aliases VARCHAR[]
Aliases in the requested language, falling back only to shared mul aliases.
aliases_language VARCHAR
Actual aliases language; NULL if no aliases are available.
modified VARCHAR
Original entity modification timestamp.
sitelinks_json VARCHAR
Complete sitelink map as JSON.
Example

Retrieve Wikidata entities in batches

SELECT entity_id, label
FROM wiki.wikidata.entity(['Q42'])
ORDER BY entity_id;
Link
qualifiers (ids VARCHAR[], api_url := VARCHAR, cache_seconds := BIGINT, lang := VARCHAR, max_bytes := BIGINT, max_rows := BIGINT, property_id := VARCHAR, rank := VARCHAR, timeout_ms := BIGINT) 2 examples

Read contextual qualifiers attached to Wikidata statements

Positional arguments
ids VARCHAR[]
One to 500 Q/P IDs; duplicates are fetched once.
Named arguments
api_url := VARCHAR
Wikibase Action API override; defaults to VGI_WIKIDATA_API_URL or Wikidata. · default ""
cache_seconds := BIGINT
Maximum process-local cached response age; zero bypasses cache. · default 300
lang := VARCHAR
Requested language; labels/aliases may use shared mul values, with actual language returned. · default "en"
max_bytes := BIGINT
Combined response bytes and Arrow snapshot ceiling. · default 16777216
max_rows := BIGINT
Result row ceiling; overflow fails explicitly. · default 10000
property_id := VARCHAR
Main statement P ID to select; empty means all properties. · default ""
rank := VARCHAR
all; nondeprecated excludes deprecated; best selects preferred or otherwise normal per property. · default "all"
timeout_ms := BIGINT
Operation request/retry budget in milliseconds; checked between reads. · default 30000
Returns columns
requested_id VARCHAR
Requested ID, before entity redirects.
entity_id VARCHAR
Canonical Wikibase entity ID.
entity_revision BIGINT
Entity revision returned by the API; use when joining snapshots.
source_api VARCHAR
Wikibase API supplying this row.
statement_id VARCHAR
Statement that this qualifier qualifies.
statement_property_id VARCHAR
Main property of the qualified statement.
qualifier_index BIGINT
Zero-based position within this qualifier property.
qualifier_hash VARCHAR
Upstream qualifier hash, if supplied.
property_id VARCHAR
Wikibase property ID.
snak_type VARCHAR
value, somevalue (unknown), or novalue (explicitly no value).
datatype VARCHAR
Wikibase property datatype.
value STRUCT of 18 fields
Typed value components and lossless raw JSON; NULL for somevalue/novalue.
STRUCT 18 fields
  • entity_idVARCHAR
  • textVARCHAR
  • languageVARCHAR
  • timeVARCHAR
  • time_precisionINTEGER
  • timezoneINTEGER
  • beforeBIGINT
  • afterBIGINT
  • calendar_modelVARCHAR
  • amountVARCHAR
  • lower_boundVARCHAR
  • upper_boundVARCHAR
  • unitVARCHAR
  • latitudeDOUBLE
  • longitudeDOUBLE
  • coordinate_precisionDOUBLE
  • globeVARCHAR
  • raw_jsonVARCHAR
Examples (2)

Read contextual qualifiers attached to Wikidata statements

SELECT statement_property_id, count(*) AS qualifiers
FROM wiki.wikidata.qualifiers(['Q42'])
GROUP BY statement_property_id
ORDER BY statement_property_id;

Each spouse (P26) of Douglas Adams (Q42) with that statement's qualifiers, such as the P580 start time and P582 end time of the marriage

SELECT s.value.entity_id AS spouse, q.property_id AS qualifier,
  coalesce(q.value.time, q.value.entity_id) AS qualifier_value
FROM wiki.wikidata.statements(['Q42'], property_id := 'P26') AS s
JOIN wiki.wikidata.qualifiers(['Q42'], property_id := 'P26') AS q USING (source_api, entity_revision, requested_id, statement_id)
ORDER BY spouse, qualifier;
Link
sparql (query VARCHAR, cache_seconds := BIGINT, endpoint_url := VARCHAR, max_bytes := BIGINT, max_rows := BIGINT, timeout_ms := BIGINT) 1 example

Query Wikidata relationships with read-only SPARQL

Positional arguments
query VARCHAR
Complete SPARQL SELECT or ASK query; updates and graph-result forms are rejected.
Named arguments
cache_seconds := BIGINT
Maximum process-local cached response age; zero bypasses cache. · default 300
endpoint_url := VARCHAR
SPARQL query endpoint override; uses VGI_WIKIDATA_SPARQL_URL or WDQS. · default ""
max_bytes := BIGINT
Combined response bytes and Arrow snapshot ceiling. · default 16777216
max_rows := BIGINT
Result row ceiling; overflow fails explicitly. · default 10000
timeout_ms := BIGINT
Operation request/retry budget in milliseconds; checked between reads. · default 30000
Returns columns
variable STRUCT of 4 fields
RDF term or NULL if unbound.
STRUCT 4 fields
  • kindVARCHAR
  • valueVARCHAR
  • datatypeVARCHAR
  • languageVARCHAR
answer BOOLEAN
Whether the graph pattern matches.
Returns columns · depends on the arguments
variable STRUCT of 4 fields
RDF term or NULL if unbound.
STRUCT 4 fields
  • kindVARCHAR
  • valueVARCHAR
  • datatypeVARCHAR
  • languageVARCHAR
answer BOOLEAN
Whether the graph pattern matches.
Example

Query Wikidata relationships with read-only SPARQL

SELECT answer
FROM wiki.wikidata.sparql('ASK { <http://www.wikidata.org/entity/Q42> ?p ?o }');
Link
statement_references (ids VARCHAR[], api_url := VARCHAR, cache_seconds := BIGINT, lang := VARCHAR, max_bytes := BIGINT, max_rows := BIGINT, property_id := VARCHAR, rank := VARCHAR, timeout_ms := BIGINT) 2 examples

Read sources attached to Wikidata statements

Positional arguments
ids VARCHAR[]
One to 500 Q/P IDs; duplicates are fetched once.
Named arguments
api_url := VARCHAR
Wikibase Action API override; defaults to VGI_WIKIDATA_API_URL or Wikidata. · default ""
cache_seconds := BIGINT
Maximum process-local cached response age; zero bypasses cache. · default 300
lang := VARCHAR
Requested language; labels/aliases may use shared mul values, with actual language returned. · default "en"
max_bytes := BIGINT
Combined response bytes and Arrow snapshot ceiling. · default 16777216
max_rows := BIGINT
Result row ceiling; overflow fails explicitly. · default 10000
property_id := VARCHAR
Main statement P ID to select; empty means all properties. · default ""
rank := VARCHAR
all; nondeprecated excludes deprecated; best selects preferred or otherwise normal per property. · default "all"
timeout_ms := BIGINT
Operation request/retry budget in milliseconds; checked between reads. · default 30000
Returns columns
requested_id VARCHAR
Requested ID, before entity redirects.
entity_id VARCHAR
Canonical Wikibase entity ID.
entity_revision BIGINT
Entity revision returned by the API; use when joining snapshots.
source_api VARCHAR
Wikibase API supplying this row.
statement_id VARCHAR
Statement supported by this reference.
statement_property_id VARCHAR
Main property of the referenced statement.
reference_index BIGINT
Zero-based reference group position within the statement.
reference_hash VARCHAR
Upstream reference group hash; shared by its constituent snaks.
snak_index BIGINT
Zero-based snak position within this reference property.
property_id VARCHAR
Wikibase property ID.
snak_type VARCHAR
value, somevalue (unknown), or novalue (explicitly no value).
datatype VARCHAR
Wikibase property datatype.
value STRUCT of 18 fields
Typed value components and lossless raw JSON; NULL for somevalue/novalue.
STRUCT 18 fields
  • entity_idVARCHAR
  • textVARCHAR
  • languageVARCHAR
  • timeVARCHAR
  • time_precisionINTEGER
  • timezoneINTEGER
  • beforeBIGINT
  • afterBIGINT
  • calendar_modelVARCHAR
  • amountVARCHAR
  • lower_boundVARCHAR
  • upper_boundVARCHAR
  • unitVARCHAR
  • latitudeDOUBLE
  • longitudeDOUBLE
  • coordinate_precisionDOUBLE
  • globeVARCHAR
  • raw_jsonVARCHAR
Examples (2)

Read sources attached to Wikidata statements

SELECT statement_property_id, count(*) AS reference_snaks
FROM wiki.wikidata.statement_references(['Q42'])
GROUP BY statement_property_id
ORDER BY statement_property_id;

How many distinct reference groups (sources) back each of Douglas Adams's (Q42) instance-of (P31) statements; statements with no source count 0

SELECT s.statement_id, s.value.entity_id AS class,
  count(DISTINCT r.reference_hash) AS sources
FROM wiki.wikidata.statements(['Q42'], property_id := 'P31') AS s
LEFT JOIN wiki.wikidata.statement_references(['Q42'], property_id := 'P31') AS r USING (source_api, entity_revision, requested_id, statement_id)
GROUP BY s.statement_id, class
ORDER BY s.statement_id;
Link
statements (ids VARCHAR[], api_url := VARCHAR, cache_seconds := BIGINT, lang := VARCHAR, max_bytes := BIGINT, max_rows := BIGINT, property_id := VARCHAR, rank := VARCHAR, timeout_ms := BIGINT) 2 examples

Read full Wikidata statements with typed values

Positional arguments
ids VARCHAR[]
One to 500 Q/P IDs; duplicates are fetched once.
Named arguments
api_url := VARCHAR
Wikibase Action API override; defaults to VGI_WIKIDATA_API_URL or Wikidata. · default ""
cache_seconds := BIGINT
Maximum process-local cached response age; zero bypasses cache. · default 300
lang := VARCHAR
Requested language; labels/aliases may use shared mul values, with actual language returned. · default "en"
max_bytes := BIGINT
Combined response bytes and Arrow snapshot ceiling. · default 16777216
max_rows := BIGINT
Result row ceiling; overflow fails explicitly. · default 10000
property_id := VARCHAR
Main statement P ID to select; empty means all properties. · default ""
rank := VARCHAR
all; nondeprecated excludes deprecated; best selects preferred or otherwise normal per property. · default "all"
timeout_ms := BIGINT
Operation request/retry budget in milliseconds; checked between reads. · default 30000
Returns columns
requested_id VARCHAR
Requested ID, before entity redirects.
entity_id VARCHAR
Canonical Wikibase entity ID.
entity_revision BIGINT
Entity revision returned by the API; use when joining snapshots.
source_api VARCHAR
Wikibase API supplying this row.
statement_id VARCHAR
Stable statement identifier for joining qualifiers and references.
rank VARCHAR
preferred, normal, or deprecated.
property_id VARCHAR
Wikibase property ID.
snak_type VARCHAR
value, somevalue (unknown), or novalue (explicitly no value).
datatype VARCHAR
Wikibase property datatype.
value STRUCT of 18 fields
Typed value components and lossless raw JSON; NULL for somevalue/novalue.
STRUCT 18 fields
  • entity_idVARCHAR
  • textVARCHAR
  • languageVARCHAR
  • timeVARCHAR
  • time_precisionINTEGER
  • timezoneINTEGER
  • beforeBIGINT
  • afterBIGINT
  • calendar_modelVARCHAR
  • amountVARCHAR
  • lower_boundVARCHAR
  • upper_boundVARCHAR
  • unitVARCHAR
  • latitudeDOUBLE
  • longitudeDOUBLE
  • coordinate_precisionDOUBLE
  • globeVARCHAR
  • raw_jsonVARCHAR
Examples (2)

Read full Wikidata statements with typed values

SELECT property_id, count(*) AS statements
FROM wiki.wikidata.statements(['Q42'])
GROUP BY property_id
ORDER BY property_id;

Douglas Adams's (Q42) best-ranked birth/death dates and places (places as item IDs), each labelled with its property's human-readable name by joining statements to the property entities

SELECT p.label AS property,
  coalesce(s.value.time, s.value.entity_id) AS value
FROM wiki.wikidata.statements(['Q42'], rank := 'best') AS s
JOIN wiki.wikidata.entity(['P19', 'P20', 'P569', 'P570']) AS p ON s.property_id = p.entity_id
ORDER BY s.property_id;
Link

Try these queries

Fetch the English Wikipedia summary extract for the DuckDB article.

SELECT wiki.main.wiki_page('DuckDB')

Uses wiki_page

Fetch the rich English summary row (title, extract, url) for DuckDB.

SELECT title, extract, url
FROM wiki.main.wiki_page_summary('DuckDB', lang := 'en')

Uses wiki_page_summary

Resolve a Wikipedia article to its Wikidata identity

SELECT title, entity_id
FROM wiki.main.wiki_entity('Douglas Adams')
ORDER BY title

Uses wiki_entity

Follow up to 3 sroffset pages of German results

SELECT title
FROM wiki.main.wiki_search('duckdb', lang := 'de', count := 5, max_pages := 3)

Uses wiki_search

Retrieve Wikidata entities in batches

SELECT entity_id, label
FROM wiki.wikidata.entity(['Q42'])
ORDER BY entity_id

Uses entity

Douglas Adams's (Q42) best-ranked birth/death dates and places (places as item IDs), each labelled with its property's human-readable name by joining statements to the property entities

SELECT p.label AS property,
  coalesce(s.value.time, s.value.entity_id) AS value
FROM wiki.wikidata.statements(['Q42'], rank := 'best') AS s
JOIN wiki.wikidata.entity(['P19', 'P20', 'P569', 'P570']) AS p ON s.property_id = p.entity_id
ORDER BY s.property_id

Uses statementsentity

17 more examples in the Catalog, each listed under the table or function it uses.

Questions it can answer

Plain-English questions from the worker's agent test tasks. An AI agent with this catalog attached should answer each one with SQL.

  • Using the wiki catalog, fetch the Wikipedia page summary for the article titled 'DuckDB' and return just its resolved page title.
  • Using the wiki catalog, return a single boolean that is true when the English Wikipedia article 'DuckDB' has a non-empty summary extract.
  • Return the Wikidata ID associated with the English Wikipedia article 'Douglas Adams'.
  • Return the English label for Wikidata entity Q42.
  • Return Q42's birth-date string from P569, preserving the upstream time representation.
  • For Q42's spouse statements (P26), list the distinct qualifier property IDs in property order.

Wikipedia is an independent open-source connector from Query.Farm. It is not affiliated with, endorsed by or sponsored by the services, projects or organisations it works with. Product names, logos and trademarks belong to their respective owners.