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


Java DatasetGraph.getDefaultGraph方法代码示例

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


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

示例1: load

import com.hp.hpl.jena.sparql.core.DatasetGraph; //导入方法依赖的package包/类
@Override
public void load(
		final SolrQueryRequest request, 
		final SolrQueryResponse response,
		final ContentStream stream, 
		final UpdateRequestProcessor processor) throws Exception {
	
	final PipedRDFIterator<Triple> iterator = new PipedRDFIterator<Triple>();
	final StreamRDF inputStream = new PipedTriplesStream(iterator);
	
	executor.submit(new Runnable() {
		@Override
		public void run() {
			try {
				RDFDataMgr.parse(
						inputStream, 
						stream.getStream(), 
						RDFLanguages.contentTypeToLang(stream.getContentType()));
			} catch (final IOException exception) {
				throw new SolrException(ErrorCode.SERVER_ERROR, exception);
			}					
		}
	});
		
	// Graph Store Protocol indicates the target graph URI separately.
	// So the incoming Content-type here is one that maps "Triples Loader" but
	// the indexed tuple could be a Quad.
	final String graphUri = request.getParams().get(Names.GRAPH_URI_ATTRIBUTE_NAME);
	
	final DatasetGraph dataset = new LocalDatasetGraph(request, response, null, null);
	final Graph defaultGraph = graphUri == null 
			? dataset.getDefaultGraph() 
			: dataset.getGraph(NodeFactory.createURI(graphUri));
	while (iterator.hasNext()) {
		defaultGraph.add(iterator.next());
	}		
}
 
开发者ID:spaziocodice,项目名称:SolRDF,代码行数:38,代码来源:RdfBulkUpdateRequestHandler.java

示例2: execute

import com.hp.hpl.jena.sparql.core.DatasetGraph; //导入方法依赖的package包/类
static void execute(DatasetGraph dsg, Op op, Context context) {
    /*
    Algebra.exec(op, dsg)
    ==>
    QueryEngineFactory f = QueryEngineRegistry.findFactory(op, ds, null) ;
    Plan plan = f.create(op, ds, BindingRoot.create(), null) ;
    return plan.iterator() ;
    */
    
    context = Context.setupContext(context, dsg) ;
    OpExecutorFactory factory = QC.getFactory(context) ;
    if ( factory == null )
        factory = OpExecutor.stdFactory ;
    
    ExecutionContext execCxt = new ExecutionContext(context, dsg.getDefaultGraph(), dsg, factory) ;
    QueryIterator qIterRoot = OpExecutor.createRootQueryIterator(execCxt) ; 
    QueryIterator qIterPlan = QC.execute(op, qIterRoot, execCxt) ;
    Plan plan = new PlanOp(op, null, qIterPlan) ;
    runPlan(plan) ;
    
    /*
    Query query = null ;
    Dataset dataset = null ;
    QueryEngineFactory qefactory = null ;
    @SuppressWarnings("resource")
    QueryExecutionBase queryExecutionBase = new QueryExecutionBase(query, dataset, context, qefactory)  ;
    */
}
 
开发者ID:afs,项目名称:quack,代码行数:29,代码来源:RefactorQueryExecution.java

示例3: accept

import com.hp.hpl.jena.sparql.core.DatasetGraph; //导入方法依赖的package包/类
public boolean accept(Query query, DatasetGraph dataset, Context context) {
	return dataset.getDefaultGraph() instanceof GraphD2RQ;
}
 
开发者ID:aitoralmeida,项目名称:c4a_data_repository,代码行数:4,代码来源:QueryEngineD2RQ.java


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