Skip to content

review metadata layout for types #78

Closed

Description

@mindsocket

Related to #72 #73 #77

First we should confirm that hierarchy and relationships are both optional , supporting flat or non-hierarchical spaces.

With both optional there is then no way to specify matchers. Matchers are also similar to aliases and the difference isn't fully explicit.

To support flat structures as well as type inference consider a refactor of metadata to extract type configuration (ie matchers) such that it's not (only?) expressed inside relationship or hierarchy config.

Activity

  1. mindsocket commented on Apr 6, 2026

    @mindsocket
    OwnerAuthor

    Related to #44 (parsing hints in space config) and #73 (type inference from folder structure).

    After setting up two knowledge wiki spaces against the same knowledge_wiki schema, a concrete pattern is emerging: both spaces would benefit from folder-to-type mappings at the space config level rather than relying solely on schema-level aliases and matchers.

    Example: if a space had a structure like:

    • sources/ → type: source
    • concepts/ → type: concept
    • syntheses/ → type: synthesis
    • notes/ → type: note

    ...the schema wouldn't need to know about those folders at all. The space config provides the mapping. A different space using the same schema could use completely different folder conventions.

    This connects to the metadata refactor: extracting matchers from relationships makes the schema more composable, but the space config hints in #44 might be the better home for folder-to-type mapping specifically, keeping the schema focused on type definitions and relationships.

  2. mindsocket commented on Apr 6, 2026

    @mindsocket
    OwnerAuthor

    Matchers at hierarchy and relationship level have specific meaning so need to be supported there still. They imply a type match and a specific relationship connection.

    Aliases are for taking a (currently explicit) type value and mapping it to a schema defined type.

    Type inference could work by bending aliases to handle inferred types too:

    • a config option that says aliases can be used to infer types from folders, on by default. Since folders are a plug-in level construct this should be a plugin level option and operation.
    • a config option allowing to provide additional aliases, combined with the schema defined ones. This is space level, not plugin level.

    This overloads aliases but feels like a reasonable compromise vs complicating the config. Chances are the use of aliases for both inference and remapping would be uncommon, the likelihood of a genuine conflict where separate aliases would be needed is extremely unlikely, and the decision can be revisited if it's a problem in practice.

    Net result is no change to metadata layout.

  3. mindsocket commented on Apr 7, 2026

    @mindsocket
    OwnerAuthor

    Resolved through design review: the existing $metadata layout is sufficient and was not changed. Type information for inference is sourced from oneOf branches in the schema (not metadata); aliases remain schema-only via $metadata.aliases. No new metadata fields were needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions