本文整理汇总了Java中org.apache.jena.query.QueryExecution.execDescribe方法的典型用法代码示例。如果您正苦于以下问题:Java QueryExecution.execDescribe方法的具体用法?Java QueryExecution.execDescribe怎么用?Java QueryExecution.execDescribe使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.jena.query.QueryExecution
的用法示例。
在下文中一共展示了QueryExecution.execDescribe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDeviceInfo
import org.apache.jena.query.QueryExecution; //导入方法依赖的package包/类
public static String getDeviceInfo(String deviceUri) throws Exception {
String serviceURI = Utils.getSdaProperty("com.pineone.icbms.sda.knowledgebase.dw.sparql.endpoint")+"/sparql";
StringWriter out = new StringWriter();
// 요기
String query = getSparQlHeader() + "\n"+ "describe "+ deviceUri;
QueryExecution qe = QueryExecutionFactory.sparqlService(serviceURI, query);
Model model = qe.execDescribe();
qe.close();
model.write(out,"RDF/XML");
return out.toString();
}
示例2: getDeviceInfo
import org.apache.jena.query.QueryExecution; //导入方法依赖的package包/类
public String getDeviceInfo(String deviceUri) {
StringWriter out = new StringWriter();
String query = prefix + "\n"+ "describe "+ deviceUri;
QueryExecution qe = QueryExecutionFactory.sparqlService(endpoint, query);
Model model = qe.execDescribe();
qe.close();
model.write(out,"RDF/XML");
return out.toString();
}
示例3: testDescribe
import org.apache.jena.query.QueryExecution; //导入方法依赖的package包/类
@Test
public void testDescribe() {
QueryExecution queryExec = QueryExecutionFactory.create(
"DESCRIBE <http://example.org/r1>", ds);
Model solution = queryExec.execDescribe();
assertTrue("Got a solution with more than zero triples", solution
.getGraph().size() > 0);
queryExec = QueryExecutionFactory.create(
"DESCRIBE <http://example.org/g1333>", ds);
solution = queryExec.execDescribe();
assertEquals("Got a solution with zero triples", 0, solution.getGraph()
.size());
}