Introduction and use of neo4j

Source: Internet
Author: User
Tags install neo4j neo4j
Introduction to neo4j

Neo4j is a high-performance, nosql graphic database that stores structured data on the network rather than on tables. Neo4j can also be seen as a high-performance graph engine with all the features of mature databases. Programmers work in an object-oriented, flexible network structure instead of a strict, static table-but they can enjoy all the benefits of having full transaction characteristics and enterprise-level databases.

Due to its embedded, high-performance, lightweight, and other advantages, neo4j has received more and more attention.

Graph Data Structure

A graph contains two basic data types: nodes and relationships ). Nodes and relationships contain attributes in the key/value format. Nodes are connected through the relationship defined by relationships to form a relational network structure.

Install neo4j

Neo4j can be installed into an independently running server program, which is accessed through the rest API. It can also be installed in an embedded system, that is, a third-party class library installed in the programming language. Currently, only Java and Python languages are supported.

Because neo4j is developed in Java, ensure that JRE or JDK is installed on the machine to be installed.

Install as a service

This installation method is simple, and the installation process for each platform is basically the same

  1. Download the latest platform from http://neo4j.org/downloadand select the appropriate platform.
  2. Decompress the installation package, decompress the package, and run the terminal. Enter the bin folder in the decompressed folder.
  3. Run commands on the terminal to complete installation

    Linux/MACOs Systemneo4j install
    WindowsNeo4j.bat install

  4. Run commands on the terminal to enable the Service

    Linux/MACOs Systemservice neo4j-service start
    WindowsNeo4j.bat start

PassstopCommand to close the service,statusCommand to view the running status

Support for python embedded Installation

Step 1: Install jpype

Download the latest version from the http://sourceforge.net/projects/jpype/files/JPype/, Windows EXE format direct installation program, Linux platform to download the source package, unzip and runsudo python setup.py installComplete installation

Step 2: Install neo4j-embedded

If Python package management tool Pip or easy_install is installed, run

Pip install neo4j-embedded  easy_install neo4j-embedded

You can also download the corresponding installation package from http://pypi.python.org/pypi/neo4j-embedded/to complete the installation.

Neo4j instance

There is a relational network formed by the following user relationship:

Now, we use the graphic database to store data, get fans of user1, and recommend friends for user4.

Sample Code:

?
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.