8000 feat(topics): a controlled vocabulary of topics, apart from entities by adeelahmad · Pull Request #126 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(topics): a controlled vocabulary of topics, apart from entities - #126

Merged
adeelahmad merged 1 commit into
mainfrom
claude/graph-explorer-ockijg
Oct 4, 2026
Merged

adeelahmad merged 1 commit into
mainfrom
claude/graph-explorer-ockijg

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Description

Before: a topic was just an entity of type TERM, the same type analysis gives anything it can't classify. Topics and named things were mixed, with no way to say one topic is narrower than another.

After: each namespace keeps a controlled vocabulary of topics, built on SKOS.

  • A topic has a label, other labels, a definition, and broader, narrower and related topics. Labels are unique in the namespace, and a topic can't end up broader than itself.
  • Recordings are about topics. A person can say so, or the link comes over when a TERM entity becomes a topic (POST /entities/{id}/topic). Turning an entity into a topic hides the entity; deleting the topic shows it again.
  • Editors manage topics through /api/v1/topics: create, edit, merge, delete, and say which recordings are about a topic.
  • Graph: topics are in the property graph as Topic nodes, linked by ABOUT, NARROWER and RELATED. A topic's parents are its broader topics and the recordings about it. TERM entities are now labelled Term there, so they aren't confused with topics.
  • RDF: a topic is /id/topic/<id>, a skos:Concept in the namespace's vocabulary #topics. Recordings name their topics as dcterms:subject.

Motivation and Context

Adeel asked for topics to be separated from entities as a controlled vocabulary. This is the first of four PRs, all listed in DEVLOG. The next ones add a Topics page, topic suggestions from analysis, and # links in notes pointing at topics. Docs are in docs/topics.md.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (make hooks checks it on commit).
  • I added or updated tests.
  • My change requires documentation updates, and I have updated docs/ accordingly.
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Tests:

  • tests/api/test_topics.py covers the vocabulary, recordings about topics, topics made from entities, and topics in the graph and in RDF.
  • With the graph, RDF and entity tests, that's 43 passing against a real SurrealDB 3.2.4 server.
  • The full suite is running locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_012Jo1JNziunMs8MgWJSGyyM


Generated by Claude Code

Each namespace keeps topics as SKOS concepts: a label, other labels, a
definition, and broader, narrower and related topics. Recordings are about
topics (said by a person, or brought over when a TERM entity becomes a
topic, which hides the entity until the topic is deleted). Editors create,
edit, merge and delete topics through /api/v1/topics. Topics are in the
property graph (Topic, ABOUT, NARROWER, RELATED; TERM entities are labelled
Term there) and in RDF (/id/topic/<id>). docs/topics.md.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012Jo1JNziunMs8MgWJSGyyM
@adeelahmad
adeelahmad merged commit 0d42e67 into main Oct 4, 2026
1 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0