Cypher Console — Care Intel knowledge graph

Reference for operators and analysts using the workbench Cypher Console (Power tier). Open it from Workbench → Cypher Console. This page is printable and shareable.

What the console runs

The console executes read-only Cypher against the canonical Apache AGE graph care_intel_graph. You type plain Cypher (e.g. MATCH (p:Provider) RETURN p LIMIT 25); the Monitor API wraps and runs it through AGE and enforces all safety constraints server-side. Results render as a table and can be exported to CSV.

You do not write the SELECT * FROM cypher(...) wrapper — just the Cypher body. Run with the Run button or Ctrl/Cmd + Enter.

Getting started

  1. Open Cypher Console from the workbench sidebar (Power entitlement required).
  2. Type or paste a query in the editor.
  3. Press Ctrl/Cmd + Enter or click Run.
  4. Inspect the table; use Export CSV to download, or pick a previous query from history.
  5. Always include a LIMIT while exploring to keep results fast.

Graph model (labels & edges)

Biolink is the primary semantic layer; UMLS CUIs, SNOMED, ICD, RxNorm, LOINC and NPI live as attributes on nodes. Common node labels:

LabelRepresentsUseful properties
ProviderClinician / NPIkg_id, name, npi, state, specialty
HospitalFacilitykg_id, name, state
DrugDrug / productkg_id, name, rxnorm, ndc
ConditionDisease / disorderkg_id, name, icd_code
ClinicalConceptUMLS/SNOMED conceptkg_id, umls_cui, snomed_concept_id
ClinicalTrialTrialkg_id, nct_id, title
GeneGenekg_id, symbol
MsspAco, ReachAcoACO entitieskg_id, name

Common edge (relationship) types

MAPS_TO, IS_A, LOCATED_IN, LOCATED_AT, PRACTICES_AT, SPECIALIZES_IN, AFFILIATED_WITH, PRESCRIBES, TREATS, HAS_FINDING_SITE, SERVES_COUNTY, NARROW_MATCH, COMPONENT. Edges carry biolink_predicate and source_table for provenance.

Not sure what exists? Run the label / edge census queries below first — they show you exactly which labels and relationship types are populated right now.

Starter queries you can run

Copy any of these straight into the console.

1. Count all nodes

MATCH (n) RETURN count(n) AS nodes

2. Count all relationships

MATCH ()-[r]->() RETURN count(r) AS edges

3. Node census by label

MATCH (n)
RETURN labels(n) AS label, count(*) AS n
ORDER BY n DESC
LIMIT 50

4. Relationship census by type

MATCH ()-[r]->()
RETURN type(r) AS rel_type, count(*) AS n
ORDER BY n DESC
LIMIT 50

5. Inspect provider nodes

MATCH (p:Provider)
RETURN p.kg_id AS kg_id, p.name AS name, p.npi AS npi, p.state AS state, p.specialty AS specialty
LIMIT 25

6. Providers in a state by specialty

MATCH (p:Provider)
WHERE p.state = 'CA' AND p.specialty CONTAINS 'Cardio'
RETURN p.name AS name, p.npi AS npi, p.specialty AS specialty
LIMIT 50

7. Where a provider practices (1-hop)

MATCH (p:Provider)-[:PRACTICES_AT]->(f)
RETURN p.name AS provider, labels(f) AS facility_label, f.name AS facility
LIMIT 50

8. Disease → clinical concept mappings (cross-ontology)

MATCH (c:Condition)-[:MAPS_TO]->(k:ClinicalConcept)
RETURN c.name AS condition, c.icd_code AS icd, k.umls_cui AS cui, k.snomed_concept_id AS snomed
LIMIT 50

9. SNOMED IS_A hierarchy (broader concepts)

MATCH (a:ClinicalConcept)-[:IS_A]->(b:ClinicalConcept)
RETURN a.snomed_concept_id AS child, b.snomed_concept_id AS parent
LIMIT 50

10. Trials for a condition

MATCH (t:ClinicalTrial)-[r]->(c:Condition)
RETURN t.nct_id AS nct, t.title AS title, type(r) AS rel, c.name AS condition
LIMIT 50

11. Top-degree nodes (most connected)

MATCH (n)-[r]-()
RETURN labels(n) AS label, n.name AS name, count(r) AS degree
ORDER BY degree DESC
LIMIT 25

12. Edge provenance (which source built it)

MATCH ()-[r]->()
RETURN r.source_table AS source, type(r) AS rel_type, count(*) AS n
ORDER BY n DESC
LIMIT 50

Building your own queries

Cypher reads like a sentence describing a path of nodes and relationships. Compose new queries from these building blocks:

Worked example: build "drugs that treat a condition, ranked by evidence"

MATCH (d:Drug)-[r:TREATS]->(c:Condition)
WHERE c.name CONTAINS 'diabetes'
RETURN d.name AS drug, c.name AS condition, r.source_table AS evidence
ORDER BY drug
LIMIT 50

Start from the census queries (#3, #4) to confirm which labels and edge types actually exist, pick the ones you need, then add filters and a return shape. If a query returns nothing, loosen the filter or check the label/edge name against the census output.

Safety & limits