Neo4jRelation
Neo4j database relationship
Description
The Neo4jRelation
object represents a single relationship in
a Neo4j® database. Use this object to find information about the relationship
between two nodes in a Neo4j database.
Creation
Create a Neo4jRelation
object using the createRelation
, searchRelation
, and searchRelationByID
functions.
Properties
This property is read-only.
Relationship identifier, specified as a numeric scalar. The Neo4j database assigns this number automatically.
Example:
3
Data Types: double
This property is read-only.
Relationship data consisting of property keys and values for the unique relationship in the Neo4j database, specified as a structure. If the relationship has no properties, then this structure contains no fields.
Data Types: struct
This property is read-only.
Start node identifier, specified as a numeric scalar. This number specifies the start node of the Neo4j database relationship.
Example:
3
Data Types: double
This property is read-only.
Relationship type, specified as a character vector. This character vector specifies the type of the Neo4j database relationship.
Example: 'knows'
Data Types: char
This property is read-only.
End node identifier, specified as a numeric scalar. This number specifies the end node of the Neo4j database relationship.
Example:
7
Data Types: double
Examples
Search for information about a Neo4jRelation
object in a Neo4j® database and display the information.
Assume that you have graph data stored in a Neo4j database that represents a social neighborhood. This database has seven nodes and eight relationships. Each node has only one unique property key name
with values User1
through User7
. Each relationship has the type knows
.
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
. The blank Message
property indicates a successful connection.
neo4jconn.Message
ans = []
Search the database for the relationship with the identifier 3
by using the Neo4j database connection.
relationid = 3; relinfo = searchRelationByID(neo4jconn,relationid)
relinfo = Neo4jRelation with properties: RelationID: 3 RelationData: [1×1 struct] StartNodeID: 1 RelationType: 'knows' EndNodeID: 3
relinfo
is a Neo4jRelation
object with these properties:
Relationship identifier
Relationship data
Start node identifier
Relationship type
End node identifier
Access the property keys and values of the relationship using the property RelationData
. Here, the relationship does not contain properties, so the structure has no fields.
relinfo.RelationData
ans = struct with no fields.
Version History
Introduced in R2018a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Sélectionner un site web
Choisissez un site web pour accéder au contenu traduit dans votre langue (lorsqu'il est disponible) et voir les événements et les offres locales. D’après votre position, nous vous recommandons de sélectionner la région suivante : .
Vous pouvez également sélectionner un site web dans la liste suivante :
Comment optimiser les performances du site
Pour optimiser les performances du site, sélectionnez la région Chine (en chinois ou en anglais). Les sites de MathWorks pour les autres pays ne sont pas optimisés pour les visites provenant de votre région.
Amériques
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)