---
question: How do I open the workspace graph explorer?
kind: task
via_web: available
via_cli: na
via_python: available
via_api: available
via_config: na
ref_web: Knowledge Graph
ref_python: get_subject_graph
ref_api: GET /api/graph/search
next:
  - /capabilities/build/knowledge-graph/sparql_query_template_system
  - /capabilities/build/knowledge-graph/manage-graphs
---

# Explore the graph

Nexus shows the triples a workspace may read: by class, as a table, or as a network. If a graph is missing, the workspace does not have read access to it: see [Manage graphs](/user-guide/build/knowledge-graph/manage-graphs).

## Web UI

### Open the explorer

In the Nexus workspace, open **Knowledge Graph**. The explorer shows an overview, a breakdown by class and the named graphs. Search with **Search instances and classes…**, or pick a class to list its instances.

![Knowledge Graph explorer overview](/abi/Screenshot_Graph.png)

*The explorer: counts for the selected graph, and the named graphs to pick from.*

### Build a table in the Composer

Choose **View › Composer**. Pick a class, then add columns and filters; the Composer runs the query and shows the rows. The **SPARQL** toggle shows the query the backend ran, read-only. The CSV export writes every row. **Save view** keeps the table under **Views**.

### See the network

Choose **View › Open Network** to see individuals and their relations as a graph. **View › Manage Individuals** lists the individuals; open one to see its properties and relations.

![Knowledge Graph network view](/abi/Screenshot_Graph_Network.png)

*View › Network: classes as nodes, colored by BFO bucket.*

## CLI

Not applicable. There is no `abi` command that reads the graph. Use another tab on this page. The command list is the [CLI reference](/user-guide/reference/cli).

## Python

The module lists `TripleStoreService` in its dependencies: see [Add data](/user-guide/build/knowledge-graph/add-data?via=python).

### List the named graphs

```python
store = self.engine.services.triple_store
store.list_graphs()   # [URIRef("http://ontology.naas.ai/graph/schema"), ...]
```

### Read one subject

```python
graph = store.get_subject_graph("http://ontology.naas.ai/my_module/acme")
for s, p, o in graph:
    print(p, o)
```

`get_subject_graph(subject, graph_name="*")` returns the subject's triples as an `rdflib.Graph`, from every named graph unless you name one. Anything more is a SPARQL query: see [Query with SPARQL](/user-guide/build/knowledge-graph/sparql_query_template_system?via=python).

## REST API

The graph routes of the Nexus API. Auth: a Nexus session of a workspace member (`POST /api/auth/login` returns the access token). Answers cover only the graphs the workspace may read.

### List the graphs

```bash
curl "http://localhost:9879/api/graph/list?workspace_id=$WORKSPACE_ID" \
  -H "Authorization: Bearer $NEXUS_TOKEN"
```

Graphs come grouped by role, each with `uri`, `label` and `can_write`.

### Search

```http
GET /api/graph/search?workspace_id={workspace_id}&q=acme
```

Classes and individuals that match the text, each tagged with its kind. `class_uri` and `graph_uri` narrow it; `limit` is at most 100.

## Config

Not applicable. What a workspace may read is its graph access: see [Manage graphs](/user-guide/build/knowledge-graph/manage-graphs?via=config).
