简体   繁体   English

使用OWL API创建类层次结构时,以依赖本体显示类

[英]Showing classes in dependent ontologies when creating class hierarchy with OWL API

I want to create a class hierarchy of the classes in an ontology using OWL API, similar to what you might see if you loaded an ontology in a tool such as Protege. 我想使用OWL API在本体中创建类的类层次结构,类似于在诸如Protege之类的工具中加载本体时可能会看到的内容。

An example of how to do this may be found here: http://sourceforge.net/p/owlapi/mailman/message/27600103/ . 可以在以下位置找到有关此操作的示例: http : //sourceforge.net/p/owlapi/mailman/message/27600103/

As you can see, it seems difficult to reproduce the Protege hierarchy precisely using OWL API, and I am wondering if there is an example which will reproduce Protege's behaviour or if the fundamental reasons for not being able to do so may be clarified so an alternative approach may be found. 如您所见,使用OWL API精确地复制Protege层次结构似乎很困难,我想知道是否有一个示例可以复制Protege的行为,或者是否可以阐明无法复制Protege的根本原因,因此可以选择可能找到方法。 I have had similar problems to the author of the post above, in that I can't seem to consistently reproduce the hierarchy shown by Protege by recursively going through the classes and subclasses, starting at owl:Thing, in order to create the full class hierarchy. 我与上面的帖子的作者有类似的问题,因为我似乎无法通过从owl:Thing递归地遍历类和子类来创建完整的类,从而始终如一地再现Protege所示的层次结构层次结构。

I need to: 我需要:

  1. Create not only the class hierarchy structure of the top level ontology being parsed, but also show the hierarchical relationships with classes in dependent ontologies, as Protege does. 不仅创建要解析的顶级本体的类层次结构,而且还像Protege一样显示与依赖本体中的类的层次关系。 Protege shows the classes in the top level ('active') ontology in bold, with classes taken from dependent ontologies in normal print. Protege以粗体显示顶级(“活动”)本体中的类,并以常规印刷方式从依赖本体中提取类。
  2. Create the hierarchy consistent with that shown by Protege for the same active ontology. 为相同的活动本体创建与Protege显示的层次结构一致的层次结构。 I am assuming the hierarchy shown by Protege is correct? 我假设Protege显示的层次结构正确吗?

I am happy to post code snippets and examples if desired, please do ask. 如果需要,我很乐意张贴代码段和示例,请务必提出。

The Protégé hierarchy is not a plain hierarchy - Protégé does some reasoning to enrich it, at the behest of its users. Protégé层次结构不是简单的层次结构-Protégé会根据用户的要求进行一些推理来丰富它。

If you have code snippets you wish to refine, it would be useful to see the code, an ontology snippet and what you wish the result to look like - for example, a Protégé screenshot. 如果您有要优化的代码片段,那么查看代码,本体片段以及希望结果显示的内容(例如Protégé屏幕截图)将很有用。 Then it will be easier to refine the answer. 然后,将更容易完善答案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM