Home

Awesome

InteractiveGraph-neo4j

GitHub releases GitHub downloads GitHub issues GitHub forks GitHub stars GitHub license

InteractiveGraph-neo4j serves GSON files(see https://github.com/grapheco/InteractiveGraph#GSON), Neo4j databases, RDF stores as InteractiveGraph providers, it generates InteractiveGraphs for remote frontend InteractiveGraph clients on demand. Known InteractiveGraph clients includes GraphNavigator, GraphBrowser, and RelFinder (see https://github.com/grapheco/InteractiveGraph).

The interaction architecture looks like: architecture

Quick Start

  1. download latest graphserver.war and igraph.war file from release page: https://github.com/grapheco/InteractiveGraph-neo4j/releases and https://github.com/grapheco/InteractiveGraph/releases

graphserver.war: graph server app igraph.war: interactive graph clients, including GraphNavigator, GraphBrowser, and RelFinder.

  1. move war files into your webapps folder of Web server (Tomcat, for example)

  2. start Web server, we assume the web app url is http://yourhost:8080

  3. explore InteractiveGraph/GraphBrowser in Web browser:

http://yourhost:8080/igraph/example12.html

Accessing servers in InteractiveGraph apps

  1. If you are using a remote graph app, GraphBrowser, for example. To access IGP servers, you may click the load remote IGP server tool, in the dialog input connector url like: http://yourhost:8080/graphserver/connector-gson, InteractiveGraph/GraphBrowser will load and visualize graph from graphserver.

architecture

  1. To access IGP servers programmly, you may use app.connect() method. Here is an example:
    var app = new igraph.GraphNavigator(document.getElementById('graphArea'));
    app.connect("http://yourhost:8080/graphserver/connector-neodb");

NOTE: graphserver provides 3 servlets: /connector-gson, /connector-bolt, /connector-neodb. Because the /connector-bolt depends on /connector-neodb, so note that /connector-neodb should be accessed before accessing /connector-bolt.

Configuration

InterativeGraphServer is able to connect several kinds of backend data sources: neo4j-gson, neo4j-db, neo4j-bolt.

web.xml

ConnectorServlets should be defined in web.xml. Each servlet requires a configFile parameter:

    <servlet>
        <servlet-name>connector3</servlet-name>
        <servlet-class>org.interactivegraph.server.ConnectorServlet</servlet-class>
        <init-param>
            <param-name>configFile</param-name>
            <param-value>WEB-INF/conf3.properties</param-value>
        </init-param>
    </servlet>
    <servlet-mapping>
        <servlet-name>connector3</servlet-name>
        <url-pattern>/connector-gson</url-pattern>
    </servlet-mapping>

Here, a connector1 is defined with a configuration file conf3.properties, it responds to clients when requested as http://yourhost/graphserver/connector-gson.

<a href='web/WEB-INF/web.xml'>example web.xml</a>

configuration file

Configuration files are written in properties file format, there are some common properties and other specific properties according to different backend kinds.

common properties

namedescriptiontypeexample
allowOriginallowed domains, * means allow all remote clientsstringhttp://192.168.1.1:8080
backendTypebackend source typeone of neo4j-gson, neo4j-bolt or neo4j-dbneo4j-gson
neo4j.nodeCategoriescategories of nodes in name/title pair formatperson:人物,event:事件,location:地点
visNodeProperty.labelan expression to be evaluated as caption of a visualized nodestring as a VelocityExpr, if it starts with a = then it is a Velocity expression, else it is a Velocity template, see http://velocity.apache.org/engine/devel/vtl-reference.html=$prop.name, or #if($prop.name) $prop.name #else <empty> #end
visNodeProperty.valuean expression to be evaluated as value (size) of a visualized nodestring as a VelocityExpr=$prop.value
visNodeProperty.imagean expression to be evaluated as path of image of a visualized nodestring as a VelocityExpr=$prop.image, or http://.../images/${prop.id}
visNodeProperty. infoan expression to be evaluated as HTML-formated infomation (description in detailed) of a visualized nodestring as a VelocityExpr<p align=center> #if($prop.image) <img width=150 src="${prop.image}"><br> #end <b>${prop.name}[${prop.id}]</b></p><p align=left>${node.info}</p>
neo4j.regexpSearchFieldsfields used to perform a full text searchstring array sperated by ,name,address
neo4j.strictSearchFieldsstrict match fields mappingarray of : sperated pairs, for example: label:name, this tells search information in name property when asked to search in label property,label:name

backendType=neo4j-bolt

namedescriptiontypeexample
neo4j.boltUrlurl of bolt serverstringbolt://localhost:7688
neo4j.boltUseruser acountstringadmin
neo4j.boltPassworduser passwordstringadmin

<a href='web/WEB-INF/conf1.properties'>example properties file</a>

backendType=neo4j-db

namedescriptiontypeexample
neo4j.dataDirfile path of a neo4j database, often in <neo4j-home>/data/databases/stringWEB-INF/databases/data.db
neo4j.boltPorta bolt server will be startup on the database, this parameter specify the port of bolt servernumber7689

<a href='web/WEB-INF/conf2.properties'>example properties file</a>

backendType=neo4j-gson

namedescriptiontypeexample
gson.pathrelative/abslute path of GSON filestringWEB-INF/honglou.json
gson.tempDira temporary database will be created for the GSON file, this parameter specify where we create the databasestring/dev/shm, or /tmp
neo4j.boltPorta bolt server will be startup on the temporary database, this parameter specify the port of bolt server7689

<a href='web/WEB-INF/conf3.properties'>example properties file</a>