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


Java OWLOntology.getReferencedClasses方法代码示例

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


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

示例1: printLoadedOnt

import org.semanticweb.owl.model.OWLOntology; //导入方法依赖的package包/类
public void printLoadedOnt(URI uri) {
	System.out.println("Concepts of Ontology: "+uri);
	OWLOntology ont = getLoadedOntologie(uri);
	for(OWLClass cls : ont.getReferencedClasses()) {
		System.out.println(cls);
	}
	
	System.out.println("----");
	System.out.println("-- Axioms --");
	for (OWLAxiom a: ont.getAxioms()) {
		System.out.println(a);
	}
	
	
}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:16,代码来源:OntologyStore.java

示例2: loadRevisionMap

import org.semanticweb.owl.model.OWLOntology; //导入方法依赖的package包/类
public void loadRevisionMap() throws IOException {
	System.out.println("Loading Revision Map");
	
	revisionMap.clear();
	
	IFile revMapFile = project.getFolder(SVoNtConstants.SVONTFOLDER).getFile(SVoNtConstants.REVISIONMAPFILE);
	
	if (revMapFile.exists()) {
		OntologyStore os = OntoEclipseManager.getOntologyStore(project.getName());
		OWLOntology ont = os.getLoadedOntologie(os.getMainOntologyURI());
		
		BufferedReader br = new BufferedReader(new FileReader(revMapFile.getLocation().toFile()));
		String line;
		while((line = br.readLine()) != null) {
			String[] lineArray = line.split(SVoNtConstants.REVMAPSEPERATOR);
			for (OWLClass c : ont.getReferencedClasses()) {
				if (c.getURI().toString().equals(lineArray[0])) {
					revisionMap.put(c, Integer.valueOf(lineArray[1]));
					break;
				}
			}
		}
		
		System.out.println("Revision Map successfully loaded");
	}

	
}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:29,代码来源:SVoNtProject.java

示例3: getStartNode

import org.semanticweb.owl.model.OWLOntology; //导入方法依赖的package包/类
public static URI getStartNode() {
		
		OWLOntology ont = ontologyStore.getLoadedOntologie(ontologyInfo.getURI());
		
		URI start;
		
		List<URI> niceStartList = new ArrayList<URI>();
		// find a nice start node:
		String[] pref = preferredRootConcepts;
		
		
		//TODO bad workaround to fix NullPointerExcept
		if (pref == null) {
			pref = new String[0];
		}
		
		if (pref.length != 0) {
				
				for (int i = 0; i<pref.length;i++) {
					String prefString = pref[i];
					System.out.println("Searching for "+prefString +"concept as start Node");
					
					for (OWLClass o : ont.getReferencedClasses()) {
//						System.out.println("Fragment: "+o.getURI().getFragment());
						if (o.getURI().getFragment().toLowerCase().contains(prefString)) {
							niceStartList.add(o.getURI());
							System.out.println("Found a nice Node to Start:"+ o.getURI());
						}
					}
					
				}
				
				if (niceStartList.isEmpty()) {
					System.out.println("Nice start is empty");
					return ont.getReferencedClasses().iterator().next().getURI();
				}
				else {
					//get a random node from that list
					start = niceStartList.get(0);
					System.out.println("nice start list not empty using the first:");
					System.out.println(start);
					return start;
				}
				
		}
		else return ont.getReferencedClasses().iterator().next().getURI();
		

		
	}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:51,代码来源:GraphAnalyse.java

示例4: createConceptRevisionMap

import org.semanticweb.owl.model.OWLOntology; //导入方法依赖的package包/类
public static HashMap<OWLClass,Integer> createConceptRevisionMap(OntologyStore os,
		SVoNtProject sp) {
	
	System.out.println("Recalculating Concept Revisions");
	
	HashMap<OWLClass,Integer> revMap = new HashMap<OWLClass,Integer>();

	OWLOntology ont = os.getLoadedOntologie(os.getMainOntologyURI());
	for (OWLClass c: ont.getReferencedClasses()) {
		
		int rev = getRevisionForConcept(os, sp, c);
		
		revMap.put(c, rev);
		
	}
	
	System.out.println("Recalculating of Concept Revisions done");
	return revMap;
	
}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:21,代码来源:ChangeLog.java


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