本文整理汇总了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() + "]");
}
示例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;
}
示例3: SparqlifyDataset
import com.hp.hpl.jena.sparql.graph.GraphFactory; //导入方法依赖的package包/类
public SparqlifyDataset() {
super(GraphFactory.createDefaultGraph());
prefixes = new ArrayList<String>();
}
示例4: SerialisableModel
import com.hp.hpl.jena.sparql.graph.GraphFactory; //导入方法依赖的package包/类
public SerialisableModel(){
super(GraphFactory.createDefaultGraph());
}