Periodic table
The periodic table, isotopes and chemical formula molar masses as offline DuckDB SQL
- Connector software
- Free and open source
- Service credentials
- Not needed
- Query Farm hosting
- Available · $10/month organization minimum
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/elements/index.md to help me query Periodic table 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.
Symbols of the first ten elements
Example output · captured
- Connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
SELECT z, elements.main.element_symbol(z) AS symbol
FROM range(1, 11) t(z)
ORDER BY z
| z | symbol |
|---|---|
| 1 | H |
| 2 | He |
| 3 | Li |
| 4 | Be |
| 5 | B |
Quick start
Choose where to run Periodic table, 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.
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;
INSTALL vgi FROM community;
LOAD vgi;
2. Attach the connector
Attach the release directly
Downloads the latest release for your platform and caches it locally.
ATTACH 'elements' AS elements (
TYPE vgi,
LOCATION 'github-auto://Query-farm/vgi-elements'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'elements' AS elements (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-elements:0.2.0'
);
3. Run a query
SELECT z, elements.main.element_symbol(z) AS symbol
FROM range(1, 11) t(z)
ORDER BY z
Run the connector on a server you manage. You operate the service and choose who can connect.
1. Deploy the connector on your server
Follow the connector’s deployment instructions. Use its supported HTTP transport, or launch it remotely over SSH. The connection guide explains both options.
2. Install the vgi extension
Run this in your SQL client. On DuckDB, keep FROM query_farm on LOAD in later sessions.
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach the connector
For an HTTP deployment, replace the example URL with your endpoint. Add the authentication options your deployment requires. For SSH, use the SSH connection instructions.
ATTACH 'elements' AS elements
(TYPE vgi, LOCATION 'https://your-connector.example.com');
4. Run a query
SELECT z, elements.main.element_symbol(z) AS symbol
FROM range(1, 11) t(z)
ORDER BY z
Query Farm operates Periodic table for your team. Hosting has a $10 monthly minimum per organization; usage counts toward it. From $2.97 per instance-month ($10 monthly minimum).
1. Create your hosted connector
Open the console, choose your organization and deployment size, and add any service credentials there.
2. Install the vgi extension
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;
INSTALL vgi FROM community;
LOAD vgi;
3. Attach your deployment
Copy the ATTACH statement from your deployment in the console and run it in DuckDB or Haybarn. Use elements as the catalog alias for the query below.
4. Run a query
SELECT z, elements.main.element_symbol(z) AS symbol
FROM range(1, 11) t(z)
ORDER BY z
Technical details
- Verified connector release
- v0.2.0
- Engine
- 2.0.1
- VGI protocol
- 3.4.0
- Verified on
- December 1, 2026
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 the release directly
Uses the verified release each time you attach the connector.
ATTACH 'elements' AS elements (
TYPE vgi,
LOCATION 'github-auto://Query-farm/[email protected]'
);
Attach the signed image
Needs Docker, Podman or another OCI runtime. The extension runs the container and talks to it over stdio.
ATTACH 'elements' AS elements (
TYPE vgi,
LOCATION 'oci://ghcr.io/query-farm/vgi-elements:0.2.0'
);
Overview
The periodic table and NIST isotope data as offline DuckDB tables, with element lookups and chemical formula molar-mass and composition functions. No network or API key needed.
Periodic-table and isotope reference data that runs entirely offline: every value is bundled in the worker, so queries are deterministic and need no network or key.
What you can do
- Look up element properties by atomic number, symbol or name, and normalize messy element columns.
- Compute molar masses of formulas such as
CuSO4·5H2OorK4[Fe(CN)6], and their mass percent. - Explore isotopes and natural abundances, joined to the elements on
atomic_number.
Caveats
Atomic masses are in g/mol. For the twelve elements IUPAC publishes as an interval (H, Li, B, C, N, O, Mg, Si, S, Cl, Br, Tl) the worker uses IUPAC's conventional single value; for radioactive elements without a standard atomic weight it uses the longest-lived isotope's mass. Group, period and block are derived from the atomic number. Superheavy-element properties are sparse or predicted. NIST's table is the vintage published on its site and can lag the latest IUPAC revisions.
Sources and references
- PubChem Periodic Table (NCBI/NLM): element properties.
- NIST Atomic Weights and Isotopic Compositions: isotope masses, compositions and standard atomic weights.
- IUPAC CIAAW: conventional atomic weights.
Catalog
Everything elements exposes once attached — read straight from the worker's
released build.
main 2 tables · 6 functions
Periodic table and isotope reference tables, element lookup scalars and chemical formula functions.
Schema examples (10)
Symbols of the first ten elements
SELECT z, elements.main.element_symbol(z) AS symbol
FROM range(1, 11) t(z)
ORDER BY z;
| z | symbol |
|---|---|
| 1 | H |
| 2 | He |
| 3 | Li |
| 4 | Be |
| 5 | B |
Name of element 118
SELECT elements.main.element_name(118) AS name;
Normalize symbols to names
SELECT s, elements.main.element_name(s) AS name
FROM (VALUES ('fe'), ('AU'), ('Na')) t(s)
ORDER BY s;
Atomic mass of iron
SELECT elements.main.atomic_mass(26) AS iron;
6 more examples
Ratio of gold's atomic mass to silver's
SELECT elements.main.atomic_mass('Au') / elements.main.atomic_mass('Ag') AS gold_to_silver;
Atomic number of oganesson
SELECT elements.main.atomic_number('oganesson') AS z;
Molar masses of water, aspirin and copper sulfate pentahydrate
SELECT f, round(elements.main.formula_mass(f), 3) AS g_per_mol
FROM (VALUES ('H2O'), ('C9H8O4'), ('CuSO4·5H2O')) t(f)
ORDER BY f;
Moles of sodium chloride in one kilogram
SELECT round(1000 / elements.main.formula_mass('NaCl'), 2) AS mol_per_kg;
Mass percent of each element in aspirin
SELECT element, count, round(100 * mass_fraction, 2) AS mass_percent
FROM elements.main.formula_composition('C9H8O4')
ORDER BY mass_percent DESC;
Atom counts of copper sulfate pentahydrate
SELECT element, count
FROM elements.main.formula_composition('CuSO4·5H2O')
ORDER BY element;
elements
All 118 chemical elements with atomic mass, position, electron configuration and physical properties; bundled offline from PubChem and NIST.
The noble gases with their atomic masses
SELECT symbol, name, atomic_mass
FROM elements.main.elements
WHERE group_number = 18
ORDER BY atomic_number;
Element count and mean electronegativity per block
SELECT block, count(*) AS elements,
round(avg(electronegativity_pauling), 2) AS avg_en
FROM elements.main.elements
GROUP BY block
ORDER BY block;
isotopes
Every nuclide in NIST's Atomic Weights and Isotopic Compositions table (3,352 isotopes) with relative atomic mass and natural abundance; bundled offline.
Natural isotopes of carbon and their abundance
SELECT nuclide, isotopic_composition
FROM elements.main.isotopes
WHERE symbol = 'C' AND isotopic_composition IS NOT NULL
ORDER BY mass_number;
Elements with the most naturally occurring isotopes
SELECT e.symbol, count(*) AS natural_isotopes
FROM elements.main.isotopes i
JOIN elements.main.elements e USING (atomic_number)
WHERE i.isotopic_composition IS NOT NULL
GROUP BY e.symbol
ORDER BY natural_isotopes DESC, e.symbol
LIMIT 3;
atomic_mass (atomic_number BIGINT) +1 overload
Atomic mass in g/mol (Da) for an atomic number: atomic_mass(26) returns 55.845
atomic_mass(atomic_number BIGINT) → DOUBLEatomic_mass(symbol_or_name VARCHAR) → DOUBLE
Atomic mass of iron
SELECT elements.main.atomic_mass(26) AS iron;
Ratio of gold's atomic mass to silver's
SELECT elements.main.atomic_mass('Au') / elements.main.atomic_mass('Ag') AS gold_to_silver;
atomic_number (symbol_or_name VARCHAR)
Atomic number for a symbol or name, case-insensitive: atomic_number('iron') returns 26
Atomic number of oganesson
SELECT elements.main.atomic_number('oganesson') AS z;
element_name (atomic_number BIGINT) +1 overload
English element name for an atomic number: element_name(26) returns 'Iron'
element_name(atomic_number BIGINT) → VARCHARelement_name(symbol_or_name VARCHAR) → VARCHAR
Name of element 118
SELECT elements.main.element_name(118) AS name;
Normalize symbols to names
SELECT s, elements.main.element_name(s) AS name
FROM (VALUES ('fe'), ('AU'), ('Na')) t(s)
ORDER BY s;
element_symbol (atomic_number BIGINT)
Chemical symbol for an atomic number: element_symbol(26) returns 'Fe'
Symbols of the first ten elements
SELECT z, elements.main.element_symbol(z) AS symbol
FROM range(1, 11) t(z)
ORDER BY z;
| z | symbol |
|---|---|
| 1 | H |
| 2 | He |
| 3 | Li |
| 4 | Be |
| 5 | B |
formula_mass (formula VARCHAR)
Molar mass in g/mol of a chemical formula: formula_mass('H2O') returns about 18.015
Molar masses of water, aspirin and copper sulfate pentahydrate
SELECT f, round(elements.main.formula_mass(f), 3) AS g_per_mol
FROM (VALUES ('H2O'), ('C9H8O4'), ('CuSO4·5H2O')) t(f)
ORDER BY f;
Moles of sodium chloride in one kilogram
SELECT round(1000 / elements.main.formula_mass('NaCl'), 2) AS mol_per_kg;
formula_composition (formula VARCHAR)
Break a chemical formula into elements with atom counts and mass fractions
Mass percent of each element in aspirin
SELECT element, count, round(100 * mass_fraction, 2) AS mass_percent
FROM elements.main.formula_composition('C9H8O4')
ORDER BY mass_percent DESC;
Atom counts of copper sulfate pentahydrate
SELECT element, count
FROM elements.main.formula_composition('CuSO4·5H2O')
ORDER BY element;
Try these queries
Normalize symbols to names
SELECT s, elements.main.element_name(s) AS name
FROM (VALUES ('fe'), ('AU'), ('Na')) t(s)
ORDER BY s
Uses element_name
Molar masses of water, aspirin and copper sulfate pentahydrate
SELECT f, round(elements.main.formula_mass(f), 3) AS g_per_mol
FROM (VALUES ('H2O'), ('C9H8O4'), ('CuSO4·5H2O')) t(f)
ORDER BY f
Uses formula_mass
Mass percent of each element in aspirin
SELECT element, count, round(100 * mass_fraction, 2) AS mass_percent
FROM elements.main.formula_composition('C9H8O4')
ORDER BY mass_percent DESC
7 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 elements worker, what is the atomic mass of iron?
- Using the elements worker, compute the molar mass of aspirin, C9H8O4, rounded to 2 decimals.
- List the symbols of the noble gases (group 18) in order of atomic number.
- Which naturally occurring isotopes of oxygen exist? Give mass number and isotopic composition, by mass number.
- Map the free-text element values 'fe', 'GOLD' and 'na' to their atomic numbers, symbols and English names, ordered by atomic number.
- What percentage of the mass of copper(II) sulfate pentahydrate (CuSO4·5H2O) is hydrogen? Round to 2 decimals.
Periodic table 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.
Related workers
Chem
Science & health
Compute molecular descriptors, fingerprints, similarity, substructure matches and InChI keys from SMILES strings
FHIR
Science & health
Query HL7 FHIR R4 REST servers from SQL: patients, observations, generic search, reads by id, and server capabilities
HL7
Science & health
Split, validate, and pull fields out of HL7 v2.x clinical messages such as ADT and ORU feeds