Metadata-Version: 2.5
Name: metaformat
Version: 0.1.0a1
Summary: Experimental locus/relation engine for attributable semantic facts over heterogeneous records
Project-URL: Homepage, https://github.com/saya-si/metaformat
Project-URL: Repository, https://github.com/saya-si/metaformat
Project-URL: Issues, https://github.com/saya-si/metaformat/issues
Author-email: Saya <saya@mindey.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: data-integration,interoperability,metadata,provenance,semantic-data
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# metaformat

Experimental alpha. Not a frozen protocol specification.

metaformat is a small locus/relation engine for turning heterogeneous source records into attributable semantic facts without destructively replacing the source representation.

The motivating model is:

    raw record + sparse relation sets
            |
            v
    attributable semantic facts
            |
            v
    cheap deterministic joins and comparisons

A semantic fact retains a reversible route back toward the source:

    fact -> locus -> record -> origin -> affordance -> authority resolver

## Core ideas

- Loci identify a path inside an interpretation/source context.
- Relative loci let a relation set attach mid-context and remain relocatable.
- Sparse relation sets attach meaning, normalization, provenance, modality, affordances, authority references, and other open-ended relations to loci.
- Content-addressed relation sets make interpretations versionable without requiring mutable global schema IDs.
- Semantic facts retain both raw and normalized values plus source/provenance information.
- Cross-source joins operate on semantic coordinates such as (subject, concept) after mappings have been established.
- Unknown relation names remain ordinary data; partial understanding should not invalidate the rest.

## Example

    from metaformat import emit_facts, seal_relation_set

    profile = seal_relation_set({
        "base": {"context": "ctx:example", "path": "/devices/*"},
        "relations": {
            ".": [
                ["identity_by", {"path": "./id", "prefix": "device:"}],
            ],
            "./active": [
                ["means", "runtime:active"],
                ["normalize", "runtime:active-bool"],
            ],
        },
    })

    raw = {
        "devices": [
            {"id": "alpha", "active": "active"},
        ]
    }

    facts = emit_facts(raw, [profile], context="ctx:example")

## Status

This package began as an experimental kernel for a broader Metaformat idea: preserving interpretability, meta-addressability, provenance, semantic pluralism, composability, modality, affordances, authority separation, and partial intelligibility across heterogeneous information systems.

The current release intentionally implements only the small reusable kernel that has survived practical experiments so far. Expect API changes during the alpha series.

## License

Apache-2.0.
