catholiccorpus / docs /schema.md
ddbaula's picture
Add files using upload-large-folder tool
769beaf verified

_source.json Sidecar Schema

Every downloaded file (or group of files from the same source) in CatholicCorpus has a companion _source.json sidecar that documents where it came from, who made it available, and how it may be used. This is the formal schema for those sidecars.

The machine-readable JSON Schema (draft 2020-12) is at schema.json.

Fields

Top-level

Field Type Required Description
corpus string Yes Always "CatholicCorpus.org". Identifies this file as part of the project.
source_name string Yes Human-readable name of the source.
source_url string (URI) Yes URL from which the content was downloaded.
upstream_url string (URI) Yes Canonical URL of the original project. May equal source_url.
description string Yes What this source contains and why it matters.
language string Yes Primary language(s). See controlled values below.
date_downloaded string (date) Yes ISO 8601 date of download (YYYY-MM-DD).
license string Yes Short license identifier. See controlled values below.
license_url string or null Yes URL to full license text. Null for public domain.
license_details string Yes Extended explanation of the licensing situation.
attribution_required boolean Yes Whether attribution must be given when using this content.
attribution_text string or null Yes Copy-paste-ready attribution text. Null if not required.
credit object Yes Structured credit information (see below).
format string Yes File format(s) of the content.
estimated_words string or number Yes Approximate word count.
notes string or null Yes Additional context, or null.
article_count string No Number of discrete articles (encyclopedia-type sources only).

The credit object

Field Type Required Description
digitized_by string Yes Institution or person who created the digital version.
digitizer_url string (URI) Yes URL of the digitization project.
original_author string Yes Original author(s) of the text.
translator string or null No Translator, if applicable. Null for original-language texts.
editor string or null No Editor of the edition used.
publisher string or null No Historical print publisher.
publication_year string or null No Year or range of the print edition.
thank_you string Yes Human-readable acknowledgment.

Controlled Vocabularies

license values

Value Meaning
Public Domain Work is in the public domain (pre-1928 U.S. publication or author deceased 70+ years). No restrictions on use.
CC BY 4.0 Creative Commons Attribution 4.0. Free to use with attribution.
CC BY-NC-SA 4.0 Creative Commons Attribution-NonCommercial-ShareAlike 4.0.
CC BY 4.0 with additional EULA CC BY 4.0 with an additional end-user license for specific uses (e.g., SBLGNT commercial use restriction).
Non-commercial use permitted May be used for non-commercial purposes. Check license_details for specifics.
Copyrighted (not redistributable) Content is under copyright. Scripts to download it are included but the content itself is not in the corpus.
Unclear License status could not be determined. Check license_details for what is known.

language values

The language field uses standard language names, not ISO codes. Common values in the corpus:

  • Latin
  • Ancient Greek
  • English
  • Latin (primary), English (translations)
  • Latin, Greek
  • Multilingual

For multilingual sources, the primary language is listed first.

How Edition and Citation References Work

Patrologia Latina references

For texts from the Migne Patrologia Latina (Task 02), the standard scholarly citation format is PL volume:column (e.g., PL 32:659 for Augustine's Confessions, Book 1, Chapter 1). The Corpus Corporum download preserves the internal structure of each text but does not embed column numbers in the TEI XML. Researchers needing precise PL column references should cross-reference with the original Migne volumes (available in Task 16 for the Graeca, or via the PDF volumes on archive.org for the Latina).

Archive.org item IDs

For texts downloaded from archive.org, the source_url contains the archive.org identifier (e.g., https://archive.org/details/summatheologica01thom). This identifier can be used to access the original metadata, alternative formats, and lending status via the archive.org API.

Three-Tier License Model

The corpus uses a three-tier approach:

  1. Tier 1 (Public Domain): The vast majority. No restrictions. Use freely.
  2. Tier 2 (Creative Commons): A small number of texts. Follow the CC license terms (attribute, and for NC licenses, do not use commercially).
  3. Tier 3 (Copyrighted): Task 17 only. Scripts are MIT-licensed; content is not redistributed. Users who run the scripts are responsible for their own compliance.

The license field in each sidecar tells you which tier a given source belongs to.

Validation

To validate your sidecars against this schema:

pip install jsonschema
python3 -c "
import json, jsonschema, glob
schema = json.load(open('docs/schema.json'))
files = glob.glob('**/_source.json', recursive=True)
errors = 0
for f in files:
    try:
        jsonschema.validate(json.load(open(f)), schema)
    except jsonschema.ValidationError as e:
        print(f'{f}: {e.message}')
        errors += 1
print(f'Validated {len(files)} files, {errors} errors')
"