A Node.js project for fetching Babylonian cuneiform tablet data from the CDLI (Cuneiform Digital Library Initiative) API and processing it for Wikidata integration, with a specific focus on mathematical tablets documented in Friberg's publications.
This project fetches data about ancient Babylonian mathematical tablets from the CDLI database, filters items from specific collections (particularly the SchΓΈyen Collection), and processes them for integration with Wikidata. The focus is on tablets documented in JΓΆran Friberg's scholarly work "A Remarkable Collection of Babylonian Mathematical Texts" (MSCT 1).
- CDLI API Integration: Fetches cuneiform tablet data with pagination support
- Collection Filtering: Filters items by museum collection (configurable)
- Friberg Item Processing: Identifies and enhances tablets from Friberg's publications
- Wikidata Enhancement: Adds Wikidata-compatible properties and relations
- Material Mapping: Maps CDLI material designations to Wikidata IDs
- Incremental Saving: Saves data progressively to prevent data loss
cdli-fetcher/
βββ app.js # Main fetching script with pagination
βββ filter-friberg-items.js # Friberg item filtering and enhancement
βββ package.json # Node.js dependencies and scripts
βββ config/
β βββ friberg-cdli-items.yml # Friberg item configuration
β βββ materials.yml # Material mapping configuration
βββ inspection/
βββ sample-items.json # Raw CDLI data (all collections)
βββ Sch_yen_Collection_Oslo_Norway.json # SchΓΈyen Collection data
βββ friberg-items.json # Processed Friberg items for Wikidata
- Node.js (v18 or higher)
- npm (Node Package Manager)
- Clone the repository:
git clone https://github.com/bua-dns/math-clay-tablets-friberg-wikidata-project.git
cd math-clay-tablets-friberg-wikidata-project- Install dependencies:
npm installThe main script fetches cuneiform tablet data from the CDLI API:
npm start
# or
node app.jsConfiguration Options:
maxNumberOfPages: Set the maximum number of pages to fetch (default: 50)collectionName: Configure the target collection in the script
Process the fetched data to extract and enhance Friberg-documented tablets:
node filter-friberg-items.jsThis script:
- Filters items based on museum numbers in
config/friberg-cdli-items.yml - Adds Wikidata properties for scholarly references
- Maps materials using
config/materials.yml - Outputs enhanced data to
inspection/friberg-items.json
Defines which tablets to process based on Friberg's documentation:
items:
- museum_number: "MS 2728"
friberg_pages: "13β15"
- museum_number: "MS 2729"
friberg_pages: "13β15"Maps CDLI material designations to Wikidata IDs:
entries:
- cdli_designation: clay
wikidata_designation: clay
wikidata_id: Q42302Contains complete artifact information from the CDLI API including inscriptions, publications, materials, and metadata.
Enhanced with Wikidata-compatible properties:
{
"label_en": {
"value": "MSCT 1, 014, MS 2728"
},
"description_en": {
"value": "Babylonian cuneiform clay tablet"
},
"instance_of": {
"relation": "Q66018222"
},
"collection": {
"relation": "Q2380144"
},
"inventory_number": {
"value": "MS 2728"
},
"described_by_source": {
"relation": "Q136490190",
"pages": "13β15"
},
"described_at_URL": {
"value": "https://cdli.earth/artifacts/251752",
"language_of_work_or_name": "English"
},
"materials": [
{
"relation": "Q42302"
}
]
}The processed data includes:
- Q136490190: Friberg's "A Remarkable Collection of Babylonian Mathematical Texts"
- Q66018222: Cuneiform tablet (instance of)
- Q2380144: SchΓΈyen Collection (collection)
- Q42302: Clay (material)
- CDLI Search API:
https://cdli.earth/search - CDLI Artifacts API:
https://cdli.earth/artifacts - Rate Limiting: Built-in 100ms delays between requests
- Pagination: Supports fetching large datasets incrementally
- Update the collection URL in
app.js - Modify the
collectionNameconstant for file naming - Run the fetch script to collect new data
Add entries to config/materials.yml:
entries:
- cdli_designation: stone
wikidata_designation: stone
wikidata_id: Q21434Update config/friberg-cdli-items.yml with museum numbers and page references.
- Fork the repository
- Create a feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - Create a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
- CDLI (Cuneiform Digital Library Initiative) for providing the API and data
- JΓΆran Friberg for his scholarly work on Babylonian mathematical texts
- The SchΓΈyen Collection for preserving these ancient artifacts
- Wikidata for the collaborative knowledge base infrastructure