Skip to content

Research-Squirrel-Engineers/math-clay-tablets-friberg-wikidata-project

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Math Clay Tablets Friberg Wikidata Project

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.

Overview

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).

Features

  • 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

Project Structure

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

Setup

Prerequisites

  • Node.js (v18 or higher)
  • npm (Node Package Manager)

Installation

  1. Clone the repository:
git clone https://github.com/bua-dns/math-clay-tablets-friberg-wikidata-project.git
cd math-clay-tablets-friberg-wikidata-project
  1. Install dependencies:
npm install

Usage

1. Fetch CDLI Data

The main script fetches cuneiform tablet data from the CDLI API:

npm start
# or
node app.js

Configuration Options:

  • maxNumberOfPages: Set the maximum number of pages to fetch (default: 50)
  • collectionName: Configure the target collection in the script

2. Filter Friberg Items

Process the fetched data to extract and enhance Friberg-documented tablets:

node filter-friberg-items.js

This 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

Configuration Files

config/friberg-cdli-items.yml

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"

config/materials.yml

Maps CDLI material designations to Wikidata IDs:

entries:
  - cdli_designation: clay
    wikidata_designation: clay
    wikidata_id: Q42302

Output Data Structure

Raw CDLI Data

Contains complete artifact information from the CDLI API including inscriptions, publications, materials, and metadata.

Processed Friberg Items

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"
    }
  ]
}

Wikidata Integration

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)

API Information

  • 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

Development

Adding New Collections

  1. Update the collection URL in app.js
  2. Modify the collectionName constant for file naming
  3. Run the fetch script to collect new data

Adding New Materials

Add entries to config/materials.yml:

entries:
  - cdli_designation: stone
    wikidata_designation: stone
    wikidata_id: Q21434

Adding New Friberg Items

Update config/friberg-cdli-items.yml with museum numbers and page references.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Create a Pull Request

License

This project is licensed under the ISC License - see the LICENSE file for details.

Acknowledgments

  • 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

Related Resources

About

A pilot project to integrate data on mathematical texts from Babylonian clay tablets into Wikidata

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%