How to Build a Citation-Ready Research Dataset from Public Web Sources
A practical design for collecting public web sources as durable evidence: preserve representations, provenance, passage selectors, metadata, and integrity before indexing for RAG.
Citation readiness starts before retrieval
A URL and a block of cleaned text are enough to prototype retrieval-augmented generation (RAG). They are not enough to support a serious research workflow.
When someone asks, “Where did this answer come from?”, the system should be able to identify the source representation it used, the time it retrieved that representation, the exact passage supporting the claim, and the transformations between the fetched page and the chunk in an index. Without that chain, a citation can become a decorative link rather than verifiable evidence.
This matters because provenance is not merely a formatting concern for knowledge-intensive RAG. The original RAG research identifies provenance for model decisions as an open problem alongside updating external knowledge (Lewis et al.). The practical implication is simple: acquire and preserve evidence before chunking, embedding, ranking, or generating.
Treat citation readiness as a source-acquisition contract. Each public web source should arrive in your system with enough evidence to answer four questions:
- What did we retrieve? The original representation, not only an extraction.
- When and how did we retrieve it? Request context, final URL, status, timestamps, and extractor version.
- What exact part supports a claim? A quote plus durable selectors and local context.
- Can we verify it has not changed in storage? A cryptographic digest for every important artifact.
Use a two-layer dataset, not one mutable document collection
The most useful design separates evidence from retrieval products.
Layer 1: Immutable evidence
This is the auditable record of acquisition. It stores the fetched source representation—such as raw HTML or a preserved archival container—along with the transport and provenance information needed to interpret it later.
The WARC standard is a useful model because it is designed to retain payload content and harvesting control information, as well as associated metadata and transformation results (ISO 28500). You do not have to adopt WARC on day one, but the separation it encourages is important: the raw source is evidence; extracted text is a derivative.
A source record in this layer should normally include:
- requested URL and final URL after redirects
- retrieval timestamp in UTC
- HTTP status and MIME type
- relevant response fields, including
ETagandLast-Modifiedwhen available - raw representation location or bytes
- raw representation hash
- source title and descriptive metadata when extracted
- publication, modification, and archival dates as separate fields
- licensing and usage notes when available
- acquisition agent and pipeline version
HTTP validators such as ETag and Last-Modified describe representation state, but they are not substitutes for recording your own retrieval event (RFC 9110). A page’s publication date, last modification date, fetch time, and archive time refer to different events. Preserve them independently.
Layer 2: Regenerable retrieval data
This layer contains normalized text, structural sections, chunks, embeddings, lexical indexes, and ranking features. Every object here should point back to a record in the evidence layer.
That rule gives you operational flexibility. You can change a parser, alter chunk size, switch embedding models, or rebuild an index without losing your ability to explain the underlying evidence. It also avoids treating an old chunk as if it were the original page.
PROV-O offers a useful vocabulary for this model: entities, activities, and agents, plus relationships for derivation, quotation, revision, and primary sources (W3C PROV-O). In practical terms:
- The fetched page representation is an entity.
- Your fetch operation is an activity.
- Your crawler or research service is an agent.
- A normalized document and its chunks are entities derived from the fetched representation.
- A displayed citation span is quoted from a specific source representation.
Create locators that work for people and software
A citation-ready chunk needs more than source_url. URLs identify a resource, but not the exact words used to support an answer.
The W3C Web Annotation Data Model supports targeting portions of web resources through multiple selector types. Its TextQuoteSelector uses the selected text along with optional prefix and suffix context. Text-position, CSS, XPath, fragment, and time-based selectors can add other ways to locate a target.
For each citation span, store a combined locator:
- Canonical URL: where the source is identified.
- Exact quote: the text a reviewer expects to see.
- Prefix and suffix: nearby context that helps disambiguate repeated wording.
- Start and end offsets: positions in a defined normalized-text artifact.
- Structural selector: a heading path, CSS selector, XPath, or equivalent where reliable.
- Representation hash: identifies the captured version in which offsets are valid.
The quote makes human review fast. The offsets and structural locator support programmatic re-location. The representation hash prevents a subtle but common mistake: applying offsets from one fetched version to a later version of a changing page.
Here is an illustrative retrieval-layer record:
{
"chunk_id": "src_01:chunk_004",
"source_id": "src_01",
"derived_from": "capture_01",
"representation_sha256": "<sha-256-of-raw-capture>",
"normalized_text_sha256": "<sha-256-of-normalized-text>",
"retrieved_at": "2026-08-24T00:59:30Z",
"locator": {
"canonical_url": "https://example.org/research-page",
"exact": "The passage used as evidence.",
"prefix": "Text immediately before the passage. ",
"suffix": " Text immediately after the passage.",
"start": 1842,
"end": 1874,
"section_path": ["Methods", "Data collection"]
},
"extraction": {
"method": "html-to-text",
"version": "2026-08-24"
}
}
The schema is intentionally unglamorous. That is a feature. A future reviewer should be able to retrieve the stored artifact, validate the hashes, rerun the extraction method, and compare the exact passage without needing access to your vector database.
Building an evidence-first ingestion path? Start with a small representative source set and make each capture inspectable before scaling indexing. Try PagePith for the acquisition step in that workflow.
Preserve integrity and version history
Integrity evidence is what turns “we saved this” into “we can verify this stored file is the one we recorded.” BagIt provides a straightforward precedent: manifests map file paths to cryptographic checksums, and validation confirms listed checksums against the corresponding files (RFC 8493).
Apply the same principle to both original and derived artifacts:
captures/src_01.html sha256: ...
normalized/src_01.txt sha256: ...
metadata/src_01.json sha256: ...
chunks/src_01.jsonl sha256: ...
A hash does not establish that a page was true, authoritative, or lawfully collected. It does establish that a file has not changed relative to the recorded digest. That narrower guarantee is still essential when citations are reviewed months later.
Versioning needs similar precision. Do not overwrite an earlier capture just because a later fetch succeeds. Create a new capture entity with its own retrieval timestamp, response metadata, and hashes. Connect it to the previous one as a revision when that relationship is known. PROV-O explicitly distinguishes relations such as quotation, revision, and primary source (PROV-O provenance relationships).
For sources that may change or disappear, retain the live URL and record an archival representation where available. The Memento framework defines time-based access to prior web-resource states and uses archival timestamps to identify those states (RFC 7089). An archival link is not a replacement for your own captured evidence, but it can provide another route for independent verification.
Normalize metadata without pretending it is always complete
Public pages have inconsistent metadata. Some expose author, publisher, publication date, modification date, license, and canonical URL; others expose only a title and page body. Your schema should accommodate both complete and sparse records without fabricating values.
Schema.org’s CreativeWork supplies a recognizable vocabulary for fields such as name, author, publisher, citation, license, datePublished, dateModified, archivedAt, and url. Use comparable names internally where practical, but retain the original extracted value and the extraction method.
For example, distinguish:
date_published: publisher-provided publication date, if presentdate_modified: publisher-provided modification date, if presentlast_modified_header: HTTP response value, if presentretrieved_at: your acquisition event timearchived_at: timestamp associated with an archival representation, if present
Avoid compressing these into a single date. Doing so makes later claims about recency impossible to interpret.
Demonstration: a PagePith acquisition record from supplied proof
The supplied PagePith proof shows a fetch-tier retrieval of the requested public URL, “Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks”. The returned result reports a title and a Markdown payload with a content length of 9,530. The provided excerpt includes the arXiv identifier 2005.11401, submission and revision information, the paper title, and author links.
That is a useful starting artifact for a citation-ready pipeline: the requested URL remains attached to retrieved content rather than being separated from it. To make this particular acquisition fully citation-ready, the next steps would be to assign a source ID, record the acquisition timestamp available in the job record, preserve the returned Markdown as a derived artifact, hash it, and create quote-and-context locators for any passages used in generated answers.
Importantly, the supplied proof does not demonstrate raw-response preservation, HTTP headers, archival capture, content hashing, or passage selectors. Those remain responsibilities of the surrounding dataset design. This distinction keeps the acquisition evidence honest and prevents an ingestion tool from being credited with preservation features the record does not show.
Add compliance checks to acquisition, not after it
Publicly reachable does not mean unrestricted for every purpose. Before automated collection, evaluate robots.txt, terms of use, licensing, copyright obligations, rate limits, and any other applicable constraints.
RFC 9309 standardizes robots exclusion handling for crawlers, including user-agent matching and allow/disallow rules. It also makes clear that robots.txt is not an authorization mechanism. In other words, a robots decision is one input to collection policy, not complete permission analysis.
Store the outcome of those checks as acquisition metadata. Useful fields include robots_evaluated_at, robots_decision, license_url, terms_review_status, and collection_notes. A durable research dataset should make both its evidence and its collection decisions reviewable.
A practical acceptance test
Before a source enters your retrieval index, require that it pass a simple test:
- Can a reviewer identify the exact fetched representation?
- Can they see when it was retrieved and which URL ultimately responded?
- Can they verify a stored artifact with a hash?
- Can they trace any chunk back to an exact quote and context?
- Can they distinguish original source content from normalized text, summaries, and generated claims?
- Can they determine whether a later capture is a new version rather than the same evidence?
If any answer is no, the source may still be searchable, but it is not yet citation-ready.
The payoff is not merely better footnotes. An evidence layer makes debugging retrieval easier, permits parser and embedding changes without losing lineage, and gives researchers a concrete path from an answer to the public source representation behind it.
Ready to make source acquisition the dependable first step in your research pipeline? Sign up for PagePith.
Sources
- Retrieval-Augmented Generation for Knowledge-Intensive NLP TasksarXiv; Lewis et al.
- PROV-O: The PROV OntologyW3C
- Web Annotation Data ModelW3C
- RFC 9110: HTTP SemanticsIETF RFC Editor
- RFC 7089: HTTP Framework for Time-Based Access to Resource States — MementoIETF RFC Editor
- ISO 28500:2017 — WARC file formatInternational Organization for Standardization
- RFC 8493: The BagIt File Packaging FormatIETF RFC Editor; Library of Congress contributors
- CreativeWork — Schema.orgSchema.org