Vedākṣha

Integration Guide — Graph Output

Every chart is a graph.

Vedākṣha does not produce a flat list of planetary positions. Every computation also yields a ChartGraph — a typed property graph with 10 node types and 13 edge types. The same function call that returns longitudes also returns a structure you can stream directly into Neo4j, SurrealDB, or a vector store.

Graph construction is zero-cost — it happens during the same traversal that computes dignities, aspects, and yogas. There is no separate "export" step.

10 Node Types

Chart

The root node. Carries the Julian Day, geographic coordinates, ayanamsha value, house system, and the data classification tag. Every other node in the graph hangs off a Chart.

Planet

One node per computed body. Carries longitude, latitude, distance, daily speed, retrograde flag, dignity score, and localized name. Includes Sun through Ketu plus any additional bodies in the config.

Sign

One of the 12 zodiac signs. Carries element, modality, ruling planet reference, and start/end longitude boundaries. Sign nodes are shared across charts — same sign, same node ID.

House

One per cusp in the selected house system (1–12 for most systems, 1–8 for equal-time systems). Carries cusp longitude, natural significations, and the sign it starts in.

Nakshatra

One of the 27 lunar mansions. Carries its ruling planet, start longitude, end longitude, deity, and motivational quality (Dharma / Artha / Kama / Moksha). Shared across charts.

Pada

One of 108 padas — each nakshatra's four quarters. Carries the pada number (1–4), its Navamsha sign, and its Varga lord. Used for KP sub-lord resolution.

Pattern

A multi-body geometric pattern detected in the chart — Grand Trine, T-Square, Yod, Grand Cross, or Kite. Carries the pattern type, participating planet IDs, and an orb score.

DashaPeriod

A node in the dasha tree. Carries the dasha lord planet reference, start Julian Day, end Julian Day, duration in days, and level (1 = Mahadasha, 2 = Antardasha, etc.).

Yoga

A classical Vedic yoga detected in the chart. Carries the yoga name, source text (e.g. BPHS), participating planets, a strength score, and a brief natural language description.

FixedStar

A notable fixed star within configured orb of a planet or house cusp. Carries the star name, Hipparcos catalogue ID, longitude, latitude, magnitude, and traditional signification.

13 Edge Types

PlanetIN_SIGNSign

Connects a planet to the zodiac sign it occupies at the chart moment.

PlanetIN_HOUSEHouse

Connects a planet to its house placement in the selected house system.

PlanetIN_NAKSHATRANakshatra

Connects a planet to its lunar mansion.

PlanetIN_PADAPada

Connects a planet to its specific nakshatra quarter (1–4).

PlanetASPECTSPlanet

Carries orb (degrees), applying/separating flag, aspect type, and strength score.

PlanetRULESSign

Encodes planetary rulership. Each sign has a traditional lord and an optional modern co-ruler.

PlanetPARTICIPATES_INYoga

Connects a planet to every yoga it contributes to, with its specific role in the formation.

HouseSTARTS_INSign

Connects a house cusp to the sign where it falls. Enables sign-based house analysis.

ChartHAS_PLANETPlanet

Enumerates all computed bodies in this chart.

ChartHAS_PATTERNPattern

Enumerates all multi-body patterns detected at the chart moment.

ChartHAS_DASHADashaPeriod

The top-level Mahadasha nodes for this chart's dasha tree.

DashaPeriodHAS_ANTARDASHADashaPeriod

Recursive edge building the full dasha tree (up to 5 levels).

ChartCONTAINS_FIXED_STARFixedStar

Stars within the configured orb of any planet or house cusp in this chart.

Deterministic IDs

Every node ID is derived deterministically from its content. The same Julian Day and coordinates always produce the same graph with the same node IDs. Shared nodes — Signs, Nakshatras, Padas — have IDs derived from their intrinsic properties and are identical across every chart.

This makes MERGE-based upserts idempotent: you can re-import the same chart any number of times and nothing changes. It also means graph IDs are stable foreign keys for relational or document stores.

Emitting to Neo4j — Cypher

Call emit_cypher() on any ChartGraph. The output is a sequence of MERGE statements — safe to run multiple times.

import.cypher
// Generated by vedaksha::emit::cypher()
// Deterministic IDs — safe to re-run

MERGE (c:Chart {id: "chart_2j5k9x"})
  ON CREATE SET
    c.julian_day   = 2460389.0,
    c.latitude     = 28.6139,
    c.longitude    = 77.2090,
    c.ayanamsha    = "Lahiri",
    c.house_system = "Placidus"

MERGE (p:Planet {id: "planet_sun_2j5k9x"})
  ON CREATE SET
    p.name      = "Sun",
    p.longitude = 336.14,
    p.speed     = 1.01,
    p.retrograde = false

