Skip to main content

Graph Explorer

Graph Explorer is a tool for visually exploring and analyzing ontology data that has been built. It queries and visualizes data loaded into the Neo4j graph database using Cypher queries.

Screen Layout

[Screenshot] Graph Explorer

Graph Explorer

1. Metadata Panel

The left panel displays graph schema information for the currently selected collection.

  • Labels (Nodes): List of defined entity labels (e.g., Person, Company)
    • The number of nodes is displayed next to each label.
  • Relationship Types: List of defined relationship types (e.g., BOUGHT, MANAGED)
    • The number of relationships is displayed next to each type.
  • Property Keys: List of property keys in use
  • Clicking an item automatically executes a query to retrieve all data of that type.

2. Visualization Area

The center screen displays queried data in graph form (nodes and links).

  • Interaction: You can drag nodes or zoom in/out.
  • Details: Clicking a node or link displays the element's property information.
  • Extended Exploration: Double-clicking a node retrieves additional connected neighbor nodes.
  • Layout: Auto-arranged using force-directed layout, with manual adjustment available.

3. Query Editor

The bottom panel allows you to write and execute Cypher queries directly.

  • Query Input: Supports Cypher, Neo4j's standard query language.
  • Run: Executes the query and reflects results in the visualization area.
  • Result Views: View results in graph, table, or text format.

Cypher Query Guide

Basic Pattern Matching

-- Query all Person nodes
MATCH (p:Person)
RETURN p
LIMIT 100

-- Query nodes connected by specific relationship
MATCH (p:Person)-[:BOUGHT]->(product:Product)
RETURN p, product
LIMIT 50

-- Conditional filtering
MATCH (p:Person)-[:BOUGHT]->(product)
WHERE p.age > 30 AND product.price > 10000
RETURN p, product

Aggregation Queries

-- Node count by label
MATCH (n)
RETURN labels(n) as label, count(*) as count
ORDER BY count DESC

-- Relationship statistics
MATCH ()-[r]->()
RETURN type(r) as relationship, count(*) as count
ORDER BY count DESC

-- Customers with most purchases
MATCH (p:Person)-[:BOUGHT]->(product)
RETURN p.name, count(product) as purchase_count
ORDER BY purchase_count DESC
LIMIT 10

Path Exploration

-- Shortest path between two nodes
MATCH path = shortestPath(
(a:Person {name: "Alice"})-[*]-(b:Person {name: "Bob"})
)
RETURN path

-- N-hop neighbor query
MATCH (p:Person {name: "Alice"})-[*1..3]-(neighbor)
RETURN DISTINCT neighbor
LIMIT 50

Useful Cypher Functions

FunctionDescriptionExample
count()Count itemscount(n)
collect()Collect into listcollect(n.name)
labels()Get node labelslabels(n)
type()Get relationship typetype(r)
properties()Get all propertiesproperties(n)
size()List sizesize(collect(n))
coalesce()NULL replacementcoalesce(n.name, "Unknown")

Result View Modes

Graph View

  • Displays nodes and relationships visually.
  • Node colors are automatically assigned by label.
  • Node size can be adjusted based on property values.

Table View

  • Displays query results in tabular format.
  • Supports column sorting and filtering.
  • Supports export to CSV.

Text View

  • View results in raw JSON format.
  • Useful for debugging or detailed data inspection.

Data Exploration Tips

  • To view only nodes of a specific label, click that label in the metadata panel.
  • To find complex patterns, write MATCH statements directly in the query editor.
  • If there are too many nodes and it becomes cluttered, use the LIMIT clause to restrict the number of results.
  • For performance, filter by indexed properties whenever possible.

Query History

Previously executed queries are saved in history and can be re-executed.

  • Click the History button at the top of the query editor.
  • Select the desired query from the list of recently executed queries.
  • Frequently used queries can be added to Favorites.