简体   繁体   中英

Jena3 Java Upload model to Virtuoso

I am making a Java service based on Jena3, in order to store a new Model into Virtuoso. I am using Java3 Jena 3, with the following Maven dependency:

<!-- 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. I cannot 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.

I think this have to be retrieved from https://github.com/openlink/virtuoso-opensource but I do not know how can I do this.

Anyone experiencing the same issue? Thanks in advance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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