本文整理汇总了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);
}
}
示例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");
}
}
示例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();
}
示例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;
}