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


Java RDFS.getURI方法代码示例

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


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

示例1: expandSubClasses

import com.hp.hpl.jena.vocabulary.RDFS; //导入方法依赖的package包/类
private List<Statement> expandSubClasses(Model model){
	List<Statement> stmts = new ArrayList<Statement>();
	
	
	String sparql = "PREFIX rdfs: <" + RDFS.getURI() + ">"
			+ "SELECT DISTINCT ?class ?synonym "
			+ "WHERE { "
			+ "?class rdfs:subClassOf+ ?subClass . "
			+ "?subClass <" + synonym + "> ?synonym"
			+ "}";
	
	Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
	QueryExecution queryExecution = QueryExecutionFactory.create(query, model);
	ResultSet resultSet = queryExecution.execSelect();
	resultSet.forEachRemaining(querySolution -> {
		stmts.add(new StatementImpl(querySolution.getResource("class"), synonym, querySolution.getLiteral("synonym")));
	});
	return stmts;
}
 
开发者ID:teamdigitale,项目名称:ontonethub,代码行数:20,代码来源:IndexingJob.java

示例2: expandSubProperties

import com.hp.hpl.jena.vocabulary.RDFS; //导入方法依赖的package包/类
private List<Statement> expandSubProperties(Model model){
	List<Statement> stmts = new ArrayList<Statement>();
	
	String sparql = "PREFIX rdfs: <" + RDFS.getURI() + ">"
			+ "SELECT DISTINCT ?property ?synonym "
			+ "WHERE { "
			+ "?property rdfs:subPropertyOf+ ?subProperty . "
			+ "?subProperty <" + synonym + "> ?synonym"
			+ "}";
	
	Query query = QueryFactory.create(sparql, Syntax.syntaxARQ);
	QueryExecution queryExecution = QueryExecutionFactory.create(query, model);
	ResultSet resultSet = queryExecution.execSelect();
	resultSet.forEachRemaining(querySolution -> {
		stmts.add(new StatementImpl(querySolution.getResource("property"), synonym, querySolution.getLiteral("synonym")));
	});
	return stmts;
}
 
开发者ID:teamdigitale,项目名称:ontonethub,代码行数:19,代码来源:IndexingJob.java

示例3: getSubClasses

import com.hp.hpl.jena.vocabulary.RDFS; //导入方法依赖的package包/类
private List<Resource> getSubClasses(Resource r) {
	List<Resource> resources = new ArrayList<Resource>();
	String query = "\n" + "prefix rdfs: <" + RDFS.getURI() + ">\n" + "\n"
			+ "select distinct ?class where {\n"
			+ "   ?class rdfs:subClassOf/rdfs:subClassOf* <" + r.getURI()
			+ "> \n" + "}";
	ResultSet results = QueryExecutionFactory.create(query, schema)
			.execSelect();
	while (results.hasNext()) {
		resources.add(results.next().getResource("class"));
	}
	return resources;
}
 
开发者ID:BenzclyZhang,项目名称:BimSPARQL,代码行数:14,代码来源:IfcSemanticExtractor.java


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