RDF 和 OWL 有什么区别?

发布于 2024-08-11 09:51:39 字数 77 浏览 4 评论 0原文

我正在尝试理解语义网的概念。我发现很难理解 RDF 和 OWL 之间到底有什么区别。 OWL 是 RDF 的扩展还是这两者是完全不同的技术?

I am trying to grasp the concept of Semantic Web. I am finding it hard to understand what exactly is the difference between RDF and OWL. Is OWL an extension of RDF or these two are totally different technologies?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(12

后eg是否自 2024-08-18 09:51:39

语义网是分层的。这是我认为您感兴趣的内容的快速摘要。

更新:请注意,RDFS 用于定义数据结构,而不是 OWL。 OWL 描述了普通编程(例如 C 结构体)不关心的语义关系,并且更接近于人工智能研究和应用。集合论。

三元组和三元组URI

Subject - Predicate - Object

这些描述一个事实。一般来说,URI 用于主语和谓语。该对象可以是另一个 URI,也可以是数字或字符串等文字。文字可以有类型(也是 URI),并且它们也可以有语言。是的,这意味着三元组最多可以有 5 位数据!

例如,三元组可能描述查尔斯是哈利的父亲这一事实。

<http://example.com/person/harry> <http://familyontology.net/1.0#hasFather> <http://example.com/person/charles> .

三元组是逻辑极端的数据库规范化。它们的优点是您可以将多个来源的三元组加载到一个数据库中,而无需重新配置。

RDF 和 RDFS

下一层是 RDF - 资源描述框架。 RDF 为三元组定义了一些额外的结构。 RDF 定义的最重要的东西是一个名为“rdf:type”的谓词。这用来表示事物具有某些类型。每个人都使用 rdf:type 这使得它非常有用。

RDFS(RDF 模式)定义了一些代表主语、宾语、谓词等概念的类。这意味着您可以开始对事物的类和关系类型进行陈述。在最简单的层面上,您可以声明诸如 http://familyontology.net/1.0#hasFather 是一个人与一个人之间的关系。它还允许您以人类可读的文本描述关系或类的含义。这是一个模式。它告诉您各种类和关系的合法用途。它还用于指示类或属性是更通用类型的子类型。例如“HumanParent”是“Person”的子类。 “爱”是“知道”的子类。

RDF 序列化

RDF 可以多种文件格式导出。最常见的是 RDF+XML,但这有一些缺点。

N3 是一种更容易阅读的非 XML 格式,并且有一些更严格的子集(Turtle 和 N-Triples)。

重要的是要知道 RDF 是一种处理三元组的方式,而不是文件格式。

XSD

XSD 是一个命名空间,主要用于描述属性类型,如日期、整数等。它通常出现在 RDF 数据中,用于标识文字的特定类型。它也用在 XML 模式中,这是一个略有不同的问题。

OWL

OWL 将语义添加到模式中。它允许您指定有关属性和类的更多信息。它也以三元组表示。例如,它可以指示“如果A isMarriedTo B”,那么这意味着“B isMarriedTo A”。或者,如果“C isAncestorOf D”和“D isAncestorOf E”,则“C isAncestorOf E”。 owl 添加的另一个有用的功能是能够说两个事物是相同的,这对于连接以不同模式表示的数据非常有帮助。您可以说一种模式中的“父亲”关系与其他模式中的“父亲”关系相同。你也可以用它来表示两件事是相同的,比如维基百科上的“Elvis Presley”和BBC上的“Elvis Presley”是同一个。这是非常令人兴奋的,因为这意味着您可以开始连接来自多个站点的数据(这是“链接数据”)。

您还可以使用 OWL 来推断隐含事实,例如“C isAncestorOf E”。

The semantic web comes in layers. This is a quick summary of the ones I think you're interested in.

Update: Please note that RDFS is used to define the structure of the data, not OWL. OWL describes semantic relationships which normal programming, such as a C struct, isn't fussed about and is closer to AI research & set theory.

Triples & URIs

Subject - Predicate - Object

These describe a single fact. Generally URI's are used for the subject and predicate. The object is either another URI or a literal such as a number or string. Literals can have a type (which is also a URI), and they can also have a language. Yes, this means triples can have up to 5 bits of data!

For example a triple might describe the fact that Charles is Harrys father.

<http://example.com/person/harry> <http://familyontology.net/1.0#hasFather> <http://example.com/person/charles> .

Triples are database normalization taken to a logical extreme. They have the advantage that you can load triples from many sources into one database with no reconfiguration.

RDF and RDFS

The next layer is RDF - The Resource Description Framework. RDF defines some extra structure to triples. The most important thing RDF defines is a predicate called "rdf:type". This is used to say that things are of certain types. Everyone uses rdf:type which makes it very useful.

RDFS (RDF Schema) defines some classes which represent the concept of subjects, objects, predicates etc. This means you can start making statements about classes of thing, and types of relationship. At the most simple level you can state things like http://familyontology.net/1.0#hasFather is a relationship between a person and a person. It also allows you to describe in human readable text the meaning of a relationship or a class. This is a schema. It tells you legal uses of various classes and relationships. It is also used to indicate that a class or property is a sub-type of a more general type. For example "HumanParent" is a subclass of "Person". "Loves" is a sub-class of "Knows".

RDF Serialisations

RDF can be exported in a number of file formats. The most common is RDF+XML but this has some weaknesses.

N3 is a non-XML format which is easier to read, and there's some subsets (Turtle and N-Triples) which are stricter.

It's important to know that RDF is a way of working with triples, NOT the file formats.

XSD

XSD is a namespace mostly used to describe property types, like dates, integers and so forth. It's generally seen in RDF data identifying the specific type of a literal. It's also used in XML schemas, which is a slightly different kettle of fish.

OWL

OWL adds semantics to the schema. It allows you to specify far more about the properties and classes. It is also expressed in triples. For example, it can indicate that "If A isMarriedTo B" then this implies "B isMarriedTo A". Or that if " C isAncestorOf D " and " D isAncestorOf E " then " C isAncestorOf E ". Another useful thing owl adds is the ability to say two things are the same, this is very helpful for joining up data expressed in different schemas. You can say that relationship "sired" in one schema is owl:sameAs "fathered" in some other schema. You can also use it to say two things are the same, such as the "Elvis Presley" on wikipedia is the same one on the BBC. This is very exciting as it means you can start joining up data from multiple sites (this is "Linked Data").

You can also use the OWL to infer implicit facts, such as "C isAncestorOf E".

朮生 2024-08-18 09:51:39

简而言之:

  • RDF 定义了如何编写内容
  • OWL 定义了编写内容

正如之前的发帖者所写,RDF 是一个告诉您如何定义三元组的规范。

问题是 RDF 允许您定义所有内容,因此您可以编写如下声明:

| subject | predicate | object |
|---------|-----------|--------|
| Alex    | Eats      | Apples |
| Apples  | Eats      | Apples |
| Apples  | Apples    | Apples |

这些三元组形成有效的 RDF 文档。

但是,从语义上讲,您知道这些陈述是不正确的,并且 RDF 无法帮助您验证您所编写的内容。

这不是一个有效的本体论。

OWL 规范准确定义了您可以使用 RDF 编写的内容,以获得有效的本体。

本体可以具有多个属性。

这就是为什么 OWL(版本 1)定义了多个版本,如 OWL DL、OWL Lite、OWL Full。

In short:

  • RDF defines how to write stuff
  • OWL defines what to write

As previous poster wrote, RDF is a specification which tells you how to define triples.

The problem is that RDF allows you to define everything, so you could compose a declaration like this:

| subject | predicate | object |
|---------|-----------|--------|
| Alex    | Eats      | Apples |
| Apples  | Eats      | Apples |
| Apples  | Apples    | Apples |

These triples form valid RDF documents.

But, semantically, you understand that these statements are incorrect and RDF cannot help you to validate what you have written.

This is not a valid ontology.

OWL specification defines exactly what you can write with RDF in order to have valid ontology.

Ontologies can have several properties.

Thats why OWL (ver 1) defines several versions like OWL DL, OWL Lite, OWL Full.

浅浅淡淡 2024-08-18 09:51:39

RDF、RDFS 和 OWL 是表达日益复杂的信息或知识的方法。所有这些都可以用 RDF/XML 语法(或任何其他 RDF 序列化语法,例如 Turtle 或 N3)进行序列化。

这些技术是相关的并且应该是可互操作的,但它们具有不同的起源,这也许就是为什么它们之间的关系很难理解的原因。选择其中之一取决于您建模的情况所需的复杂程度。

表达能力总结

RDF:直接表示,重点关注实例及其类型的映射 (rdf:type)。可以定义自定义属性来链接数据并创建三元组。使用 SPARQL 查询 RDF 数据。
在 Turtle 中序列化 RDF 的示例:

@prefix : <http://www.example.org/> .
:john    rdf:type           :Man .
:john    :livesIn  "New-York" .
:livesIn    rdf:type    rdf:Property .

RDFS:有些情况单独使用 RDF 不容易建模,有时表示更复杂的关系(例如子类)(类型的类型)很有趣) 例如。 RDFS 提供了特殊的方法来表示这种情况,例如 rdfs:subClassOf 、rdfs:rangerdfs:domain 等结构。理想情况下,推理者可以理解 RDFS 语义并根据关系扩展三元组的数量:例如,如果您有三元组 John a ManMan rdfs :subClassOf Human 那么您还应该生成三元组 John a Human。请注意,仅使用 RDF 是不可能做到这一点的。使用SPARQL查询RDFS数据。
Turtle 中序列化的 RDFS 示例:

