本文整理匯總了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);
}
}
示例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();
}
示例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 ) ) ;
}