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


Java Graph.getStatements方法代码示例

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


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

示例1: test

import org.openrdf.model.Graph; //导入方法依赖的package包/类
public void test() throws Exception {
		InputStreamReader reader = new InputStreamReader(ClassLoader
                .getSystemResourceAsStream("test/rdfs/reasoner/io/test.rdfs"));
		Map<String, Graph> result = parser.parse(reader, "");
		Entry<String, Graph> entry = result.entrySet().iterator().next();
		Graph graph = entry.getValue();
		StatementIterator it = graph.getStatements();
		int size = 0;
		while (it.hasNext()) {
			Statement s = (Statement) it.next();
			s.toString();
//			System.out.println(s.toString());
			size++;
		}
		assertEquals(size, 21);
	}
 
开发者ID:natsteinmetz,项目名称:ROSE,代码行数:17,代码来源:RDFSParserTest.java

示例2: convertOntology

import org.openrdf.model.Graph; //导入方法依赖的package包/类
protected Set<Rule> convertOntology(Graph ontology, String defaultNS) 
		throws NonStandardRDFSUseException {
	Set<Rule> rules = new HashSet<Rule>();
	ruleSet = new HashSet<Rule>();
	RDFS2DatalogTransformer rdfs2datalog = new RDFS2DatalogTransformer(defaultNS);
       StatementIterator it = ontology.getStatements();
       while (it.hasNext()) {
       	Statement statement = it.next();
       	Rule rule = rdfs2datalog.transform(statement);
       	rules.add(rule);
       	ruleSet.add(rule);
       }
	return rules;
}
 
开发者ID:natsteinmetz,项目名称:ROSE,代码行数:15,代码来源:ReasonerImpl.java

示例3: checkForNonStandardRDFSUse

import org.openrdf.model.Graph; //导入方法依赖的package包/类
/**
 * Checks for a non-standard use of the RDFS vocabulary in the given RDF 
 * graph. Non-standard use of the RDFS vocabulary corresponds to using the 
 * vocabulary in locations where it has not been intended 
 * (e.g. 	&lt;type, subPropertyOf, a&gt;, an occurrence of 
 * <tt>Class<tt> in an RDFS graph, ...).
 * 
 * @param graph - the RDF graph to check for non-standard use of RDFS vocabulary
 * @return true if the graph includes non-standard use of the RDFS 
 * 		   vocabulary and false otherwise
 */
private boolean checkForNonStandardRDFSUse(Graph graph) {
	StatementIterator it = graph.getStatements();
	while (it.hasNext()) {
		checkForNonStandardRDFSUse(it.next());
	}
	if (usages.size() > 0) {
		return true;
	}
	else {
		return false;
	}
}
 
开发者ID:natsteinmetz,项目名称:ROSE,代码行数:24,代码来源:ERDFSReasonerImpl.java


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