%% Create Single Node with Label
% Create a single node with a label in a Neo4j® database and access the node.
%
% 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

%
% Create a single node with a label in the database by using the Neo4j database connection. Use the 'Labels' name-value pair argument to specify the label Scientist.

label = 'Scientist';
createNode(neo4jconn,'Labels',label)

%
% Search for the new node using the label Scientist.

nodeinfo = searchNode(neo4jconn,label)

% nodeinfo is a Neo4jNode object with these properties:
% Node identifier
% Node data
% Node labels
%
% Close the database connection.

close(neo4jconn)

% Copyright 2018 The MathWorks, Inc.