Skip to content

feat: derive Property page title from name in get_title - #5

Merged
LukasGold merged 1 commit into
mainfrom
feat/property-title-from-name
Nov 13, 2026
Merged

LukasGold merged 1 commit into
mainfrom
feat/property-title-from-name

Conversation

@LukasGold

Copy link
Copy Markdown
Contributor

Closes #4

Changes

  • get_title in src/opensemantic/_model.py and src/opensemantic/v1/_model.py now returns, in this order:
    1. meta.wiki_page.title, if set (unchanged)
    2. entity.name, if the entity is a Property (including subclasses) and name is not empty
    3. OSW<uuid hex> (unchanged)
  • get_full_title and get_iri follow, so a property gives Property:<name>.
  • get_namespace is unchanged.
  • opensemantic.core is added to the testing extra in setup.cfg, because the new tests import it.
  • New tests in tests/property_title_test.py for opensemantic.core and opensemantic.core.v1.

Rationale

The wiki form editor names a property page after jsondata.name without transformation (PageBot.js L951-L970). Python code gave Property:OSW<uuid>, which differs from the page the wiki creates and from the Property:<Name> targets in schema @context mappings.

Known limitation

  • If an update changes name, the derived title changes. This is out of scope here.

- return entity.name for Property instances without meta title
- apply in opensemantic and opensemantic.v1
- add opensemantic.core to testing extra
- add tests for both model versions

@LukasGold LukasGold left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review: Agentic code changes look fine

@LukasGold
LukasGold merged commit 98be10b into main Nov 13, 2026
9 checks passed
@LukasGold
LukasGold deleted the feat/property-title-from-name branch November 13, 2026 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get_title: derive Property page title from name, like the wiki form editor

1 participant