CREATE Semantic Definitions

Generic Description

The abstraction catalog now has direct Cypher DDL for the schema-level objects that were previously procedure-only:

The common shape is:

CREATE FEATURE 'actor.base_score' OPTIONS {
  abstraction: 'Member',
  subject_type: 'ACTOR',
  grain: 'actor_day',
  output_type: 'FLOAT',
  as_of_mode: 'snapshot',
  refresh_mode: 'batch',
  query: 'MATCH (u:User) RETURN u.id AS subject_id, 1.0 AS value'
}

Analysis-run and report definitions use the same OPTIONS shape:

CREATE ANALYSIS RUN ChurnSeparabilityRules OPTIONS {
  kind: 'separability_filter',
  lens: 'ChurnInvestigation',
  target_abstraction: 'Member',
  target_feature: 'churned',
  confidence: 0.82,
  segment: 'low_activity',
  reason: 'Low recent activity separates churned members in the current feature snapshot.'
}

For analysis runs and reports, Nexyron lifts the stable identity fields out of OPTIONS when the definition is stored. kind is treated as the artifact subtype, while the catalog object's semantic family remains ANALYSIS_RUN or REPORT. The lifted fields are artifact_type, status, slug, description, definition, content, content_type, source, and query. Remaining keys stay in the registered options map. List/read procedures expose content as its own column instead of duplicating large report or dataset payloads inside options_json.

This matters most for generated wiki-style reports. description, definition, query, slug, and visible text extracted from content are the searchable report identity. For saved wiki reports, content is the canonical cards array JSON: each card carries its rendered HTML plus hidden source ids and origins. That avoids storing both a joined HTML blob and a duplicate cards option. The semantic embedding path reads visible card HTML and ignores hidden provenance metadata such as card ids, source ids, node ids, and origin maps.

Consumer-Level Explanation

Use these clauses when the object you are creating is part of the database contract, not just an ad hoc runtime action.

That means:

By contrast, actions such as BUILD, MATERIALIZE, SERVE, DECIDE, APPLY, and EVALUATE are still runtime operations and remain procedures.

Conceptual Explanation

These clauses close the gap between CREATE ABSTRACTION and the rest of the abstraction platform.

Before this change, Nexyron already had first-class abstractions in Cypher, but the next layers still had to be declared with CALL nexyron.*_register(...).

Now the abstraction stack has a more coherent DDL story:

That split is the logical one.

Advanced Example

CREATE SNAPSHOT actor_daily_snapshot OPTIONS {
  subject_type: 'ACTOR',
  subject_abstraction: 'Member',
  grain: 'actor_day',
  as_of_mode: 'snapshot',
  features: ['actor.base_score', 'actor.visit_gap_30d']
};

CREATE DATASET training_set OPTIONS {
  snapshot: 'actor_daily_snapshot',
  label_query: 'MATCH (u:User) RETURN u.id AS subject_id, CASE WHEN u.status = \"churned\" THEN 1 ELSE 0 END AS value',
  split_policy: 'random_holdout',
  status: 'active'
};

CREATE MODEL churn_linear_v1 OPTIONS {
  snapshot: 'actor_daily_snapshot',
  model_kind: 'linear',
  output_type: 'FLOAT',
  score_mode: 'logistic',
  bias: 0.0,
  weights: [{feature: 'actor.base_score', weight: 1.0}],
  version: 70,
  status: 'active'
};

CREATE POLICY email_high_risk OPTIONS {
  model: 'churn_linear_v1',
  intervention: 'RetentionEmail',
  action_type: 'retention_email',
  max_actions: 500,
  status: 'active'
};

CREATE REPORT churn_investigation_summary OPTIONS {
  kind: 'semantic_search_wiki_report',
  slug: 'churn-investigation-summary',
  definition: 'Churn investigation summary',
  description: 'A generated report explaining behavioral dropout and churn risk.',
  content_type: 'application/vnd.nexyron.semantic-search-wiki-report.cards+json',
  content: '[{"card_id":"wiki_123:card:cover","row_role":"cover","html":"<article class=\"search-row layout-full\"><h2 class=\"row-title\">Churn investigation summary</h2></article>","source_item_ids":["knowledge_abstraction:ChurnRisk"],"origins":{"observed_business_data":{"nodes":[],"edges":[]},"abstractions":["ChurnRisk"]}}]',
  source: 'client_semantic_search',
  lens: 'ChurnInvestigation',
  analysis_run: 'ChurnSeparabilityRules',
  abstraction_selection: ['Member'],
  status: 'draft'
};

Real Use Cases

Real Limitations And Tradeoffs