Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

nodeRelationTypes

Associated relationship types for Neo4j database node

Syntax

nodereltypes = nodeRelationTypes(node,direction)

Description

example

nodereltypes = nodeRelationTypes(node,direction) returns the relationship types for the specified Neo4jNode object and direction.

Examples

collapse all

Create a Neo4j® database connection using the URL http://localhost:7474/db/data, user name neo4j, and password matlab.

url = 'http://localhost:7474/db/data';
username = 'neo4j';
password = 'matlab';

neo4jconn = neo4j(url,username,password);

Check the Message property of the Neo4j® connection object neo4jconn.

neo4jconn.Message
ans =

     []

The blank Message property indicates a successful connection.

Search the database for the node with node identifier 2 using the Neo4j® database connection neo4jconn.

nodeid = 2;

node = searchNodeByID(neo4jconn,nodeid);

Search for all incoming relationships for the node.

nodereltypes = nodeRelationTypes(node,'in')
nodereltypes =

  cell

    'knows'

nodereltypes returns a list of the relationship types.

Input Arguments

collapse all

Neo4j database node, specified as a Neo4jNode object created using searchNode or searchNodeByID.

Relationship direction, specified as one of these values. The relationships are associated with the specified origin node.

ValueDescription

'in'

Incoming relationship

'out'

Outgoing relationship

Output Arguments

collapse all

Relationship types, returned as a cell array of character vectors. The cell array contains one character vector for one relationship or multiple character vectors for multiple relationships.

Introduced in R2016b

Was this topic helpful?