notex.nvim/specs/001-create-a-neovim/data-model.md

31 lines
1.3 KiB
Markdown
Raw Normal View History

# Data Model: Relational Document System
This document outlines the key entities for the relational document system.
## Entities
### Document
- **Description**: A markdown file with YAML frontmatter.
- **Attributes**:
- `type` (string): The type of the document (e.g., "person", "meeting").
- `properties` (object): A set of key-value pairs defined in the YAML frontmatter.
### Schema
- **Description**: A definition for a document type, specifying its properties and their types. As per the clarification, schemas are not strictly enforced but are inferred from existing documents.
- **Attributes**:
- `name` (string): The name of the document type.
- `properties` (object): A dictionary of property names and their inferred types (e.g., string, number, date).
### Query
- **Description**: A definition in a custom block syntax that filters and sorts documents.
- **Attributes**:
- `document_type` (string): The type of document to query.
- `filters` (array): A list of filter conditions (e.g., `property == value`).
- `sort_by` (array): A list of properties to sort the results by.
### View
- **Description**: A virtual buffer that displays the results of a query.
- **Attributes**:
- `query` (Query): The query that generated the view.
- `documents` (array): A list of documents that match the query.