@prefix : <http://www.example.org/> .
:john    rdf:type           :Man .
:Man    rdfs:subClassOf    :Human .
:john    :livesIn  "New-York" .
:livesIn    rdf:type    rdf:Property .
# After reasoning
:john    rdf:type    :Human .

OWL: 最高级别的表达能力。类之间的关系可以基于描述逻辑(数学理论)进行形式化建模。 OWL 严重依赖推理器,可以表达复杂的结构,例如实例的链式属性或类之间的限制。 OWL 用于在 RDF 数据集之上构建本体或模式。由于 OWL 可以序列化为 RDF/XML,因此理论上可以通过 SPARQL 对其进行查询,但使用 DL 查询(通常是标准 OWL 类表达式)查询 OWL 本体要直观得多。
在 Turtle 中序列化的 OWL 构造示例。

@prefix : <http://www.example.org/> .
:livesIn    rdf:type    owl:DatatypeProperty .
:Human    rdf:type    owl:Class .
:Man   rdf:type    owl:Class .
:Man    rdfs:subClassOf    :Human .
:John    rdf:type    :Man . 
:John    rdf:type    owl:NamedIndividual .

RDF, RDFS and OWL are means to express increasingly complex information or knowledge. All of them can be serialised in RDF/XML syntax (or any other RDF serialisation syntax like Turtle or N3 for instance).

