Skip to content
This repository was archived by the owner on May 24, 2022. It is now read-only.

Graph Exploration

seventwenty edited this page Sep 12, 2014 · 21 revisions

The central data hub of d:swarm is powered by the graph database Neo4j. The web-based Neo4j Graph Browser lets you explore the contents of the data hub. The web application can be accessed at this URL http://sdvdswarm01.slub-dresden.de/neo/.

The Neo4j Graph Browser

Overview

These are the basic functions directly accessible from the starting page:

(enlarge figure)

  • (1) shows an overview or the node labels, edges (relationship types), attributes (property keys) that can be used as entry points into the graph.
  • (2) lets you manipulate the graph; contains sample queries and shows details of the graph configuration.
  • (3) lets you browse Neo4j’s documentation, help, tutorials etc.
  • (4) input field for Cypher queries. There is also an overview and short introduction to Cypher.

Graph Exploration

(enlarge figure)

  • (1) an overview of all node labels (i.e. resource types, cf. graph data model) in the graph.

    • Note: Node labels cannot be deleted from the graph database, i.e. node labels of deleted nodes will still show up in this overview.
  • (2) an overview of all relationship types (i.e. attributes or predicates) in the graph.

    • Note: Relationship types cannot be deleted from the graph database, i.e. relationship types of deleted edges (relationships) will still show up in this overview.
  • (3) an overview of all property keys (attributes of nodes and edges) in the graph.

  • (4) a currently selected node label (http://data.slub-dresden.de/resources/1/schema#RecordType). Selecting a node label sends a Cypher query. The result is presented visually or in a grid.

  • (5) sample Cypher query for retrieving a node with the node label ‘http://data.slub-dresden.de/resources/1/schema#RecordType‘ limited to 25 results maximum:

    MATCH (n:`http://data.slub-dresden.de/resources/1/schema#RecordType`) RETURN n LIMIT 25

  • (6) the visual representation of the results showing nodes and their identifiers (e.g. http://data.slub-dresden.de/datamodels/2/records/788e0248-f417-4e72-a6ed-e8cf0baa4546)

    • Note: Double clicking a node will show all in-coming and out-going edges (and their starting or ending nodes) of the node.

Example

This is an example of a record imported from a CSV file an its mapping. It can be retrieved with this query:

MATCH (n)-[r]->(m) WHERE n.__URI__ = "http://data.slub-dresden.de/datamodels/2/records/788e0248-f417-4e72-a6ed-e8cf0baa4546" RETURN n, r, m;

(enlarge figure)

Note: If a relationship (edge) is selected, the detail view shows all property keys of the relationship (edge attributes and edge type, i.e. attribute or predicate of the statement).

Useful Cypher Queries

This overview can provide only a brief glance at Cypher queries. There are more d:swarm related queries in the Cypher Cheat Sheet. For a detailed explanation of the capabilities of Cypher, please refer to Cypher Reference Card.

  • Retrival (recursive) of all statements that belong to record of the record type ‘http://www.openarchives.org/OAI/2.0/recordType‘, i.e. “show me all (hierarchically structured) records of this resource type in the graph”: MATCH (n:`http://www.openarchives.org/OAI/2.0/recordType`)-[r*]->(m) RETURN n, r, m;
  • Retrieval of all statements with the following attributes: ‘http://data.slub-dresden.de/resources/1/schema#description‘ MATCH (n)-[r:`http://data.slub-dresden.de/resources/1/schema#description`]->(m) RETURN n, r, m;
  • Retrieval of all resource types used in the graph, i.e. “show me all resource type nodes of the resource type rdfs:Class” : MATCH (n:`http://www.w3.org/2000/01/rdf-schema#Class`) RETURN n;

Note: In the graph exploration tab, all resource types in the graph will be shown. A possible difference of this Cyber query is the fact that it will show all resource types currently existent in the graph, while the exploration tab lists also those types that used to be existent but have been deleted.

(enlarge figure) img/.png

Clone this wiki locally