且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

RDF和OWL有什么区别?

更新时间:2022-06-22 05:39:31

语义网是分层的.这是我认为您感兴趣的内容的简短摘要.

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

更新:请注意,RDFS用于定义数据结构,而不是 not OWL. OWL描述了语义关系,普通的程序(例如C结构)不会受到干扰,并且与AI研究和开发更接近.集合论.

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& URI

Subject - Predicate - Object

这些描述了一个事实.通常,URI用于主题和谓词.该对象可以是另一个URI或文字,例如数字或字符串.文字可以具有类型(也是URI),也可以具有语言.是的,这意味着三元组最多可以包含5位数据!

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和RDFS

下一层是RDF-资源描述框架. RDF为三元组定义了一些额外的结构. RDF定义的最重要的事情是称为"rdf:type"的谓词.用来表示事物是某些类型的.每个人都使用rdf:type,这使其非常有用.

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架构)定义了一些类,这些类表示主题,对象,谓词等的概念.这意味着您可以开始就事物的类和关系类型进行陈述.在最简单的级别上,您可以声明诸如 http://familyontology.net/1.0#hasFather 之类的内容一个人与一个人之间的关系.它还允许您以人类可读的文本描述关系或类的含义.这是一个架构.它告诉您各种类和关系的合法使用.它还用于指示类或属性是更通用类型的子类型.例如,"HumanParent"是"Person"的子类. 爱"是知道"的子类.

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,但这有一些缺点.

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

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

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

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

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

XSD

XSD是一个命名空间,主要用于描述属性类型,例如日期,整数等.通常在RDF数据中可以识别出文字的特定类型.它也用在XML模式中,这有点不一样.

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将语义添加到架构.它允许您指定更多有关属性和类的信息.它也以三元组表示.例如,它可以指示如果A isMarriedTo B",则意味着"B isMarriedTo A".或者,如果" C isAncestorOf D "和" D isAncestorOf E ",则" C isAncestorOf E ".猫头鹰添加的另一个有用的功能是可以说两件事是相同的,这对于连接以不同模式表示的数据非常有帮助.您可以说,在一个模式中的"sired"关系在其他模式中是owl:sameAs"fathered".您也可以使用它说两件事是相同的,例如Wikipedia上的"Elvis Presley"在BBC上是同一件事.这非常令人兴奋,因为它意味着您可以开始从多个站点合并数据(这是链接数据").

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 isAncestorOf E ".

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