These technologies are related and supposed to be interoperable, yet they have different origins that's maybe why the relation between them is complicated to grasp. The choice on one or the other depends on how much complexity the situation you are modelling requires.

Summary of expressivity

RDF: Straightforward representation, focused on the instances and on the mapping to their types (rdf:type). It is possible to define custom properties to link data and creating triples. RDF data are queried with SPARQL.
Example of RDF serialised in Turtle:

@prefix : <http://www.example.org/> .
:john    rdf:type           :Man .
:john    :livesIn  "New-York" .
:livesIn    rdf:type    rdf:Property .

RDFS: Some situations are not easily modelled by RDF alone, it is sometimes interesting to represent more complex relations like subclasses (the type of a type) for example. RDFS provides special means to represent such cases, with constructs like rdfs:subClassOf, rdfs:range or rdfs:domain. Ideally, a reasoner can understand the RDFS semantics and expand the number of triples based on the relations: For instance if you have the triples John a Man and Man rdfs:subClassOf Human then you should generate as well the triple John a Human. Note that this is not possible to do with RDF alone. RDFS data are queried using SPARQL.
Example of RDFS serialised in Turtle:

@prefix : <http://www.example.org/> .
:john    rdf:type           :Man .
:Man    rdfs:subClassOf    :Human .
:john    :livesIn  "New-York" .
:livesIn    rdf:type    rdf:Property .
# After reasoning
:john    rdf:type    :Human .

OWL: The highest level of expressivity. Relation between classes can be formally modelled based on description logics (mathematical theory). OWL relies heavily on the reasoner, it is possible to express complex constructs such as chained properties for instance or restriction between classes. OWL serves to build ontologies or schema on the top of RDF datasets. As OWL can be serialised as RDF/XML, it is theoretically possible to query it via SPARQL, yet it is much more intuitive to query an OWL ontology with a DL query (which is usually a standard OWL class expression).
Example of OWL constructs serialised in Turtle.

@prefix : <http://www.example.org/> .
:livesIn    rdf:type    owl:DatatypeProperty .
:Human    rdf:type    owl:Class .
:Man   rdf:type    owl:Class .
:Man    rdfs:subClassOf    :Human .
:John    rdf:type    :Man . 
:John    rdf:type    owl:NamedIndividual .
无可置疑 2024-08-18 09:51:39

首先,正如之前指出的,owl可以在RDF中序列化。

其次,OWL 通过提供使用正式的可计算一阶描述逻辑来定义三元组组件的装置,为 RDF 添加了本体论功能(RDF 本身仅提供极其有限的形式知识表示功能)。这就是这里的海报所说的“语义丰富性”的意思。

第三,重要的是要认识到,在 OWL-Full(对于 OWL 1)中,rdfs:class 和 owl:class 是等效的,而在 OWL-DL 中,owl:class 是 rdfs:class 的子类。实际上,这意味着您可以使用 OWL 本体作为 RDF 的模式(它并不正式需要模式)。

我希望这有助于进一步澄清。

Firstly, an as has been pointed out before, owl can be serialised in RDF.

Secondly, OWL adds ontological capability to RDF (which on its own only provides extremely limited capability for formal knownledge representation), by providing the apparatus to define the components of your triple using formal computable first order description logic. That is what posters here mean by when they talk about "semantic richness".

Thirdly, it's important to realise that in OWL-Full (for OWL 1) rdfs:class and owl:class are equivalent and in OWL-DL, owl:class is a subclass of rdfs:class. In effect, this means that you can use an OWL ontology as a schema for RDF (which does not formally require schemata).

I hope that helps to clarify further.

为你拒绝所有暧昧 2024-08-18 09:51:39

