openapi: 3.0.3
# CultureTechLens Static API v1 — SHIPPED with SEO Week 2 (v89), 2026-10-27.
# This spec describes the real static API: files, not a server. It was
# head-audited and corrected on 2026-10-27 against the live files; the
# draft it replaces described query parameters, content negotiation, a
# CTL-hosted /oai endpoint, and a second server that do not exist.
info:
  title: CultureTechLens Static API
  description: >-
    Chicago's Black cultural intelligence archive and research nonprofit — 4,111 entities, 2,527
    relationships, 8,388 source references. Every claim carries an evidence
    grade (VERIFIED, SUPPORTED, PROVISIONAL, DISPUTED, UNRESOLVED). Static
    JSON files: no key, no query parameters, no rate limit — download the
    file and filter locally. For librarians, teachers, journalists, and
    researchers. Published by CultureTechLens NFP, a Chicago 501(c)(3)
    (EIN 39-3143901). Knowledge graph dataset DOI (concept):
    10.5281/zenodo.23403147. Index Edition 2026-10 DOI:
    10.5281/zenodo.23081630. Library harvesting: the Zenodo deposits expose
    OAI-PMH at https://zenodo.org/oai2d (record 23081630 and the graph
    concept record) — there is no OAI endpoint on this domain.
  version: 1.0.0
  contact:
    name: CultureTechLens
    email: info@culturetechlens.com
    url: https://culturetechlens.com/api/
  license:
    name: >-
      Free to read. Dataset deposits via Zenodo are CC BY 4.0; bulk and
      commercial licensing is a separate lane (REL-007) — contact
      info@culturetechlens.com. Photographs carry per-photo licenses in
      photos.json; no blanket license applies to the photo archive.
    url: https://culturetechlens.com/terms/
  x-citation: >-
    Cite as: CultureTechLens, CultureTechLens Knowledge Graph — Static API
    v1, 2026. DOI: 10.5281/zenodo.23403147.
servers:
  - url: https://culturetechlens.com/api/v1
    description: The only server. (api.culturetechlens.com is a phase-2 idea, not live.)
tags:
  - name: Librarian
  - name: Black Research
  - name: Photos
  - name: Index
paths:
  /index.json:
    get:
      summary: API index — counts, endpoints, citation, terms, source manifest
      tags: [Index, Librarian]
      responses:
        '200':
          description: The index document (live)
          content:
            application/json:
              schema: { $ref: '#/components/schemas/ApiIndex' }
  /entities.json:
    get:
      summary: All 4,111 entities in one file (~3.1 MB). No query parameters — filter locally.
      tags: [Black Research, Librarian]
      responses:
        '200':
          description: Array of entities (live)
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Entity' }
  /entities/{kg_id}.json:
    get:
      summary: One entity with its relationships (live; kg_id as in entities.json, e.g. CTL-P-0001)
      tags: [Black Research, Librarian]
      parameters:
        - name: kg_id
          in: path
          required: true
          schema: { type: string, example: CTL-P-0001 }
      responses:
        '200':
          description: Single entity document
          content:
            application/json:
              schema: { $ref: '#/components/schemas/EntityDetail' }
        '404':
          description: No entity with that ID
  /relationships.json:
    get:
      summary: All 2,527 relationships in one file. No query parameters — filter locally.
      tags: [Black Research]
      responses:
        '200':
          description: Array of relationships (live)
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Relationship' }
  /sources.json:
    get:
      summary: The 8,388 source references behind the graph, each with its citation as recorded. (Ships with Week 2 §J.)
      tags: [Librarian, Black Research]
      responses:
        '200':
          description: Array of source records
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Source' }
  /photos.json:
    get:
      summary: Cited Photo Archive records — credit exactly as printed, rights/license basis per photo. Only records with complete credit + rights are included. (Ships with Week 2 §J.)
      tags: [Photos, Librarian]
      responses:
        '200':
          description: Array of photo records
          content:
            application/json:
              schema:
                type: array
                items: { $ref: '#/components/schemas/Photo' }
components:
  schemas:
    ApiIndex:
      type: object
      properties:
        name: { type: string }
        api_version: { type: string }
        generated: { type: string, format: date }
        ledger: { type: string }
        counts:
          type: object
          properties:
            entities: { type: integer, example: 4111 }
            relationships: { type: integer, example: 2527 }
            sources: { type: integer, example: 8388 }
        doi:
          type: object
          properties:
            concept: { type: string, example: 10.5281/zenodo.23403147 }
            latest_version: { type: string }
        endpoints: { type: object }
        citation: { type: string }
        terms: { type: string }
    Entity:
      type: object
      required: [id, name, node_type]
      properties:
        id: { type: string, example: CTL-P-0001, description: 'CTL kg_id. Prefixes by type: P person, PL place, O organization/institution, W work, E event, and others as minted.' }
        name: { type: string }
        node_type:
          type: string
          enum: [Person, Work, Outlet, Institution, Place, Event, Topic, List]
          description: 'The 8 node types in the canonical master (counts: Person 1480, Work 1370, Outlet 452, Institution 234, Place 223, Event 221, Topic 78, List 53).'
        aliases: { type: array, items: { type: string } }
        created: { type: string }
        source: { type: string, description: Source reference as recorded in the master. }
        grade:
          type: string
          enum: [VERIFIED, SUPPORTED, PROVISIONAL, DISPUTED, UNRESOLVED]
          description: 'Top-level evidence grade (Week 2 §J normalization; lifted from props.verification.status, value as recorded, never collapsed).'
        citation: { type: string, description: 'Ready-to-paste citation for this entity (Week 2 §J).' }
        identifiers:
          type: object
          description: 'Present ONLY where the master actually holds the identifier — never minted or guessed. Most records have none today.'
          properties:
            wikidata_qid: { type: string }
            loc_id: { type: string }
        props:
          type: object
          description: Type-specific properties as stored, including verification {status, source, date, claims} where graded.
    EntityDetail:
      allOf:
        - $ref: '#/components/schemas/Entity'
        - type: object
          properties:
            relationships: { type: array, items: { $ref: '#/components/schemas/Relationship' } }
    Relationship:
      type: object
      required: [from_id, edge_type, to_id]
      properties:
        from_id: { type: string }
        edge_type: { type: string, description: 'One of the 11 edge types used in the canonical master extract.' }
        to_id: { type: string }
        since: { type: string }
        until: { type: string }
        evidence: { type: string }
        source_ids: { type: array, items: { type: string } }
        notes: { type: string }
    Source:
      type: object
      properties:
        id: { type: string }
        citation: { type: string, description: The citation as recorded in the master. }
        url: { type: string }
        used_by: { type: array, items: { type: string }, description: Entity/relationship IDs citing this source. }
    Photo:
      type: object
      properties:
        id: { type: string, description: 'CTL-IMG ID from the photo log.' }
        subject: { type: string }
        entity_id: { type: string, description: Graph entity this photo documents, where attached. }
        page_url: { type: string, description: The photo-door page in the Cited Photo Archive. }
        credit: { type: string, description: Credit line exactly as printed on the site (includes creator + rights basis). }
        license: { type: string, description: 'Per-photo license/rights basis as recorded (e.g. Public Domain, CC BY-SA 4.0). Varies by photo — there is no archive-wide license.' }
        photographer: { type: string }
        source_url: { type: string }
