本文整理汇总了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;
}