• 検索結果がありません。

Neo4reSt en Recent site activity smalltalkusers.jp Neo4reSt en

N/A
N/A
Protected

Academic year: 2018

シェア "Neo4reSt en Recent site activity smalltalkusers.jp Neo4reSt en"

Copied!
15
0
0

読み込み中.... (全文を見る)

全文

(1)

2011 SoftUmeYa, LLC. Masashi Umezawa

(2)

What is Graph DB!?

RDB

 O/R mapping is boring in 21st century

NOSQL

 Key Value Store is good, but we wants to treat a

little more complicated structures

○ Document Database

 CouchDB, MongoDB ○ Graph Database

 Neo4j, OrientDB

(3)

With Neo4j

Most popular open source graph DB

http://neo4j.org/

GPL 3. Commercial license is also available.

The implementation language is Java

JVM language bindings - Python, Ruby, Scala,

Groovy, Clojure, etc.

REST API

(4)

Property graph of Neo4j

Node (id = 0)

properties = {

key1 = value key2 = value2 }

Node (id = 1)

properties = {

key1 = value key2 = value2 }

Relationship (id = 2)

type = 'hasA' direction = out

properties = {

key1 = value key2 = value2 }

(5)

Neo4reSt

Neo4j REST Client written in Squeak

 Basic functions are almost covered

○ Node, Relationship, and Property

○ Indexing, Traverse, and Query (still on the way)

High portability

○ WebClient base

 The Pharo version will be based on Zinc

(6)

Structure of Neo4reSt

Raw HTTP Client

 A simple REST client

○ Directly handles HTTP Responses

Standard HTTP Client

 Wrapper of Raw Client

○ Results will be represented as JSON or other Smalltalk objects.

Object Model

 Wrapper of Standard Client

(7)

Making a simple graph

I'll try to make a simple graph

a Node

name = "ume"

a Node

name = "Smalltalk"

a Relationship: uses

(8)

db := N4GraphDb new.

"Creating nodes"

node1 := db createNode: {#name-> 'ume'}.

node2 := db createNode: {#name-> 'Smalltalk'}.

"Creating relationships"

relation1 := node1 relateTo: node2 type: #uses

properties: {#years->18}.

"Add a relationship from the initial node"

db initialNode relateTo: node1 type: #people.

Making a simple graph(2)

(9)

Get information from the graph

db := N4GraphDb new.

"Get the relationship from the initial node with 'people' type"

toAPerson := (db initialNode outgoing: #people) first.

"Walking to the next relationship"

useRel := (toAPerson endNode outgoing: #uses) first.

"Getting a relationship property "

useRel at: #years. "->18"

"Getting a node property"

useRel endNode at: #name. "->Smalltalk"

(10)

Using index

Add indexes to Nodes or Relationships

node1 := (db initialNode outgoing: #peole) first endNode.

"Getting indexes abount 'people'"

indexes := db indexer nodeIndexesNamed: 'people'.

"Add a index to the node"

indexes addKey: 'name' value: 'ume' for: node1.

"Get the node from the index"

indexes detectWithKey: 'name' value: 'ume'

(11)

Example Applications

Source code repository

 A package includes class definitions, method

definitions, and loose method definitions

○ Hierarchy structure

 There are more relations from authors, versions, etc.

Backend of Wiki

 Wiki -> Books, Book -> Pages, Pages <-> Pages

 We can simply map the structure of Swiki, Pier, and

(12)

Package dumper demo

I'll try to store the snapshot of the Monticello

package (Neo4reSt itself).

workingCopy := MCWorkingCopy allManagers

detect: [:each | each package name =

'Neo4reSt'

].

snapshot := workingCopy package snapshot.

N4ObjectDumper dump: snapshot

.

Demo

(13)

Search by Cypher

Neo4j standard Graph query language

db := N4GraphDb new.

"Collect method sources which method category is 'actions'"

db

queryByCypher:

'

start

a=node(3)

match

a-->b

where

b._className="MCMethodDefinition"

and b.category="actions"

return

b.source

'.

(14)

Some links

Neo4j

http://neo4j.org/

Neo4j.rb

http://neo4j.rubyforge.org/

Neo4reSt

 http://squeaksource.blueplane.jp/Neo4reSt.html

(15)

Summary

Neo4reSt is a REST client of Neo4j

Among the net4j REST clients, Neo4reSt is not

so bad.

Basic functions are already covered.

I'll strengthen Traversal, Index, and Query

support.

参照

関連したドキュメント

En este artículo se propuso una metodología para la estimación de información faltante en diseños de medidas repetidas con respuesta binaria basada en máxi- ma verosimilitud, desde

Likewise we show that any decomposition of the complete graph into strongly regular graphs of (negative) Latin square type is an amorphic association scheme.. We study strongly

Ulrich : Cycloaddition Reactions of Heterocumulenes 1967 Academic Press, New York, 84 J.L.. Prossel,

The main problem upon which most of the geometric topology is based is that of classifying and comparing the various supplementary structures that can be imposed on a

modular proof of soundness using U-simulations.. &amp; RIMS, Kyoto U.). Equivalence

From the adaptive harmonic detection output i h and the APF current i L obtained from measuring module, we can get the input signal of adaptive sliding mode controller which is also

We see that simple ordered graphs without isolated vertices, with the ordered subgraph relation and with size being measured by the number of edges, form a binary class of

In the existing works on the combination of rough sets and matroids, Zhu and Wang 32 constructed a matroid by defining the concepts of upper approximation number in rough sets..