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


Java DatasetImpl类代码示例

本文整理汇总了Java中com.hp.hpl.jena.sparql.core.DatasetImpl的典型用法代码示例。如果您正苦于以下问题:Java DatasetImpl类的具体用法?Java DatasetImpl怎么用?Java DatasetImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DatasetImpl类属于com.hp.hpl.jena.sparql.core包,在下文中一共展示了DatasetImpl类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: QualityMetadataTest

import com.hp.hpl.jena.sparql.core.DatasetImpl; //导入依赖的package包/类
public QualityMetadataTest(boolean QualityMetadataExists) throws Exception{
	this.parameter = QualityMetadataExists;
	_dataset = new DatasetImpl(m);
	if (QualityMetadataExists){
		String filename = this.getClass().getClassLoader().getResource("qualityMetadataTest.nquad").toExternalForm();
		_dataset = RDFDataMgr.loadDataset(filename,Lang.NQUADS);
	} 
}
 
开发者ID:EIS-Bonn,项目名称:Luzzu,代码行数:9,代码来源:QualityMetadataTest.java

示例2: getNumberOfMetricsInDataSet

import com.hp.hpl.jena.sparql.core.DatasetImpl; //导入依赖的package包/类
@Deprecated
private static int getNumberOfMetricsInDataSet(Model m, String extraSPARQLstmt){
	Integer total = 0;
	
	Model internal = InternalModelConf.getFlatModel();
	Dataset _temp = new DatasetImpl(internal);
	String _tempGraph = Commons.generateURI().toString();
	_temp.addNamedModel(_tempGraph, m);
	
	String whereDefaultGraphClause = "?metricTypeURI " + SPARQLHelper.toSPARQL(RDFS.subClassOf) + " " + SPARQLHelper.toSPARQL(DAQ.Metric) + " .";
	whereDefaultGraphClause = whereDefaultGraphClause + extraSPARQLstmt;
	String graphClause = "GRAPH <"+_tempGraph+"> { [where] }";
	String whereNamedGraphClause = "?typeURI " + SPARQLHelper.toSPARQL(RDF.type) + " ?metricTypeURI . ";
	graphClause = graphClause.replace("[where]", whereNamedGraphClause);
	
	String whereClause = whereDefaultGraphClause + graphClause;
	String query = SPARQLHelper.SELECT_STATEMENT.replace("[variables]", "(count(?typeURI) as ?count)").replace("[whereClauses]", whereClause);

	Query qry = QueryFactory.create(query);
    QueryExecution qe = QueryExecutionFactory.create(qry, _temp);
    ResultSet rs = qe.execSelect();
    
    while (rs.hasNext()){
    	QuerySolution soln = rs.next();
    	total = new Integer(soln.getResource("count").toString());
    }
	
	return total.intValue();
}
 
开发者ID:EIS-Bonn,项目名称:Luzzu,代码行数:30,代码来源:DAQHelper.java

示例3: create

import com.hp.hpl.jena.sparql.core.DatasetImpl; //导入依赖的package包/类
/**
* <p>Method that creates a query execution given the query and the model to query against</p>
* @param query - the input query
* @param model - the model to be queried
* @return a query execution object
* 
   * @see com.hp.hpl.jena.query.QueryExecutionFactory#create(Query, Model)
   */
  public static QueryExecution create( Query query, Model model )
  {
      checkArg( query ) ;
      checkArg( model ) ;
      return make( query, new DatasetImpl( model ) ) ;
  }
 
开发者ID:vaibhavkhadilkar,项目名称:D2RQ-Update,代码行数:15,代码来源:D2RQRWQueryExecutionFactory.java


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