當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。