我试图掌握语义网的概念。我发现很难理解RDF和OWL之间的确切区别。OWL是RDF的扩展还是这两种完全不同的技术?


当前回答

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

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. 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.

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的概念,这些类型不那么抽象,可以提供更准确的资源描述。

结论:

RDF is a concept or a way of describing resources using sets of triples. RDF triples can be stored in different formats (XML/RDF, Turtle etc.) The concept of RDF is the base model of all semantic web technologies and structures (like vocabularies). 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. OWL is a vocabulary built with RDF and RDFS vocabularies that provide new terms for creating more detailed descriptions of resources. All semantic web vocabularies (RDF, RDFS, OWL etc) are built by respecting the RDF concept. 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.

其他回答

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: 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 .

我试图掌握语义网的概念。我发现这很难 来理解RDF和OWL之间的确切区别。是 OWL是RDF的扩展或者这两者是完全不同的 技术吗?

简而言之,是的,您可以说OWL是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.

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.

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

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. 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.

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的概念,这些类型不那么抽象,可以提供更准确的资源描述。

结论:

RDF is a concept or a way of describing resources using sets of triples. RDF triples can be stored in different formats (XML/RDF, Turtle etc.) The concept of RDF is the base model of all semantic web technologies and structures (like vocabularies). 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. OWL is a vocabulary built with RDF and RDFS vocabularies that provide new terms for creating more detailed descriptions of resources. All semantic web vocabularies (RDF, RDFS, OWL etc) are built by respecting the RDF concept. 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.

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的实例。你可能决定说Beagle是一个rdfs:类,然后说Fido是Beagle的一个实例:

Example: Beagle    rdf:Type    rdfs:Class

Example:Fido    rdf:Type    Example: Beagle

接下来,你可能想说关于Beagle的事情,也许你想说Beagle是在英国饲养的狗的一个例子:

Example:Beagle    rdf:Type    Example:BreedsBredInEngland

Example: BreedsBredInEngland    rdf:Type    rdfs:Class

本例中有趣的地方是,示例:Beagle同时用作类和实例。比格犬是菲多的一个阶级,但比格犬本身是另一个阶级的一员:在英国繁殖的东西。

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

这是RDFS和OWL之间的第二个主要区别。RDFS使所有人都可以自由使用,任何东西都可以使用,就像一个充满了狂野西部、speak - easy和萨尔瓦多·达利的世界。OWL的世界强加了一个更加严格的结构。

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

假设您已经花了一个小时来构建描述您的无线电制造业务的本体。在午餐期间,您的任务是为您的时钟制造业务构建一个本体。今天下午,在喝完一杯美味的咖啡后,您的老板现在告诉您,您必须为您的高利润时钟收音机业务构建一个本体。有没有一种方法可以很容易地重复利用上午的工作?

OWL让这类事情变得非常非常简单。Owl:Import是您将在时钟无线电情况下使用的,但是Owl还提供了丰富的注释,例如Owl: versionInfo、Owl: backwardsCompatibleWith和Owl: deprecedproperty,可以轻松地将数据模型链接到一个相互一致的整体中。

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

结论

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

与RDFS相比,所有这些都是优势,通常值得您花费额外的努力来熟悉它们。

来源:RDFS vs. OWL