Graph API Overview
The Graph API provides access to the core functionality of the Quran Knowledge Graph, allowing you to query nodes, traverse relationships, and explore the interconnected structure of the Quranic text.Key Concepts
Before diving into the API details, it’s important to understand a few key concepts:Nodes
Nodes represent entities in the graph, such as:- Chapter: Surahs of the Quran
- Verse: Individual verses (ayahs)
- Word: Words within verses
- Root: Linguistic roots of words
- Topic: Thematic elements
- Translation: Translations in different languages
- Tafsir: Exegetical commentaries
Relationships
Relationships connect nodes and represent meaningful associations, such as:- CONTAINS: Connects chapters to verses, verses to words
- HAS_ROOT: Connects words to their linguistic roots
- ADDRESSES_TOPIC: Connects verses to the topics they address
- SIMILAR_TO: Connects semantically similar verses
- HAS_TRANSLATION: Connects verses to their translations
Properties
Both nodes and relationships can have properties that provide additional information:- Chapter properties include name, revelation place, verse count
- Verse properties include text, verse number, embedding vector
- Relationship properties include relevance scores, positions
API Structure
The Graph API is organized into several components:Node Operations
- Retrieve nodes by ID or properties
- Get node properties
- Find nodes by type and criteria
Relationship Operations
- Traverse relationships between nodes
- Get relationship properties
- Find connected nodes
Query Operations
- Execute Cypher queries
- Perform graph traversals
- Apply filters and aggregations