本文整理汇总了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 ) ) ;
}