我试图掌握语义网的概念。我发现很难理解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.
其他回答
语义网是分层的。这是一个简短的总结,我认为你会感兴趣。
更新:请注意,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 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连载
RDF可以以多种文件格式导出。最常见的是RDF+XML,但这有一些弱点。
N3是一种更容易阅读的非xml格式,并且有一些更严格的子集(Turtle和N-Triples)。
重要的是要知道RDF是一种处理三元组的方法,而不是文件格式。
XSD
XSD是一个命名空间,主要用于描述属性类型,如日期、整数等。它通常出现在RDF数据中,用于标识文字的特定类型。它也用于XML模式,这是一种略有不同的情况。
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").
您还可以使用OWL来推断隐含的事实,例如“C isancestry of E”。
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.
基本的语义web堆栈已经在这篇文章中解释了很多。我想把重点放在最初的问题上,并比较RDF和OWL。
OWL是RDF和RDF- s的超级集(在上面) OWL允许有效地使用RDF和RDF- s OWL有一些扩展的词汇表 类和个人(“实例”) 属性和数据类型(“谓词”) OWL是正确的推理和推断所必需的 OWL有三种方言,精简,描述逻辑和完整
使用OWL是通过了解一些事实来获得更多意义(推理和推断)的必要条件。这种“动态创建”的信息可以进一步用于像SPARQL中那样的一致查询。
一些例子将显示这实际上与OWL一起工作——这些都是从我2015年在西班牙马略卡的TYPO3camp上关于语义网基础知识的演讲中摘录出来的。
规则等价
Spaniard: Person and (inhabitantOf some SpanishCity)
这意味着西班牙人必须是一个人(因此继承了推理部分中的所有财产),并且必须至少居住在一个(或多个)西班牙城市。
属性的含义
<Palma isPartOf Mallorca>
<Mallorca contains Palma>
该示例显示了对属性isPartOf和contains应用inverseOf的结果。
逆 对称的 传递 不相交的 ...
属性的基数
<:hasParent owl:cardinality “2“^^xsd:integer>
这定义了每个事物(在这个场景中很可能是人)都有两个父元素——基数被分配给hasParent属性。
最低 最大 确切的
一图胜千言!下面这张图应该可以加强克里斯托弗·古特里奇的观点 在这个回答中说语义网是一个“分层架构”。
来源:https://www.obitko.com/tutorials/ontologies-semantic-web/semantic-web-architecture.html
在WC3文档对象模型中,文档是一个抽象的东西:包含文本、注释、属性和其他嵌套元素的元素。
在语义网中,我们处理的是一组“三元组”。每个三重是:
一个主题,三元组的内容,id,数据库主键,一个URI;而且 谓词,“动词”,“属性”,“数据库列”-另一个URI;而且 对象,原子值或一些URI。
OWL之于语义web就像schema之于W3C文档对象模型。它记录了各种uri的含义,并指定如何以一种可以由机器检查的正式方式使用它们。语义web对于应用于它的OWL可能有效也可能无效,就像文档对于模式可能有效也可能无效一样。
RDF之于语义网就像XML之于DOM——它是一组三元组的序列化。
当然,RDF通常被序列化为XML文档……但重要的是要理解RDF与“RDF的XML序列化”不是一回事。
类似地,OWL可以使用OWL/XML序列化,或者(不好意思)可以表示为RDF,而RDF本身通常序列化为XML。