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


Java GraphFactory.createDefaultGraph方法代码示例

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


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

示例1: write

import com.hp.hpl.jena.sparql.graph.GraphFactory; //导入方法依赖的package包/类
/**
 * So what we need to do is, extract the triple from the map and use
 * writeRecords to insert the triple into the graph
 * 
 */
@Override
public void write(List<? extends Map<String, Object>> items) throws Exception {
    Graph graph = GraphFactory.createDefaultGraph();
    logger.info("writing triple records");
    for (Map<String, Object> columnMap : items) {
        String idKey = columnMap.keySet().iterator().next();
        Object id = columnMap.get(idKey);
        logger.debug("KEY [" + idKey + "]");
        writeRecords((Triple)id, graph);
    }
    logger.info("Triple inserted count [" + this.getTripleCount() + "]");
}
 
开发者ID:marklogic-community,项目名称:marklogic-spring-batch,代码行数:18,代码来源:RdfTripleItemWriter.java

示例2: getWebApp

import com.hp.hpl.jena.sparql.graph.GraphFactory; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
	private synchronized WebApp getWebApp(HttpSession session, String dataflowUri, long instanceId, StringBuffer requestURL) {
    	if (webAppMap == null) {
    		webAppMap = (Map<String,Map<Long,WebApp>>) session.getAttribute(WEB_APP_MAPP_ATTR_NAME);
    		instCount = (Map<String,Long>) session.getAttribute(INST_COUNT_ATTR_NAME);
    		if (webAppMap == null) {
    			webAppMap = new HashMap<String,Map<Long,WebApp>>();
    			instCount = new HashMap<String,Long>();
    			session.setAttribute(WEB_APP_MAPP_ATTR_NAME, webAppMap);
    			session.setAttribute(INST_COUNT_ATTR_NAME, instCount);
    		}
    	}
    	Map<Long,WebApp> mapForUri = webAppMap.get(dataflowUri);
   		Long countForUri = instCount.get(dataflowUri);
    	if (mapForUri == null) {
    		mapForUri = new HashMap<Long,WebApp>();
    		countForUri = 0l;
     		webAppMap.put(dataflowUri, mapForUri);
     		instCount.put(dataflowUri, countForUri);
    	}
    	WebApp webApp = null;
//    	String newQueryString = queryString;
    	if (instanceId >= 0)
    		webApp = mapForUri.get(instanceId);
    	else {
    		instanceId = countForUri.longValue();
    		countForUri++;
//    		newQueryString += ("&inst=" + Long.toString(instanceId));
    		requestURL.append("&inst=").append(Long.toString(instanceId));
    	}
    	if (webApp == null) {
            Graph graph = GraphFactory.createDefaultGraph();
            RDFDataMgr.read(graph, dataflowUri, dataflowUri, null, null);
    		webApp = new WebApp(graph,requestURL.toString());
    		mapForUri.put(instanceId, webApp);
    	}
    	return webApp;
    }
 
开发者ID:miguel76,项目名称:swows-web,代码行数:39,代码来源:Play.java

示例3: SparqlifyDataset

import com.hp.hpl.jena.sparql.graph.GraphFactory; //导入方法依赖的package包/类
public SparqlifyDataset() {
	super(GraphFactory.createDefaultGraph());
	prefixes = new ArrayList<String>();
}
 
开发者ID:SmartDataAnalytics,项目名称:R2RLint,代码行数:5,代码来源:SparqlifyDataset.java

示例4: SerialisableModel

import com.hp.hpl.jena.sparql.graph.GraphFactory; //导入方法依赖的package包/类
public SerialisableModel(){
	super(GraphFactory.createDefaultGraph());
}
 
开发者ID:diachron,项目名称:quality,代码行数:4,代码来源:SerialisableModel.java


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