当您使用术语 RDF 时,您必须区分两件事:

  1. 您可以将 RDF 作为一个概念来引用:

    一种使用三元组集合来描述事物/逻辑/任何事物的方法。

    示例:

    “安娜有苹果。” “苹果很健康。”

    上面有两个三元组,描述了两个资源“Anna”和“apples”。 RDF(资源描述框架)的概念是您可以用仅 3 个单词(术语)的集合来描述资源(任何事物)。在这个级别,您不关心如何存储信息,无论您是否有一串 3 个单词,或墙上的一幅画,或一张有 3 列的桌子等。

    在这个概念层面上,唯一重要的是您可以使用三重语句来表示您想要的任何内容。

  2. 您可以将 RDF 视为词汇表

    词汇表只是存储在文件或其他地方的术语定义的集合。这些定义的术语的目的是在其他描述中普遍重用,以便人们可以更轻松地以标准方式描述数据(资源)。

    在网络上您可以找到一些标准词汇,例如:

    RDF (https://www.w3.org/1999/ 02/22-rdf-语法-ns)

    RDFS (https://www.w3.org/2000/01/rdf -架构#)

    OWL (https://www.w3.org/2002/07/owl)

    RDF 词汇定义了帮助您描述(尽可能在最基本的层面上)个体/类实例的术语。示例:rdf:类型、rdf:属性。

    使用 rdf:type 您可以描述某些资源是类的实例:

      rdf:类型  
    

    因此,RDF 词汇表中的术语针对的是类实例的基本描述和其他一些描述(例如三重语句定义或谓词定义……一般来说与 RDF 概念相关)。

    RDFS 词汇表具有术语定义,可帮助您描述类及其之间的关系。 RDFS 词汇表不像 RDF 词汇表那样关心类(个体)的实例。示例:rdfs:subClassOf 属性可用于描述类 A 是类 B 的子类。

    RDF 和 RDFS 词汇表相互依赖。 RDF 使用 RDFS 定义它的术语,RDFS 使用 RDF 定义它自己的术语。

    RDF/RDFS 词汇表提供可用于创建非常基本的资源描述的术语。如果您想要更复杂和准确的描述,则必须使用 OWL 词汇表。

OWL 词汇表附带了一组针对更详细描述的新术语。这些术语是使用 RDF/RDFS 词汇表中的术语定义的。

owl:ObjectProperty a rdfs:Class ;
                   rdfs:label "ObjectProperty" ;
                   rdfs:comment "The class of object properties." ;
                   rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
                   rdfs:subClassOf rdf:Property .

owl:DatatypeProperty a rdfs:Class ;
                     rdfs:label "DatatypeProperty" ;
                     rdfs:comment "The class of data properties." ;
                     rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
                     rdfs:subClassOf rdf:Property .

 owl:TransitiveProperty a rdfs:Class ;
                        rdfs:label "TransitiveProperty" ;
                        rdfs:comment "The class of transitive properties." ;
                        rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
                        rdfs:subClassOf owl:ObjectProperty .

正如您在上面所看到的,OWL 词汇表通过创建新类型的属性来扩展 rdf:Property 的概念,这些属性不太抽象,并且可以提供更准确的资源描述。

结论:

  1. RDF 是一种使用三元组集合来描述资源的概念或方法。
  2. RDF 三元组可以以不同的格式存储(XML/RDF、Turtle 等)。RDF
  3. 的概念是所有语义 Web 技术和结构(如词汇表)的基础模型。
  4. RDF 也是一个词汇表,它与 RDFS 词汇表一起提供了一组可用于创建资源的一般/抽象描述的术语。
  5. OWL 是使用 RDF 和 RDFS 词汇表构建的词汇表,它提供了用于创建更详细的资源描述的新术语。
  6. 所有语义网络词汇(RDF、RDFS、OWL 等)都是通过尊重 RDF 概念构建的。
  7. 当然,OWL 词汇表背后有定义 Web 本体语言的各种复杂逻辑和概念。 OWL 词汇只是在实践中使用所有逻辑的一种方式。

When you are using the term RDF you have to distinguish two things:

  1. You can refer to RDF as a concept:

    A way of describing things/logic/anything using collections of triples.

    Example:

    "Anna has apples." "Apples are healthy."

    Above you have two triples that describe two resources "Anna" and "apples". The concept of RDF (Resource Description Framework) is that you can describe resources (anything) with sets of only 3 words (terms). At this level you don't care about how you are storing information, whether you have a string of 3 words, or a painting on a wall, or a table with 3 columns etc.

    At this conceptual level the only thing that is important is that you can represent anything that you want using triple statements.

  2. You can refer to RDF as a vocabulary

    A vocabulary is just a collection of term definitions stored in a file or somewhere. These defined terms have the purpose of being generally reused in other descriptions so people can describe data (resources) more easily and in a standard manner.

    On the web you can find some standard vocabularies like:

    RDF (https://www.w3.org/1999/02/22-rdf-syntax-ns)

    RDFS (https://www.w3.org/2000/01/rdf-schema#)

    OWL (https://www.w3.org/2002/07/owl)

    The RDF vocubalary defines terms that help you to describe (at the most basic level as possible) individuals/instances of classes. Example: rdf:type, rdf:Property.

    With rdf:type you can describe that some resource is an instance of a class:

     <http://foo.com/anna> rdf:type <http://foo.com/teacher> 
    

    So the RDF vocabulary has terms that are targeting basic descriptions of class instances and some other descriptions (like the triple statement definition, or the predicate definition... in general things that are realted to the RDF concept).

    The RDFS vocabulary has term definitions that help you describe classes and relationships between them. RDFS vocabulary doesn't care about instances of classes (individuals) like the RDF vocabulary. Example: the rdfs:subClassOf property which you can use to describe that a class A is subclass of class B.

    The RDF and the RDFS vocabularies are dependent to one another. RDF defines it's terms using RDFS, and RDFS uses RDF for defining it's own terms.

    The RDF/RDFS vocabularies provide terms that can be used to create very basic descriptions of resources. If you want to have more complex and accurate descriptions you have to use the OWL vocabulary.

The OWL vocabulary comes with a set of new terms targeting more detailed descriptions. These term are defined using terms from RDF/RDFS vocabularies.

owl:ObjectProperty a rdfs:Class ;
                   rdfs:label "ObjectProperty" ;
                   rdfs:comment "The class of object properties." ;
                   rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
                   rdfs:subClassOf rdf:Property .

owl:DatatypeProperty a rdfs:Class ;
                     rdfs:label "DatatypeProperty" ;
                     rdfs:comment "The class of data properties." ;
                     rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
                     rdfs:subClassOf rdf:Property .

 owl:TransitiveProperty a rdfs:Class ;
                        rdfs:label "TransitiveProperty" ;
                        rdfs:comment "The class of transitive properties." ;
                        rdfs:isDefinedBy <http://www.w3.org/2002/07/owl#> ;
                        rdfs:subClassOf owl:ObjectProperty .

As you can see above the OWL vocabulary extends the concept of rdf:Property by creating new types of Properties that are less abstract and can provide more accurate descriptions of resources.

Conclusions:

  1. RDF is a concept or a way of describing resources using sets of triples.
  2. RDF triples can be stored in different formats (XML/RDF, Turtle etc.)
  3. The concept of RDF is the base model of all semantic web technologies and structures (like vocabularies).
  4. RDF is also a vocabulary that along with the RDFS vocabulary provides a set of terms that can be used for creating general/abstract descriptions of resources.
  5. OWL is a vocabulary built with RDF and RDFS vocabularies that provide new terms for creating more detailed descriptions of resources.
  6. All semantic web vocabularies (RDF, RDFS, OWL etc) are built by respecting the RDF concept.
  7. And of course the OWL vocabulary has behind the scenes all kind of complex logic and concepts which define the Web Ontology Language. The OWL vocabulary is just a way of using all that logic in practice.
深居我梦 2024-08-18 09:51:39

RDFS 允许您通过标准化灵活的、基于三元组的格式,然后提供词汇表(“关键字”,例如 rdf:type 或 rdfs:subClassOf )来表达事物之间的关系>) 可以用来表达事物。

OWL 类似,但更大、更好、更糟糕。 OWL 让您可以更多地了解您的数据模型,它向您展示如何有效地使用数据库查询和自动推理器,并且它提供了有用的注释以将您的数据模型带入现实世界。

第一个区别:词汇

在 RDFS 和 OWL 之间的区别中,最重要的是 OWL 提供了一个大得多的词汇,您可以用它来表达事物。

例如,OWL 包括 RDFS 中的所有老朋友,例如 rdfs:type 、rdfs:domain 和 rdfs:subPropertyOf 。然而,OWL 也给你带来了新的、更好的朋友!例如,OWL 可以让您用集合运算来描述数据:

Example:Mother    owl:unionOf     (Example:Parent, Example:Woman)

它可以让您定义跨数据库的等价性:

AcmeCompany:JohnSmith  owl:sameAs    PersonalDatabase:JohnQSmith

它可以让您限制属性值:

Example:MyState     owl:allValuesFrom     (State:NewYork, State:California, …)

事实上,OWL 提供了许多新的、复杂的词汇用于数据建模和推理,它自己的教训!

第二个区别:刚性

另一个主要区别是,与 RDFS 不同,OWL 不仅告诉您如何可以使用某些词汇,它实际上告诉您如何不能使用它。相比之下,RDFS 为您提供了一个万事皆可的世界,您可以在其中添加几乎任何您想要的三元组。

例如,在 RDFS 中,您认为任何东西都可以是 rdfs:Class 的实例。您可能决定说 Beaglerdfs:Class,然后说 FidoBeagle 的实例:

Example: Beagle    rdf:Type    rdfs:Class

Example:Fido    rdf:Type    Example: Beagle

事情,也许您想说比格犬在英格兰饲养的狗的一个实例:

Example:Beagle    rdf:Type    Example:BreedsBredInEngland

Example: BreedsBredInEngland    rdf:Type    rdfs:Class

接下来,您可能会决定要谈论有关比格犬的 此示例是 Example:Beagle 被用作类和实例小猎犬Fido所属的一个类别,但小猎犬本身是另一个类别的成员:在英格兰培育的动物。

在 RDFS 中,所有这些都是完全合法的,因为 RDFS 并不真正限制您可以插入哪些语句和不能插入哪些语句。相比之下,在 OWL 中,或者至少在 OWL 的某些风格中,上述语句实际上是不合法的:你根本不允许说某物既可以是类又可以是实例。

这是 RDFS 和 OWL 之间的第二个主要区别。 RDFS 实现了自由混战,一切事物都充满了狂野西部、Speak-Easies 和萨尔瓦多·达利 (Salvador Dali) 的世界。 OWL 的世界采用了更加严格的结构。

第三个区别:注释、元元数据

假设您花了最后一个小时构建一个描述您的无线电制造业务的本体。午餐期间,您的任务是为您的时钟制造业务构建本体。今天下午,喝完一杯美味的咖啡后,你的老板告诉你,你必须为你的高利润时钟收音机业务建立一个本体。有没有办法轻松重用早上的工作?

OWL 使得做这样的事情变得非常非常容易。 Owl:Import 是您在时钟收音机情况下使用的内容,但 OWL 还为您提供了丰富的注释,例如 owl:versionInfoowl: backsCompatibleWithowl:deprecatedProperty 可以轻松用于将数据模型链接成一个相互连贯的整体。

与 RDFS 不同,OWL 一定能满足您所有的元元数据建模需求。

结论

OWL 为您提供了更大的词汇量,这使得您可以轻松说出有关数据模型的任何内容。它甚至允许您根据当今计算机的计算现实来定制您所说的内容,并针对特定应用程序(例如搜索查询)进行优化。此外,OWL 允许您使用标准注释框架轻松表达不同本体之间的关系。

与 RDFS 相比,所有这些都是优点,并且通常值得您付出额外的努力来熟悉它们。

来源:RDFS 与 OWL

RDFS allows you to express the relationships between things by standardizing on a flexible, triple-based format and then providing a vocabulary ("keywords" such as rdf:type or rdfs:subClassOf) which can be used to say things.

OWL is similar, but bigger, better, and badder. OWL lets you say much more about your data model, it shows you how to work efficiently with database queries and automatic reasoners, and it provides useful annotations for bringing your data models into the real world.

1st Difference: Vocabulary

Of the differences between RDFS and OWL, the most important is just that OWL provides a far, far larger vocabulary that you can use to say things.

For example, OWL includes all your old friends from RDFS such as rdfs:type, rdfs:domain, and rdfs:subPropertyOf. However, OWL also gives you new and better friends! For example, OWL lets you describe you data in terms of set operations:

Example:Mother    owl:unionOf     (Example:Parent, Example:Woman)

It lets you define equivalences across databases:

AcmeCompany:JohnSmith  owl:sameAs    PersonalDatabase:JohnQSmith

It lets you restrict property values:

Example:MyState     owl:allValuesFrom     (State:NewYork, State:California, …)

in fact, OWL provides so much new, sophisticated vocabulary to use in data modeling and reasoning that gets its own lesson!

2nd Difference: Rigidity

Another major difference is that unlike RDFS, OWL not only tells you how you can use certain vocabulary, it actually tells you how you cannot use it. By contrast, RDFS gives you an anything goes world in which you can add pretty much any triple you want.

For example, in RDFS, anything you feel like can be an instance of rdfs:Class. You might decide to say that Beagle is an rdfs:Class and then say that Fido is an instance of Beagle:

Example: Beagle    rdf:Type    rdfs:Class

Example:Fido    rdf:Type    Example: Beagle

Next, you might decide that you would like to say things about beagles, perhaps you want to say that Beagle is an instance of dogs bred in England:

Example:Beagle    rdf:Type    Example:BreedsBredInEngland

Example: BreedsBredInEngland    rdf:Type    rdfs:Class

The interesting thing in this example is that Example:Beagle is being used as both a class and an instance. Beagle is a class that Fido is a member of, but Beagle is itself a member of another class: Things Bred in England.

In RDFS, all this is perfectly legal because RDFS doesn't really constrain which statements you can and cannot insert. In OWL, by contrast, or at least in some flavors of OWL, the above statements are actually not legal: you're simply not allowed to say that something can be both a class and an instance.

This is then a second major difference between RDFS and OWL. RDFS enables a free-for-all, anything goes kind of world full of the Wild West, Speak-Easies, and Salvador Dali. The world of OWL imposes a much more rigid structure.

3rd Difference: Annotations, the meta-meta-data

Suppose that you've spent the last hour building an ontology that describes your radio manufacturing business. During lunch, your task is to build an ontology for your clock manufacturing business. This afternoon, after a nice coffee, your boss now tells you that you'll have to build an ontology for your highly profitable clock-radio business. Is there a way to easily reuse the morning's work?

OWL makes doing things like this very, very easy. Owl:Import is what you would use in the clock-radio situation, but OWL also gives you a rich variety of annotations such as owl:versionInfo, owl:backwardsCompatibleWith, and owl:deprecatedProperty, which can easily be used link data models together into a mutually coherent whole.

Unlike RDFS, OWL is sure to satisfy all of your meta-meta-data-modeling needs.

Conclusion

OWL gives you a much larger vocabulary to play with, which makes it easy to say anything you might want to say about your data model. It even allows you to tailor what you say based on the computational realities of today's computers and to optimize for particular applications (for search queries, for example.) Further, OWL allows you to easily express the relationships between different ontologies using a standard annotation framework.

All these are advantages as compared to RDFS, and are typically worth the extra effort it takes to familiarize yourself with them.

Source : RDFS vs. OWL

后eg是否自 2024-08-18 09:51:39

RDF 是一种定义三元组“主语”、“谓语”、“值” 的方法。
例如,如果我想说,

“我的名字是皮埃尔”

我会写

<mail:[email protected]> <foaf:name> "Pierre"

看到?它是 FOAF 本体的一部分。本体是描述给定主题的属性和类的正式方法,而OWL是定义本体的(RDF)方法。

您可以使用 C++、Java 等来定义类、子类、字段等。RDF

class Person
{
    String email_as_id;
    String name;
}

使用 OWL 来定义这些类型的语句。

另一个提出此类问题的地方:http://www.semanticoverflow.com/

RDF is a way to define a triple 'subject','predicate', 'value'.
For example, if I want to say,

"my name is Pierre"

I would write

<mail:[email protected]> <foaf:name> "Pierre"

See the <foaf:name> ? it is part of the FOAF ontology. An ontology is a formal way to describe the properties, the classes of a given subject and OWL is a (RDF) way to define an ontology.

You use C++, Java, etc... to define a Class, a subclass, a field, etc...

class Person
{
    String email_as_id;
    String name;
}

RDF uses OWL to define these kinds of statements.

Another place to ask this kind of question: http://www.semanticoverflow.com/

孤者何惧 2024-08-18 09:51:39

我正在尝试理解语义网的概念。我觉得很难
了解 RDF 和 OWL 之间的确切区别。是
OWL 是 RDF 的扩展或者这两者完全不同
技术?

简而言之,是的,您可以说 OWL 是 RDF 的扩展。

更详细地说,使用 RDF,您可以通过定义主谓宾三元组来描述有向图。主语和宾语是节点,谓语是边,或者说,谓语描述了主语和宾语之间的关系。例如 :Tolkien :wrote :LordOfTheRings:LordOfTheRings :author :Tolkien 等...链接数据系统使用这些三元组来描述知识图,并且它们提供了方法存储它们,查询它们。现在这些都是巨大的系统,但您可以在较小的项目中使用 RDF。每个应用程序都有一种特定于领域的语言(或者用 DDD 术语来说是普遍存在的语言)。您可以在本体/词汇中描述该语言,这样您就可以用图形来描述应用程序的域模型,您可以将其可视化地展示给业务人员,讨论基于模型的业务决策,并在其上构建应用程序的。您可以将应用程序的词汇绑定到它返回的数据以及搜索引擎已知的词汇,例如 microdata (例如,您可以使用 HTML 和 RDFA 来执行此操作),因此搜索引擎可以轻松找到您的应用程序,因为有关其功能的知识将是机器可处理的。这就是语义网的工作原理。 (至少我是这样想象的。)

现在要描述面向对象的应用程序,您需要类型、类、属性、实例等……使用 RDF,您只能描述对象。 RDFS(RDF模式)可以帮助你描述类、继承(基于对象),但它太宽泛了。要定义约束(例如每个中国家庭一个孩子),您需要另一个词汇。 OWL(网络本体语言)可以完成这项工作。 OWL 是一个可用于描述 Web 应用程序的本体。它集成了 XSD simpleTypes。
所以RDF -> RDFS->猫头鹰-> MyWebApp 是以越来越具体的方式描述您的 Web 应用程序的命令。

I am trying to grasp the concept of Semantic Web. I am finding it hard
to understand what exactly is the difference between RDF and OWL. Is
OWL an extension of RDF or these two are totally different
technologies?

In short, yes you could say that OWL is an extension of RDF.

In more detail, with RDF you can describe a directed graph by defining subject-predicate-object triples. The subject and the object are the nodes, the predicate is the edge, or by other words, the predicate describes the relation between the subject and the object. For example :Tolkien :wrote :LordOfTheRings or :LordOfTheRings :author :Tolkien, etc... Linked data systems use these triples to describe knowledge graphs, and they provide ways to store them, query them. Now these are huge systems, but you can use RDF by smaller projects. Every application has a domain specific language (or by DDD terms ubiquitous language). You can describe that language in your ontology/vocabulary, so you can describe the domain model of your application with a graph, which you can visualize show it to business ppl, talk about business decisions based on the model, and build the application on top of that. You can bind the vocab of your application to the data it returns and to a vocabulary known by the search engines, like microdata (for example you can use HTML with RDFA to do this), and so search engines can find your applications easily, because the knowledge about what it does will be machine processable. This is how semantic web works. (At least this is how I imagine it.)

Now to describe object oriented applications you need types, classes, properties, instances, etc... With RDF you can describe only objects. RDFS (RDF schema) helps you to describe classes, inheritance (based on objects ofc.), but it is too broad. To define constraints (for example one kid per chinese family) you need another vocab. OWL (web ontology language) does this job. OWL is an ontology which you can use to describe web applications. It integrates the XSD simpleTypes.
So RDF -> RDFS -> OWL -> MyWebApp is the order to describe your web application in a more and more specific way.

硬不硬你别怂 2024-08-18 09:51:39

一图胜千言!下图应该强调 Christopher Gutteridge
在这个答案中说语义网是一个“分层架构”。

输入图像描述这里

来源:https:// www.obitko.com/tutorials/ontologies-semantic-web/semantic-web-architecture.html

A picture speaks a thousand words! This diagram below should reinforce what Christopher Gutteridge
said in this answer that the semantic web is a "layered architecture".

enter image description here

Source: https://www.obitko.com/tutorials/ontologies-semantic-web/semantic-web-architecture.html

标点 2024-08-18 09:51:39

在 WC3 文档对象模型中,文档是一个抽象事物:一个元素,其中嵌套有文本、注释、属性和其他元素。

在语义网中,我们处理一组“三元组”。每个三元组都是:

  • 一个主题、三元组关于的事物、id、数据库主键 - URI;谓词
  • 、“动词”、“属性”、“数据库列”——另一个 URI;以及
  • 对象,一个原子值或某个URI。

OWL 之于语义网络,就像 Schema 之于 W3C 文档对象模型一样。它记录了各种 URI 的含义,并指定如何以可由机器检查的正式方式使用它们。语义网对于适用于它的 OWL 可能有效,也可能无效,就像文档对于模式可能有效也可能无效一样。

RDF 之于语义网络就像 XML 之于 DOM - 它是一组三元组的序列化。

当然,RDF 通常被序列化为 XML 文档……但重要的是要了解 RDF 与“RDF 的 XML 序列化”不同。

同样,OWL 可以使用 OWL/XML 进行序列化,或者(抱歉)它可以表示为 RDF,而 RDF 本身通常被序列化为 XML。

In the WC3 document object model, a document is an abstract thing: an element with text, comments, attributes, and other elements nested within it.

In the semantic web, we deal with a set of "triples". Each triple is:

  • a subject, the thing the triple is about, the id, the database primary key - a URI; and
  • the predicate, the "verb", the "property", the "database column" - another URI; and
  • the object, an atomic value or some URI.

OWL is to the semantic web as Schemas are to the W3C document object model. It documents what the various URIs mean and specify how they are used in a formal way that can be checked by a machine. A semantic web may or may not be valid with respect to the OWL that applies to it, just as a document may or may not be valid with respect to a schema.

RDF is to the semantic web as XML is to the DOM - it's a serialisation of a set of triples.

Of course, RDF is usually serialised as an XML documents ... but it's important to understand that RDF is not the same thing as "the XML serialisation of RDF".

Likewise, OWL can be serialised using OWL/XML, or (sorry about this) it can be expressed as RDF, which itself is usually serialised as XML.

一曲琵琶半遮面シ 2024-08-18 09:51:39

基本的语义 Web 堆栈已经在这个线程中进行了很多解释。我想重点讨论最初的问题并将 RDF 与 OWL 进行比较。

  • OWL 是 RDF 和 RDF 的超集。 RDF-S(顶部)
  • OWL 允许有效地与 RDF 和 RDF 一起工作。 RDF-S
  • OWL 有一些扩展词汇
    • 课程和课程个人(“实例”)
    • 属性和属性数据类型(“谓词”)
  • OWL 是正确推理和推理所必需的
  • OWL 有三种方言:精简版、描述逻辑和推理。完整

使用 OWL 对于通过了解一些事实来获得更多意义(推理和推理)至关重要。这种“动态创建”的信息可以进一步用于类似 SPARQL 中的相关查询。

一些示例将表明这实际上适用于 OWL - 这些示例取自我的 2015 年在西班牙马略卡岛 TYPO3camp 上谈论语义网络的基础知识

规则的等同

Spaniard: Person and (inhabitantOf some SpanishCity)

这意味着西班牙人必须是 (因此继承推理部分中的所有属性)并且必须居住在至少一个(或多个)SpanishCity 中。

属性的含义

<Palma isPartOf Mallorca>
<Mallorca contains Palma>

该示例显示了将 inverseOf 应用于属性 isPartOfcontains 的结果。

  • 逆对称
  • 传递
  • 相交
  • ...

属性的基数

<:hasParent owl:cardinality “2“^^xsd:integer>

这定义了每个事物(在这种情况下很可能是人类)恰好有两个父级 - 基数被分配给<代码>hasParent 属性。

  • 最小
  • 最大
  • 精确

The basic semantic web stack has been explained a lot already in this thread. I'd like to focus on the initial question and compare RDF to OWL.

  • OWL is a super-set of RDF & RDF-S (on top)
  • OWL allows to effectively working with RDF & RDF-S
  • OWL has some extended vocabulary
    • classes & individuals ("instances")
    • properties & data-types ("predicates")
  • OWL is required for proper reasoning and inference
  • OWL comes in three dialects lite, description logic & full

Using OWL is essential to get more meaning (reasoning & inference) by just knowing a few facts. This "dynamically created" information can further be used for accordant queries like in SPARQL.

Some examples will show that that actually works with OWL - these have been taken from my talk about the basics of semantic web at the TYPO3camp Mallorca, Spain in 2015.

equivalents by rules

Spaniard: Person and (inhabitantOf some SpanishCity)

This means that a Spaniard must be a Person (and thus inherits all properties in the inferencing part) and must live in at least one (or more) SpanishCity.

meaning of properties

<Palma isPartOf Mallorca>
<Mallorca contains Palma>

The example shows the result of applying inverseOf to the properties isPartOf and contains.

  • inverse
  • symmetric
  • transitive
  • disjoint
  • ...

cardinalities of properties

<:hasParent owl:cardinality “2“^^xsd:integer>

This defines that each Thing (in this scenario most probably a Human) has exactly two parents - the cardinality is assigned to the hasParent property.

  • minimum
  • maximum
  • exact
装纯掩盖桑 2024-08-18 09:51:39

资源描述框架(RDF)是一种强大的形式化知识表示语言,也是语义网的基本标准。它有自己的词汇表来定义核心概念和关系(例如,rdf:type 对应 isA 关系),以及一个数据模型,以主谓宾(资源属性值)的形式实现机器可解释的语句三元组,称为 RDF 三元组,例如 picture-depict-book。 RDF 词汇表的扩展以及创建受控词汇表和基本本体所需的概念称为 RDF 模式或 RDF 词汇描述语言 (RDFS)。 RDFS 使得编写有关类和资源的语句以及表达分类结构(例如通过超类-子类关系)成为可能。

复杂的知识领域需要比 RDFS 中提供的更多功能,这导致了OWL的引入。 OWL 支持类之间的关系(并集、交集、不相交、等价)、属性基数约束(最小、最大、精确数,例如,每个人只有一个父亲)、丰富的属性类型、属性特征和特殊属性(传递性、对称、函数、反函数,例如,A ex:hasAncestor B 和 B ex:hasAncestor C 暗示 A ex:hasAncestor C),指定给定属性是特定类实例的唯一键,以及域和范围限制对于属性。

The Resource Description Framework (RDF) is a powerful formal knowledge representation language and a fundamental standard of the Semantic Web. It has its own vocabulary that defines core concepts and relations (e.g., rdf:type corresponds to the isA relationship), and a data model that enables machine-interpretable statements in the form of subject-predicate-object (resource-property-value) triples, called RDF triples, such as picture-depicts-book. The extension of the RDF vocabulary with concepts required to create controlled vocabularies and basic ontologies is called RDF Schema or RDF Vocabulary Description Language (RDFS). RDFS makes it possible to write statements about classes and resources, and express taxonomical structures, such as via superclass-subclass relationships.

Complex knowledge domains require more capabilities than what is available in RDFS, which led to the introduction of OWL. OWL supports relationships between classes (union, intersection, disjointness, equivalence), property cardinality constraints (minimum, maximum, exact number, e.g., every person has exactly one father), rich typing of properties, characteristics of properties and special properties (transitive, symmetric, functional, inverse functional, e.g., A ex:hasAncestor B and B ex:hasAncestor C implies that A ex:hasAncestor C), specifying that a given property is a unique key for instances of a particular class, and domain and range restrictions for properties.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文