我正在使用Jena(3.10.0版)和Fuseki(3.10.0版)来测试一些构造查询,但是在运行6个查询后挂起。下面是我的代码。我不确定这是否是耶拿(Jena)中的错误,还是我做错了什么。选择查询工作正常。如果有人可以提供帮助,我将不胜感激。
@Test
public void testRun() {
for(int i =0 ; i < 10;i++) {
System.out.println(" ..... "+ i);
String query = "CONSTRUCT {?S ?P ?O} WHERE {?S ?P ?O}";
try(RDFConnectionFuseki connectFuseki = RDFConnectionFactory.connectFuseki("http://localhost:3030/test")) {
System.out.println("Got connection!");
org.apache.jena.rdf.model.Model model = connectFuseki.queryConstruct(query);
System.out.println("Executed query!");
model.write(System.out, "TURTLE");
}
}
}
控制台输出
..... 0
Got connection!
Executed query!
..... 1
Got connection!
Executed query!
..... 2
Got connection!
Executed query!
..... 3
Got connection!
Executed query!
..... 4
Got connection!
Executed query!
..... 5
Got connection!