當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。