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


Java StmtIterator.close方法代码示例

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


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

示例1: getPropertyValues

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
<T> List<T> getPropertyValues(final Resource resource, final String property, final Function<Statement,Optional<T>> filter) {
	Preconditions.checkState(this.model!=null);
	final StmtIterator stmts = resource.listProperties(this.model.createProperty(property));
	try {
		final List<T> values=Lists.newArrayList();
		while(stmts.hasNext()) {
			final Statement st=stmts.nextStatement();
			final Optional<T> result = filter.apply(st);
			if(result.isPresent()) {
				values.add(result.get());
			}
		}
		return values;
	} finally {
		stmts.close();
	}
}
 
开发者ID:SmartDeveloperHub,项目名称:sdh-vocabulary,代码行数:18,代码来源:ModuleHelper.java

示例2: execute

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
@Override
public Void execute() throws RuntimeException {
	final StmtIterator iterator=
		this.model.
			listStatements(
				null,
				this.model.createProperty("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
				this.model.createProperty(this.propertyName));
	try {
		while(iterator.hasNext()) {
			handler(iterator.next());
		}
		return null;
	} finally {
		iterator.close();
	}
}
 
开发者ID:SmartDeveloperHub,项目名称:sdh-vocabulary,代码行数:18,代码来源:LexvoDataSource.java

示例3: printIndividual

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
protected static String printIndividual(Individual individual) {
  StringBuilder stringBuilder = new StringBuilder();
  stringBuilder.append("Individual: " + individual.getLocalName() + "\n");
  StmtIterator properties = individual.listProperties();
  while (properties.hasNext()) {
    Statement s = properties.next();
    stringBuilder.append("  " + s.getPredicate().getLocalName() + " : " + s.getObject().toString() + "\n");
  }
  properties.close();
  stringBuilder.append("\n");
  stringBuilder.append(StringUtils.repeat("-", 70));
  return stringBuilder.toString();
}
 
开发者ID:mehmandarov,项目名称:zebra-puzzle-workshop,代码行数:14,代码来源:Exercise.java

示例4: buildMappings

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
private void buildMappings(Model model) throws MalformedURLException {
  mappings = new HashMap();
  Property mapsTo = model.createProperty(RTM_MAPSTO);
  StmtIterator it = model.listStatements(null, mapsTo, (RDFNode) null);
  while (it.hasNext()) {
    Statement stmt = (Statement) it.next();
    StatementHandler mapper = getMapper(stmt.getSubject(), stmt.getObject(), model);
    mappings.put(stmt.getSubject().getURI(), mapper);
  }
  it.close();
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:12,代码来源:RDFToTopicMapConverter.java

示例5: fillCounts

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
protected void fillCounts(StmtIterator iter, Map<Property,Integer> counts)
{
    while ( iter.hasNext() )
    {
        Property p = iter.next().getPredicate();
        Integer  i = counts.get(p);
        counts.put(p, i == null ? 1 : i + 1);
    }
    iter.close();
}
 
开发者ID:hugomanguinhas,项目名称:europeana,代码行数:11,代码来源:PropDistributionStat.java

示例6: fillType

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
private void fillType(Resource obj)
{
    Property type = obj.getModel().getProperty("rdf", "type");
    StmtIterator iter = obj.listProperties(type);
    try {
        while ( iter.hasNext() )
        {
            _typeStat.newType(iter.next().getSubject());
        }
    }
    finally {
        iter.close();
    }
}
 
开发者ID:hugomanguinhas,项目名称:europeana,代码行数:15,代码来源:ObjectStat.java

示例7: printRows

import com.hp.hpl.jena.rdf.model.StmtIterator; //导入方法依赖的package包/类
static void printRows(StmtIterator rows) throws Exception {
	while (rows.hasNext()) {
		System.out.println(rows.next());
	}
	rows.close();
}
 
开发者ID:raymondino,项目名称:SequentialStreamReasoningArchitecture,代码行数:7,代码来源:AGCache.java


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