本体基础知识(一)

本体基础知识

本体建模的核心是明确领域中的概念、概念的属性和约束条件、概念之间的层次关系等。本体的建模原语主要有类、关系、函数、公理和实例等5种。

  • :通常也成为概念,类的含义很广泛,可以指任何事物,如工作描述、功能、行为、策略和推理过程等等。类中间的关系有四种:
    1. part-of:A 属于 B的一部分
    2. kind-of:A 属于 B的另一种
    3. instance-of:A是B的实例
    4. attribute-of:A是B的属性
  • 关系:代表了在领域中概念之间的交互作用。形式上定义为n维笛卡儿积的子R:C1×C2×⋯×Cn
  • 函数:一类特殊的关系,这种关系中,前n一1个元素可以唯一决定第n个元素,形式化的定义为F: C1×C2×⋯×Cn-1➡ Cn
  • 公理:表示永真字句
  • 实例:代表元素,是概念的具体化

    XML && RDF

    本体既可以通过XML来表示,也可以通过RDF来表示。

  • XML(Extensible Markup Language):即可扩展标记语言,经常见到

  • RDF(Resource Description Framework):资源描述框架,用于用于描述Web资源的标记语言。

二者的区别是:

  1. 模式不同:XML数据模式是一个文本可扩展语言,相比之下,RDF有一个非常简单的模式,即二元关系模式。当然,任何的RDF声明形式都可以用XML来表示,但XML是被设定为固定的、树状的文本,在描述数据元上缺乏一定的灵活性。RDF模式却是有足够的灵活来描述这种主观的、分布式的、用不同形式来表达的元数据。
  2. 所使用资源不同:XML中所谈到的节点,是XML文档中的节点,尤其是在文档结构中特定之处。在RDF中,节点不在是节点本身了,而是任何其他可用URIS标识的资源,因此RDF是一种元数据语言。
  3. 语义不同:XML Schema最初的语意解释是限制在XML文档中的,它是隐含的。RDF原本就是语意解释,用于对那些不能够用树形结构来很好建模的知识进行建模。总之,XML/XML Schema是数据建模语言,RDF是元数据建模语言,当元数据需要编码成数据时,XML语法就非常的有用,如果纯用XML语言来进行元数据建模那么在灵活性就会受到阻碍。

Jena API or OWL API or Protege-OWL API?

我们可以通过一些API来对本体进行操作,但是在学习过程中会出现如何选择API的考虑。

我的感受是Jena的中文文档更多,学习起来比较方便,而OWLapi中文文档目前较少,不过github测试文档很详细。

OWL API Documentation
Examples

而semanticweb中的解释比较好,英语渣,就不翻译了,直接摘出来

semanticweb 中的答案

If you want to do something with the data graphs, then there are some APIs available that will allow you to find data, modify data, add new data, etc. Jena API is most flexible, as it covers all of RDF and therefore can be used to create OWL constructs, axioms and run inferences. The OWL API bypasses RDF to provide services based on OWL. It is not RDF-friendly and you won’t be applying SPARQL queries any time soon. I know little about the Protégé-API, but I’ guessing it is an extension of the OWL API and therefore subsumes its limitations. The APIs will also provide features to create file serializations from the internal data store.

These APIs are pretty low-level and GUIs are available that use the APIs to manipulate RDF/RDFS/OWL data with a user interface. For example, adding a property value to a resource in a GUI form creates a triple representing this fact. GUI representations of familiar subclass trees manages the class and instance data structures for you. OWL axioms are represented properly. TopBraid Composer-Free (which uses Jena) and Protégé (OWL API in version 4.x, as I understand it) are examples of GUIs. These can also be seen as RDF browsers because they not only parse and edit the data, but act as a server for the data with features to browse and perhaps query the data. They also take care of reasoning details such as applying the appropriate reasoning engine (RDFS, RDFS+, flavors of OWL/OWL 2, SPIN, etc.) and displaying the union of asserted and inferred data.

Insofar as querying and manipulating the data is concerned, another consideration is SPARQL support. SPARQL is to RDF what SQL is to relational models, meaning not just queries but data insert and modify. This has been true since SPARQL CONSTRUCT, but will become stronger once the SPARQL 1.1 Update syntax stabilizes. Flexible forms of reasoning can be accomplished with SPARQL (CONSTRUCT returns a graph that can be interpreted as inferred triples), and non-monotonic reasoning (both inserting and deleting facts) can be accomplished by using SPARQL 1.1 Update. TopBraid’s SPIN and SPARQLMotion are examples of using SPARQL as a standard way to manipulate data that is at a higher level of abstraction (queries instead of a Java API).

0%