Skip to main content

Home/ Semantic-Web-Web3.0/ Group items tagged neo4j

Rss Feed Group items tagged

Erwin Karbasi

InfoQ: Graph Databases, NOSQL and Neo4j - 0 views

  •  
    "Example - the MATRIX The Graph As mentioned before, Social Networks represent just a tiny fraction of the applications of graph databases, but they are easy to understand for this example. To demonstrate the basic functionality of Neo4j, below is a small graph from the Matrix movie, visualized with the Eclipse RCP based Neoclipse for Neo4j: The graph is connected to a known reference node (id=0) for convenience in order to find the way into the network from a known starting point. This is not necessary, but has proven very usable in practice. The Java implementation looks something like this: Create a new graph database in folder "target/neo" EmbeddedGraphDatabase graphdb = new EmbeddedGraphDatabase("target/neo"); Relationship types can be created on-the-fly: RelationshipType KNOWS = DynamicRelationshipType.withName("KNOWS"); or via typesafe Java Enum: enum Relationships implements RelationshipType { KNOWS, INLOVE, HAS_CODED, MATRIX } Now, create two nodes and attach a "name" property to each of them. Then, connect these nodes witha KNOWS relationship: Node neo = graphdb.createNode(); node.setProperty("name", "Neo"); Node morpheus = graphdb.createNode(); morpheus.setProperty("name", "Morpheus"); neo.createRelationshipTo(morpheus, KNOWS); Any operation modifying the graph or needing isolation levels for data is wrapped in a transaction, so rollback and recovery work out of the box: Transaction tx = graphdb.beginTx(); try { Node neo = graphdb.createNode(); ... tx.success(); } catch (Exception e) { tx.failure(); } finally { tx.finish(); } The full code to create the Matrix graph the looks something like this: graphdb = new EmbeddedGraphDatabase("target/neo4j"); index = new LuceneIndexService(graphdb); Transaction tx = graphdb.beginTx(); try { Node root = graphdb.getReferenceNode(); // we connect Neo with the root node, to gain an entry point to the graph // not neccessary but practical. neo = createAndConnectNode("Neo", root, MATRIX); Node mo
Erwin Karbasi

Neo4j Blog: The top 10 ways to get to know Neo4j - 0 views

  • The common domain implementation pattern when using Neo4j is to let the domain objects wrap a node, and store the state of the entity in the node properties. To relieve you from the boilerplate code needed for this, you can use a framework like jo4neo (intro, blog posts), where you use annotations to declare properties and relationships, but still have the full power of the graph database available for deep traversals and other graphy stuff. Here's a code sample showing jo4neo in action:view sourceprint?public class Person {  //used by jo4neo  transient Nodeid node;  //simple property  @neo String firstName;  //helps you store a java.util.Date to neo4j  @neo Date date;  // jo4neo will index for you  @neo(index=true) String email;  // many to many relation  @neo Collection<role> roles;    /* normal class oriented  * programming stuff goes here  */}</role>
Erwin Karbasi

InfoQ: Neo4j: Java-based NoSQL Graph Database - 0 views

  • Neo4j addresses the problem of performance degradation over queries that involve many joins in a traditional RDBMS. By modeling the data around graphs, Neo4j can traverse along nodes and edges with the same speed, independently of the amount of data constituting the graph. This gives secondary effects like very fast graph algos, recommender systems and OLAP-style analytics that are currently not possible with normal RDBMS setups.
Erwin Karbasi

MySQL vs. Neo4j on a Large-Scale Graph Traversal - 0 views

  • Traversing the Graph The traversal that was evaluated on each database started from some root vertex and emanated n-steps out. There was no sorting, no distinct-ing, etc. The only two variables for the experiments are the length of the traversal and the root vertex to start the traversal from. In MySQL, the following 5 queries denote traversals of length 1 through 5. Note that the "?" is a variable parameter of the query that denotes the root vertex.     SELECT a.inV FROM graph as a WHERE a.outV=?     SELECT b.inV FROM graph as a, graph as b WHERE a.inV=b.outV AND a.outV=?     SELECT c.inV FROM graph as a, graph as b, graph as c WHERE a.inV=b.outV AND b.inV=c.outV AND a.outV=?     SELECT d.inV FROM graph as a, graph as b, graph as c, graph as d WHERE a.inV=b.outV AND b.inV=c.outV AND c.inV=d.outV AND a.outV=?     SELECT e.inV FROM graph as a, graph as b, graph as c, graph as d, graph as e WHERE a.inV=b.outV AND b.inV=c.outV AND c.inV=d.outV AND d.inV=e.outV AND a.outV=? For Neo4j, the Blueprints Pipes framework was used. A pipe of length n was constructed using the following static method.     public static Pipeline createPipeline(final Integer steps) {         final ArrayList<Pipe> pipes = new ArrayList<Pipe>();         for (int i = 0; i < steps; i++) {             Pipe pipe1 = new VertexEdgePipe(VertexEdgePipe.Step.OUT_EDGES);             Pipe pipe2 = new EdgeVertexPipe(EdgeVertexPipe.Step.IN_VERTEX);             pipes.add(pipe1);             pipes.add(pipe2);         }         return new Pipeline(pipes);     } For both MySQL and Neo4j, the results of the query (SQL and Pipes) were iterated through. Thus, all results were retrieved for each query. In MySQL, this was done as follows.     while (resultSet.next()) {         resultSet.getInt(finalColumn);     } In Neo4j, this is done as follows.     while (pipeline.hasNext()) {         pipeline.next();     }
Erwin Karbasi

Neo4j with Spring - IMDB Example - 0 views

  • These pages will guide you through an example web application using the IMDB dataset. The aim is to show an example web application with an architecture based on Spring, which is close to what a real life example could look like.
Erwin Karbasi

NOSQLEU - Graph Databases and Neo4j - 0 views

  •  
    Slide Show
Erwin Karbasi

Lars Kirchhoff [Web Journal] - - 0 views

  • For more then half a year we are running a research project about social networks within the blogosphere. The social network analysis is only one step to get information about the topic flow within a certain blog networks. We used Technorati as a source for the detection of the blog networks using a snow ball approach and than crawled the found blog nodes to identify the network edges. So far we have five sample networks analyzed ranging from 300 to 14'000 nodes with more than 200'000 edges. One task within the project is the visualization of these networks with appropriate tools that enable the easy access to the gathered information. Various levels of detail are needed to extract and highlight different network parameter and make them easily understandable. Therefore I did a research on current tools available.
Erwin Karbasi

NoSQL Graph Database Comparison | Javalobby - 0 views

  • A few days ago I published a short overview of the most trendy graph databases. Today I'm bringing you a review of the most important features of them. As you can see the current ecosystem is quite bit, without general uniformity, although this is normal when analyzing an ongoing technology movement.  As you can see in the previous table,  there are substantial differences that can help our projects. Next we are going to analyze these main differences.
1 - 13 of 13
Showing 20 items per page