当前位置: 首页>>代码示例>>Java>>正文


Java QueryExecution.execDescribe方法代码示例

本文整理汇总了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();
}
 
开发者ID:iotoasis,项目名称:SDA,代码行数:13,代码来源:Utils.java

示例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();
}
 
开发者ID:iotoasis,项目名称:SDA,代码行数:10,代码来源:DeviceResource.java

示例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());
}
 
开发者ID:marklogic,项目名称:marklogic-jena,代码行数:15,代码来源:MarkLogicQueryEngineTest.java


注:本文中的org.apache.jena.query.QueryExecution.execDescribe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。