本文整理汇总了Java中org.openrdf.query.TupleQueryResultHandler类的典型用法代码示例。如果您正苦于以下问题:Java TupleQueryResultHandler类的具体用法?Java TupleQueryResultHandler怎么用?Java TupleQueryResultHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TupleQueryResultHandler类属于org.openrdf.query包,在下文中一共展示了TupleQueryResultHandler类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: evaluate
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
private void evaluate(QueryType type, ParsedQuery query,
TupleQueryResultHandler handler) {
if (type.equals(QueryType.SENSOR_OBSERVATION)) {
evaluate(query, QueryFactory.createSensorObservationQuery(query),
handler);
return;
}
if (type.equals(QueryType.DATASET_OBSERVATION)) {
evaluate(query, QueryFactory.createDatasetObservationQuery(query),
handler);
return;
}
if (log.isLoggable(Level.SEVERE))
log.severe("Failed to deterine observation query type, sensor or dataset [query = "
+ query + "]");
}
开发者ID:markusstocker,项目名称:emrooz,代码行数:18,代码来源:Emrooz.java
示例2: main
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
/**
* @param args
* @throws Exception
*/
public static void main(String[] args) throws Exception {
UnmanagedRepositoryFactory factory = new UnmanagedRepositoryFactory();
Repository rep = factory.createRepository(new File(args.length > 1 ? args[1] : "owlim.ttl"));
rep.initialize();
try {
RepositoryConnection conn = rep.getConnection();
String queryString = FileUtils.readFileToString(new File(args[0]).getAbsoluteFile());
Constructor<TupleQueryResultHandler> wrapperFactory = null;
QueryResultListener.Feed dataFeed = new RepositoryFeed(conn, wrapperFactory, queryString);
new TempAliasCache(dataFeed);
}
finally {
rep.shutDown();
}
}
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:20,代码来源:PopulateDictionary.java
示例3: testNamespaceUsage
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
public void testNamespaceUsage() throws Exception {
RepositoryConnection conn = repository.getConnection();
conn.setNamespace("lit", litdupsNS);
URI loadPerc = vf.createURI(litdupsNS, "loadPerc");
final URI uri1 = vf.createURI(litdupsNS, "uri1");
conn.add(cpu, loadPerc, uri1);
conn.commit();
String query = "PREFIX lit: <" + litdupsNS + ">\n" +
"select * where {lit:cpu lit:loadPerc ?o.}";
TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, query);
tupleQuery.evaluate(new TupleQueryResultHandler() {
@Override
public void startQueryResult(List<String> strings) throws TupleQueryResultHandlerException {
}
@Override
public void endQueryResult() throws TupleQueryResultHandlerException {
}
@Override
public void handleSolution(BindingSet bindingSet) throws TupleQueryResultHandlerException {
assertTrue(uri1.toString().equals(bindingSet.getBinding("o").getValue().stringValue()));
}
@Override
public void handleBoolean(boolean paramBoolean) throws QueryResultHandlerException {
}
@Override
public void handleLinks(List<String> paramList) throws QueryResultHandlerException {
}
});
conn.close();
}
开发者ID:apache,项目名称:incubator-rya,代码行数:38,代码来源:RdfCloudTripleStoreConnectionTest.java
示例4: setUp
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
@Override
public void setUp() throws Exception {
super.setUp();
dao = new AccumuloRyaDAO();
connector = new MockInstance().getConnector("", new PasswordToken(""));
dao.setConnector(connector);
conf = new AccumuloRdfConfiguration();
conf.setInfer(true);
dao.setConf(conf);
dao.init();
store = new RdfCloudTripleStore();
store.setConf(conf);
store.setRyaDAO(dao);
inferenceEngine = new InferenceEngine();
inferenceEngine.setRyaDAO(dao);
store.setInferenceEngine(inferenceEngine);
inferenceEngine.refreshGraph();
store.initialize();
repository = new SailRepository(store);
conn = repository.getConnection();
solutions = new LinkedList<>();
resultHandler = new TupleQueryResultHandler() {
@Override
public void endQueryResult() throws TupleQueryResultHandlerException { }
@Override
public void handleBoolean(final boolean value) throws QueryResultHandlerException { }
@Override
public void handleLinks(final List<String> linkUrls) throws QueryResultHandlerException { }
@Override
public void handleSolution(final BindingSet bindingSet) throws TupleQueryResultHandlerException {
if (bindingSet != null && bindingSet.iterator().hasNext()) {
solutions.add(bindingSet);
}
}
@Override
public void startQueryResult(final List<String> bindingNames) throws TupleQueryResultHandlerException {
solutions.clear();
}
};
}
开发者ID:apache,项目名称:incubator-rya,代码行数:41,代码来源:InferenceIT.java
示例5: evaluate
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
@Override
public void evaluate(TupleQueryResultHandler handler) {
try {
getTupleQuery().evaluate(handler);
} catch (QueryEvaluationException | RepositoryException
| MalformedQueryException | TupleQueryResultHandlerException e) {
throw new RuntimeException(e);
}
}
开发者ID:markusstocker,项目名称:emrooz,代码行数:10,代码来源:SesameQueryHandler.java
示例6: CountingTupleQueryResultHandlerWrapper
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
public CountingTupleQueryResultHandlerWrapper(final TupleQueryResultHandler indir){
this.indir = indir;
}
开发者ID:apache,项目名称:incubator-rya,代码行数:4,代码来源:RdfController.java
示例7: evaluate
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
@Override
public void evaluate(TupleQueryResultHandler handler) {
throw new UnsupportedOperationException(
"Query evaluation with result handler not supported");
}
开发者ID:markusstocker,项目名称:emrooz,代码行数:6,代码来源:CassandraSensorObservationQueryHandler.java
示例8: evaluate
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
@Override
public void evaluate(TupleQueryResultHandler handler) {
throw new UnsupportedOperationException();
}
开发者ID:markusstocker,项目名称:emrooz,代码行数:5,代码来源:EmroozTest.java
示例9: setTupleQueryResultHandler
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
public void setTupleQueryResultHandler(TupleQueryResultHandler handler) {
this.handler = handler;
}
开发者ID:esarbanis,项目名称:strabon,代码行数:4,代码来源:stSPARQLQueryResultParserBase.java
示例10: evaluate
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
@Override
public void evaluate(TupleQueryResultHandler handler) throws QueryEvaluationException, TupleQueryResultHandlerException
{
throw new UnsupportedOperationException("Operation is not supported"); //$NON-NLS-1$
}
开发者ID:obidea,项目名称:semantika-endpoint,代码行数:6,代码来源:SemantikaTupleQuery.java
示例11: RepositoryFeed
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
public RepositoryFeed(RepositoryConnection conn, Constructor<TupleQueryResultHandler> wrapperFactory, String queryString) {
this.conn = conn;
this.wrapperFactory = wrapperFactory;
this.query = queryString;
}
开发者ID:Network-of-BioThings,项目名称:GettinCRAFTy,代码行数:6,代码来源:RepositoryFeed.java
示例12: setTupleQueryResultHandler
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
/**
* Sets the TupleQueryResultHandler that will handle the parsed query result data.
*/
public void setTupleQueryResultHandler(TupleQueryResultHandler handler);
开发者ID:esarbanis,项目名称:strabon,代码行数:5,代码来源:stSPARQLQueryResultParser.java
示例13: evaluate
import org.openrdf.query.TupleQueryResultHandler; //导入依赖的package包/类
public void evaluate(TupleQueryResultHandler handler);
开发者ID:markusstocker,项目名称:emrooz,代码行数:2,代码来源:QueryHandler.java
注:本文中的org.openrdf.query.TupleQueryResultHandler类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论