Observed since 20 Oct, 17:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Semantics registry (predicates/types) for AbstractFramework.
abstractsemantics)Central, editable semantics registry (predicates + entity types) for AbstractFramework, with helpers to build a compact JSON Schema for knowledge-graph (KG) assertion structured outputs.
This package intentionally contains definitions, not storage:
abstractsemantics is a small, standalone building block within the wider AbstractFramework ecosystem:
In practice, this repo provides the shared allowed ids (predicates, entity types, and memory relations) and a small JSON Schema helper that downstream components (including runtimes) can use for validation and structured outputs.
Small, dependency-light package (only PyYAML) with a tiny public API:
abstractsemantics/semantics.yaml; in this repo: src/abstractsemantics/semantics.yaml)SemanticsRegistry)normalize_kg_predicate() maps extractor-emitted predicates to canonical ids at your ingestion boundaryThis package makes no network calls and does not store/query data (see src/abstractsemantics/registry.py and src/abstractsemantics/schema.py).
From PyPI:
pip install abstractsemantics
From source (editable, with test deps):
pip install -e ".[dev]"
Requires Python >=3.10 (see pyproject.toml).
For framework-wide dependency manifests, the no-op compatibility extras
abstractsemantics[apple], abstractsemantics[gpu],
abstractsemantics[all-apple], and abstractsemantics[all-gpu] are available.
They do not add dependencies because this package owns semantics definitions,
not hardware runtimes.
Load the default registry and build the v0 structured-output schema:
from abstractsemantics import load_semantics_registry, build_kg_assertion_schema_v0
reg = load_semantics_registry()
print(len(reg.predicates), len(reg.entity_types))
schema = build_kg_assertion_schema_v0(registry=reg, include_predicate_aliases=True)
Read the memory-relation vocabulary and the validation set for memory-record writes:
from abstractsemantics import load_semantics_registry
reg = load_semantics_registry()
print(sorted(reg.memory_relation_ids()))
print(sorted(reg.memory_record_predicate_ids()))
supports = next(r for r in reg.memory_relations if r.id == "supports")
print(supports.subject_role, "->", supports.object_role) # evidence -> claim
Normalize an extractor-emitted predicate before persisting it:
from abstractsemantics import normalize_kg_predicate
normalize_kg_predicate("schema:hasPart", registry=reg) # 'dcterms:hasPart'
normalize_kg_predicate("something:invented", registry=reg) # None
Resolve a stable $ref (useful when a downstream system stores schema references rather than full dicts):
from abstractsemantics import KG_ASSERTION_SCHEMA_REF_V0, resolve_schema_ref
schema = resolve_schema_ref({"$ref": KG_ASSERTION_SCHEMA_REF_V0})
assert isinstance(schema, dict)
Use a custom registry YAML (must exist on disk):
export ABSTRACTSEMANTICS_REGISTRY_PATH=/absolute/path/to/semantics.yaml
from abstractsemantics import load_semantics_registry
reg = load_semantics_registry() # loads from ABSTRACTSEMANTICS_REGISTRY_PATH if set
Note: load_semantics_registry() only requires at least 1 predicate, but build_kg_assertion_schema_v0() requires both predicate ids and entity-type ids (it raises ValueError if entity_types is empty).
flowchart LR
YAML[src/abstractsemantics/semantics.yaml] --> Loader[load_semantics_registry()]
Loader --> Reg[SemanticsRegistry]
Reg --> Builder[build_kg_assertion_schema_v0()]
Builder --> Schema[JSON Schema dict]
Schema --> Consumers[AbstractRuntime / other consumers]
Typical consumers include:
Start with:
docs/getting-started.md (recommended entrypoint)docs/README.md (documentation index)docs/architecture.md (what exists in this repo, with diagrams)docs/registry.md (registry YAML format)docs/schema.md (KG assertion JSON Schema + $ref)docs/api.md (public API surface)docs/faq.md (common questions)docs/troubleshooting.md (symptoms, causes, and fixes)CHANGELOG.mdCONTRIBUTING.mdCODE_OF_CONDUCT.mdSECURITY.mdACKNOWLEDGMENTS.mdMIT (see LICENSE).
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.0.5 | 6 Aug 2026 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e50606ba0773011215b59e310f4f65167b3707bddbd42871d575ca40fa163cd6