MERGE (s:Sign {id: "sign_pisces"})
  ON CREATE SET s.name = "Pisces", s.element = "Water"

MERGE (c)-[:HAS_PLANET]->(p)
MERGE (p)-[:IN_SIGN]->(s)

Full output includes all 10 node types and 13 relationship types with all properties set.

Emitting to SurrealDB — SurrealQL

Call emit_surrealql(). Uses SurrealDB typed record IDs and RELATE syntax for graph edges.

import.surql
-- Generated by vedaksha::emit::surrealql()

INSERT OR IGNORE INTO chart {
  id: chart:⟨2j5k9x⟩,
  julian_day:   2460389.0,
  latitude:     28.6139,
  longitude:    77.2090,
  ayanamsha:    "Lahiri",
  house_system: "Placidus"
};

INSERT OR IGNORE INTO planet {
  id:        planet:⟨sun_2j5k9x⟩,
  name:      "Sun",
  longitude: 336.14,
  speed:     1.01,
  retrograde: false
};

INSERT OR IGNORE INTO sign {
  id: sign:⟨pisces⟩, name: "Pisces", element: "Water"
};

RELATE chart:⟨2j5k9x⟩->has_planet->planet:⟨sun_2j5k9x⟩;
RELATE planet:⟨sun_2j5k9x⟩->in_sign->sign:⟨pisces⟩;

Emitting to JSON-LD

Call emit_jsonld(). Uses a Schema.org-compatible context with custom Vedic terms. Output is SPARQL and RDF compatible.

chart.jsonld
{
  "@context": {
    "@vocab": "https://vedaksha.net/ontology/",
    "schema": "https://schema.org/"
  },
  "@type": "Chart",
  "@id": "urn:vedaksha:chart:2j5k9x",
  "julianDay":   2460389.0,
  "latitude":    28.6139,
  "longitude":   77.2090,
  "ayanamsha":   "Lahiri",
  "hasPlanet": [
    {
      "@type": "Planet",
      "@id": "urn:vedaksha:planet:sun:2j5k9x",
      "name":      "Sun",
      "longitude": 336.14,
      "inSign": {
        "@type": "Sign",
        "@id": "urn:vedaksha:sign:pisces",
        "name": "Pisces"
      }
    }
  ]
}

Embedding Text for RAG Pipelines

Call emit_embedding_text(). Returns one natural-language chunk per node, optimised for retrieval. Each chunk carries the node ID as metadata so retrieved context can be re-hydrated into the full graph.

Chart

Natal chart computed for 20 March 2024, 12:00 UT at 28.61°N 77.21°E. Ayanamsha: Lahiri (23°51′). House system: Placidus.

Planet — Sun

Sun at 336°08′ Pisces, House 12. Speed +1.01°/day. Direct. Dignity: own-sign triplicity. Nakshatra: Uttara Bhadrapada, Pada 4.

Yoga

Hamsa Yoga active. Jupiter in Kendra in own sign Sagittarius. Strength score 84/100. Source: Brihat Parashara Hora Shastra ch. 35.

DashaPeriod

Venus Mahadasha. Active 2021-08-14 to 2041-08-14. Current Antardasha: Venus–Jupiter, ending 2024-08-08.

Data Classification

Every ChartGraph carries a data classification tag in its Chart node. The tag is set by the caller at construction time and flows through to all emitter outputs as a property on the Chart record.

Anon

Anonymous

No birth data in the graph. Only Julian Day and coordinates. Cannot be linked back to a person without external information. Safe for unrestricted storage and sharing.

Pseudo

Pseudonymized

Chart linked to an opaque ID (e.g. UUID) rather than a name. The mapping between ID and person is stored separately. Compliant with most data minimisation requirements.

Identified

Identified

Chart carries a name or other identifying attribute in a node property. Treat as personal data. Apply appropriate access controls and retention policies.

Code Example — Compute Chart and Emit Cypher

emit_to_neo4j.rs
use vedaksha::prelude::*;
use vedaksha::emit::Cypher;

fn main() {
    let jd = calendar_to_jd(2024, 3, 20, 12.0);

    let config = ChartConfig {
        house_system: HouseSystem::Placidus,
        ayanamsha: Ayanamsha::Lahiri,
        data_class: DataClass::Anonymous,
        ...ChartConfig::vedic()
    };

    // compute_chart returns Result<ChartGraph, ComputeError>
    let graph = compute_chart(jd, 28.6139, 77.2090, &config)?;

    // Emit deterministic MERGE statements
    let cypher = graph.emit::<Cypher>();

    // stream to Neo4j — one statement per line
    for stmt in &cypher.statements {
        neo4j_session.run(stmt).await?;
    }

    Ok(())  // ComputeError propagated via ? operator
}