Cypher is a declarative query language for LPG knowledge graphs. It expresses graph patterns directly, making relationships and relationship-level metadata readable and accessible for querying, integration, and updates. section 3.2.2 section 3.2
A practical Cypher workflow commonly proceeds as follows:
- Match nodes and relationships by labels, types, identifiers, and graph patterns. section 3.2.2
- Filter matched entities with conditions such as disease and phenotype identifiers. section 3.2.2
- Return node, relationship, or property values, including annotation source, creator, and creation date. section 3.2.2
- Load tabular data, merge entities and relationships, conditionally set properties, batch-enrich records, and delete unnecessary graph elements. section 3.3.2 section 3.3.2
Retrieving annotated disease–phenotype relationships
MATCH (d)-[r:HAS_PHENOTYPIC_FEATURE]->(p) WHERE d.id = "OMIM:222100" and p.id = "HP:0410050" RETURN r.source, r.createdBy, r.creationDate This query follows a disease-to-phenotype relationship, restricts both endpoint identifiers, and returns metadata stored directly on the relationship. The same representation supports evidence, onset, frequency, sex, and other annotation properties. section 3.2.2 section 3.3.2
Listing 3.12 Example Cypher query
MATCH (d)-[r:HAS_PHENOTYPIC_FEATURE]->(p) WHERE d.id = "OMIM:222100" and p.id = "HP:0410050" RETURN r.source, r.createdBy, r.creationDate
Inspect the complete Cypher listing for matching a disease–phenotype pattern, filtering endpoint identifiers, and returning relationship annotations. section 3.2.2
Figure 14.11 The complete flow of transforming a natural language question into a Cypher query, showing how three inputs are processed through structured prompt components. The process is organized into three stages (Input processing, Context building, and Final guidelines) that culminate in structured JSON output.
Follow the structured pipeline that turns a natural-language question, schema annotations, and intent requirements into a Cypher query. section 14.7.2



