在Jena SDB中添加规则

时间:2014-01-29 10:36:01

标签: java apache sparql jena

我已经设计了一个块来在我的Java类中对Jena SDB进行查询,但我不知道如何添加我的规则,它位于My类的文件中。我添加了代码。

String jdbcURL = "jdbc:mysql://localhost:3306/ontology";
    System.out.println("##### GETUSERSTYPE #####");
     JDBC.loadDriverMySQL();
    // Setup - make the JDBC connection and read the store description once.
    Connection jdbc = makeConnection(jdbcURL) ;

    // Make a store description without any connection information.
    StoreDesc storeDesc = new StoreDesc(LayoutType.LayoutTripleNodesHash,DatabaseType.MySQL) ;

    SDBConnection conn = new SDBConnection(jdbc) ;

    Store store = StoreFactory.create(storeDesc, conn) ;

    Dataset ds = DatasetStore.create(store) ;

    QueryExecution qe = QueryExecutionFactory.create(query, ds) ;

0 个答案:

没有答案