简体   繁体   English

Jena3 Java上传模型到Virtuoso

[英]Jena3 Java Upload model to Virtuoso

I am making a Java service based on Jena3, in order to store a new Model into Virtuoso. 我正在基于Jena3创建Java服务,以便将新模型存储到Virtuoso中。 I am using Java3 Jena 3, with the following Maven dependency: 我正在使用具有以下Maven依赖关系的 Java3 Jena 3:

<!-- https://jena.apache.org/download/maven.html -->
<dependency>
    <groupId>org.apache.jena</groupId>
    <artifactId>apache-jena-libs</artifactId>
    <type>pom</type>
    <version>3.1.0</version>
</dependency>

I am trying to make store the following model (just an example), using the following code: 我试图使用以下代码存储以下模型(仅作为示例):

import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.ModelFactory;

VirtModel virtualModel = VirtModel.openDatabaseModel(VIRTUOSO_GRAPH, VIRTUOSO_URL, VIRTUOSO_USERNAME, VIRTUOSO_PASSWORD);
Model model = ModelFactory.createDefaultModel();
model.createResource("http://example.com/my#resource");
//Add model
virtualModel.add(model);

However, it seems class VirtModel is not recognized. 但是,似乎无法识别类VirtModel I cannot import virtuoso.jena.driver.*; 我无法import virtuoso.jena.driver.*; .

I tried to put different maven dependencies for Virtuoso JDBC (found on different githubs with examples) but it is not working. 我试图为Virtuoso JDBC放置不同的Maven依赖关系(在带有示例的不同github上找到),但是它不起作用。

I think this have to be retrieved from https://github.com/openlink/virtuoso-opensource but I do not know how can I do this. 我认为必须从https://github.com/openlink/virtuoso-opensource检索,但是我不知道该怎么做。

Anyone experiencing the same issue? 有人遇到同样的问题吗? Thanks in advance. 提前致谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM