我试图掌握语义网的概念。我发现很难理解RDF和OWL之间的确切区别。OWL是RDF的扩展还是这两种完全不同的技术?
当前回答
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是一种定义三元“主语”、“谓语”、“值”的方法。 例如,如果我想说,
"我叫皮埃尔"
我会写
<mail:me@where.com> <foaf:name> "Pierre"
参见<foaf:name> ?它是FOAF本体的一部分。本体是描述给定主题的属性和类的正式方式,OWL是定义本体的一种(RDF)方式。
你使用c++, Java等等…定义一个类,一个子类,一个字段,等等…
class Person
{
String email_as_id;
String name;
}
RDF使用OWL来定义这类语句。
另一个问这类问题的地方:http://www.semanticoverflow.com/
简而言之:
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。
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 .
一图胜千言!下面这张图应该可以加强克里斯托弗·古特里奇的观点 在这个回答中说语义网是一个“分层架构”。
来源:https://www.obitko.com/tutorials/ontologies-semantic-web/semantic-web-architecture.html
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.