设为首页 加入收藏

TOP

tinkerpop(2)使用java调用tinkerpop,存储到derby数据库(一)
2015-07-24 10:33:19 来源: 作者: 【 】 浏览:6
Tags:tinkerpop 使用 java 调用 存储 derby 数据库

1,关于tinkerpop

之前体验了下tinkerpop的console服务。
存储数据,然后进行查询数据。
之前写的文章:
http://www.2cto.com/database/201506/406914.html

2,关于blueprints

这里写图片描述
Blueprints是一组针对属性图数据模型的接口、实现、测试套件,有些类似于JDBC,不同之处在于Blueprints是针对图形数据库的。Blueprints提供了一组通用的接口,允许开发者在他们的图形数据库后端即插即用。
这里写图片描述
这个图表示了blueprints的位置,在最底层,决定数据存储。

其中blueprints支持的存储:
TinkerGraph (TinkerGraph)
Neo4j Implementation (Neo4jGraph)
Neo4jHA Implementation (Neo4jHaGraph)
Neo4jBatch Implementation (Neo4jBatchGraph)
Sail Implementation (SailGraph)
Sparksee Implementation (SparkseeGraph)
Rexster Implementation (RexsterGraph)
Accumulo Implementation (AccumuloGraph – 3rd party – implements Blueprints 2.4.0)
ArangoDB Implementation (ArangoDBGraph – 3rd party – implements Blueprints 2.3.0)
Bitsy (BitsyGraph – 3rd party – implements Blueprints 2.4.0)
Bigdata (BigdataGraph – 3rd party – implements Blueprints 2.5.0)
FluxGraph - Datomic Implementation (FluxGraph – 3rd party – implements Blueprints 2.1.0)
FoundationDB Implementation (FoundationDBGraph – 3rd party – implements Blueprints 2.4.0)
InfiniteGraph Implementation (IGGraph – 3rd party – implements Blueprints 2.1.0)
JPA Implementation (JpaGraph – 3rd party – implements Blueprints 2.5.0)
MongoDB Implementation (MongoDBGraph – 3rd party – implements Blueprints 2.3.0)
Oracle NoSQL Implementation (KVGraph – 3rd party – implements Blueprints 2.1.0)
OrientDB Implementation (OrientGraph – 3rd party – implements Blueprints 2.4.0)
SQL/JDBC Implementation – 3rd party – implements Blueprints 2.4.0)
Titan Implementation (TitanGraph – 3rd party – implements Blueprints 2.3.0)

3,配置依赖包

maven依赖:


    
    
     4.0.0
     
    
     tinkerpop-demo
     
    
     tinkerpop-demo
     
    
     1.0
     
    
      
      
       wingnest-repo
       
      
       wingnest repo
       
      
       http://www.wingnest.com/mvn-repo/
       
      
     
     
      
      
       org.apache.tinkerpop
       
      
       gremlin-core
       
      
       3.0.0.M9-incubating
       
      
      
      
       org.apache.tinkerpop
       
      
       gremlin-driver
       
      
       3.0.0.M9-incubating
       
      
      
      
       com.tinkerpop.blueprints
       
      
       blueprints-core
       
      
       2.6.0
       
      
      
      
       com.wingnest.blueprints
       
      
       blueprints-jpa-graph
       
      
       2.5.0_01
      
      
      
      
       org.slf4j
       
      
       slf4j-log4j12
       
      
       1.7.5
       
      
       test
       
     
      
      
       org.slf4j
       
      
       slf4j-simple
       
      
       1.6.1
       
      
       test
       
     
      
      
       org.apache.derby
       
      
       derby
       
      
       10.11.1.1
       
      
       test
       
      
      
      
       org.apache.derby
       
      
       derbytools
       
      
       10.11.1.1
       
      
       test
       
     
      
      
       junit
       
      
       junit
       
      
       4.12
       
     
      
      
       org.hibernate
       
      
       hibernate-core
       
      
       4.3.10.Final
       
      
      
      
       org.hibernate
       
      
       hibernate-entitymanager
       
      
       4.3.10.Final
       
      
      
      
       org.apache.derby
       
      
       derby
       
      
       10.11.1.1
      
     
     
     
     
      src/main/java
     
      
       
       
        src/main/resources
        
       
        true
        
      
     
     
      
        
        
         org.apache.maven.plugins
         
        
         maven-compiler-plugin
         
        
         2.5.1
         
         
         1.7 
         
          1.7
          
         
          UTF-8
          
        
        
         
       
       
       
        
        
        
         org.apache.maven.plugins
         
        
         maven-resources-plugin
         
        
         2.4
        
       
      
     
    
    
    
     
   

测试代码:

package com.tinkerpop.demo; import com.tinkerpop.blueprints.Direction; import com.tinkerpop.blueprints.Edge; import com.tinkerpop.blueprints.Graph; import com.tinkerpop.blueprints.Vertex; import com.tinkerpop.blueprints.impls.tg.TinkerGraph; import com.wingnest.blueprints.impls.jpa.JpaGraph; import org.junit.After; import org.junit.Before; import org.junit.Test; import java.io.File; import java.util.HashMap; import java.util.Map; /** * */ public class TinkerPopDemo { private JpaGraph jpaGraph = null; @Before public void setUp() { //初始化jpa。保存到数据库中。使用hibernate 自动创建表结构。 //如果要使用mysql,这里修改属性。 Map
    
      props = new HashMap
     
      (); props.put("javax.persistence.jdbc.url", String.format("jdbc:derb
首页 上一页 1 2 3 4 5 下一页 尾页 1/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle创建split和splitstr函数 下一篇Oracledbms_random函数用法快速生..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·求navicat for mysql (2025-12-26 13:21:33)
·有哪位大哥推荐一下m (2025-12-26 13:21:30)
·MySQL下载与安装教程 (2025-12-26 13:21:26)
·Linux_百度百科 (2025-12-26 12:51:52)
·Shell 流程控制 | 菜 (2025-12-26 12:51:49)