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


Java LocationMapper类代码示例

本文整理汇总了Java中com.hp.hpl.jena.util.LocationMapper的典型用法代码示例。如果您正苦于以下问题:Java LocationMapper类的具体用法?Java LocationMapper怎么用?Java LocationMapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LocationMapper类属于com.hp.hpl.jena.util包,在下文中一共展示了LocationMapper类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findAllKnownImports

import com.hp.hpl.jena.util.LocationMapper; //导入依赖的package包/类
/**
 * Method to find all known imports for a project. These include
 * 	1) SADL files
 * 	2) OWL files which are not associated with a SADL file
 * 	3) Listings in the ont-policy file which are not one of the above
 * (Can't all of these just be gotten from the policy file?)
 * @param someFileInProject
 * @return
 * @throws URISyntaxException
 * @throws IOException
 */
public static List<String> findAllKnownImports(URI someFileInProject) throws IOException, URISyntaxException {
	String policyFileUrl = getValidatedPolicyFileUrlForProject(someFileInProject);
   	if (policyFileUrl != null) {
        OntDocumentManager mgr = OntDocumentManager.getInstance(); // new OntDocumentManager(policyFileUrl);
        if (!mgr.getMetadataSearchPath().contains(policyFileUrl)) {
        	mgr.setMetadataSearchPath(policyFileUrl, true);
        }
        LocationMapper mapper = mgr.getFileManager().getLocationMapper();
        Iterator<String> itr = mapper.listAltEntries();
        if (itr.hasNext()) {
        	List<String> publicUris = new ArrayList<String>();
	        while (itr.hasNext()) {
	        	String altEntry = itr.next();
	        	String mapping = mapper.altMapping(altEntry);
	        	logger.debug("Location Mapper AltEntry: " + altEntry + ", " + mapping);
	        	publicUris.add(altEntry);
	        }
	        return publicUris;
        }
	}
	return null;
}
 
开发者ID:crapo,项目名称:sadlos2,代码行数:34,代码来源:ResourceManager.java


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