Neo4J Introduction and Installation

1 Introduction

" Neo4j is a high-performance, non-relational, fully transactional, robust graph database." neo4j has good performance when dealing with complex network data [1], suitable for social networks, dynamic network and other scenarios. It is implemented based on the java language and has two distribution versions. The community version (community version) is open sourced on Github under the license of GPLv3. The source code address is: https://github.com/neo4j/community ; Licensed, it adds features including High Availability, 24/7 support to the Community Edition. The development of Neo4j is very active, and there are many projects around it, including REST API binding ( list of implementations in various languages ), spatial database support ( source address ), etc.

Neo4J Graph Database Practice Series

Graph Database Practice Series (1)--Introduction and Installation of Neo4Jhttp: //www.linuxidc.com/Linux/2013-08/88766.htm

Graph Database Practice Series (2)--Neo4J Spatial Data Storagehttp: //www.linuxidc.com/Linux/2013-08/88767.htm

Graph Database Practice Series (3)--REST Integration of Neo4j Spatialhttp: //www.linuxidc.com/Linux/2013-08/88768.htm

Due to frequent upgrades of neo4j versions, in order to obtain new software features in a timely manner, we use Git to manage and update the code. Git is a distributed version control system and source code management system based on C language. Unlike svn, it does not have the concept of a central server, but each local version will contain the complete history of the source code [2, 3] . Git files are mainly in three states: staged, modified, committed. Its operations mainly include: pull, fetch, push, commit, etc. Such a mechanism results in Git states and operations as shown in Figure 1:

Figure 1 Simple structure diagram of Git data flow

For more tutorials on Git, see References [3,4] .

Maven is atool for building, dependency management, and project information management by the Apache Software Foundation open source java project [6]. Based on the concept of the Project Object Model (POM), Maven can manage the construction, reporting and documentation of projects based on central information. It automates the build process, from cleaning, compiling, testing, to generating reports, to packaging and deployment. Maven abstracts the complete construction life cycle model of the project, at the same time standardizes the construction process, promotes the standardization of the project team, and also provides a consistent operation interface [7]. The core of the Maven project is POM.xml, which defines the basic information of the project, which is used to describe how the project is built, declare project dependencies, etc. A sample POM code looks like this:

 
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>

  <groupId>edu.sirc.weibo</groupId>
  <artifactId>fansmap</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>fansmap</name>
  <url>http://maven.apache.org</url>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
  </dependencies>
</project>
 

The most important part of the POM of this project is the first segment groupId, artifactId, version three elements, which define the basic coordinates of a project. groupId defines the belonging organization of the project, artifactId defines the unique ID of the current project in the attribution, and vesrion is the version number of the project. Maven's main commands include mvn clean complie test package install and so on. For more information on Maven, please refer to Reference [7].

2. Installation

2.1 Git installation

Git is very easy to install and is packaged in the source for most Linux distributions. Take Ubuntu as an example (only test Oneiric, Precise), just enter the following command to install.

 
sudo  apt-get install git
 

Window and MacOS versions can be downloaded on github and installed following the guide above.

2.2 Maven installation

Under the same Ubuntu (my favorite system), installing Maven3 is very simple, enter the following command:

 
sudo apt-get maven
 

2.3 Neo4j installation

After installing the above two, we directly install neo4j from the source code of github and use maven to install neo4j. The command is as follows:

 
mkdir neo4j
CD. / neo4j
git clone https://github.com/neo4j/community.git
mvn clean install
 

In this way, neo4j is installed successfully. If you need to build a different version, you can follow the instructions in the reference 5Readme to achieve.

The next lecture will describe the use of EGit to check out neo4j code, as well as m2eclipse management, packaging neo4j, spatial projects, and storage of spatial data.

Detailed introduction of Neo4j : please click here
Neo4j download address : please click here

references

[1]What is Neo4j? http://neo4j.org/learn/

[2]Git (software) http://en.wikipedia.org/wiki/Git_(software)

[3]Git Tutorial http://www.vogella.com/articles/Git/article.html

[4] Introduction and practice of git http://www.cnblogs.com/shenhaocn/archive/2011/03/13/1982957.html

[5]Neo4j Graph Database - Community Edition https://github.com/neo4j/community

[6]Apache Maven http://en.wikipedia.org/wiki/Apache_Maven

[7] Maven combat Xu Xiaobin Machinery Industry Press 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326403307&siteId=291194637