简体   繁体   English

在 Protege 中使用 RDF/XML 格式创建的本体文件是 RDF 文件还是 OWL 文件?

[英]Is Ontology File created in Protege with RDF/XML Format a RDF file or the OWL file?

I have created the ontology file in the Protege and save it in the RDF/XML format.我已经在 Protege 中创建了本体文件并将其保存为 RDF/XML 格式。 It also contains the OWL tag.它还包含 OWL 标签。

So, the ontology file created by Protege and saved as RDF/XML format are actually the RDF files or the RDF form of the OWL files or the OWL format containing the RDF also or something else ?那么,Protege 创建并保存为 RDF/XML 格式的本体文件实际上是 RDF 文件或 OWL 文件的 RDF 形式或包含 RDF 的 OWL 格式或其他什么?

<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
    <!ENTITY owl "http://www.w3.org/2002/07/owl#" >
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>

<rdf:RDF xmlns="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#"
     xml:base="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:owl="http://www.w3.org/2002/07/owl#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
    <owl:Ontology rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13"/> 
    <!-- 
    ///////////////////////////////////////////////////////////////////////////////////////
    //
    // Classes
    //
    ///////////////////////////////////////////////////////////////////////////////////////
     -->
    <!-- http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#Student -->
    **<owl:Class rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#Student"/>**  
  <!-- http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#University -->

    **<owl:Class rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#University"/>
</rdf:RDF>**
<!-- Generated by the OWL API (version 3.4.2) http://owlapi.sourceforge.net -->

It's the RDF/XML serialization of the RDF mapping of your OWL ontology.它是 OWL 本体的 RDF 映射的 RDF/XML 序列化。

An OWL ontology is a set of axioms. OWL 本体是一组公理。 It can be serialized directly in a number ways: the Manchester syntax, the OWL/XML standard, and Functional Syntax are all options.它可以通过多种方式直接序列化:曼彻斯特语法、OWL/XML 标准和功能语法都是选项。 An OWL ontology can also be mapped to a set of RDF triples, as described in OWL 2 Web Ontology Language Mapping to RDF Graphs (Second Edition) . OWL 本体也可以映射到一组 RDF 三元组,如OWL 2 Web Ontology Language Mapping to RDF Graphs(第二版)中所述 Now, RDF can be serialized in a bunch of different formats, too, eg, RDF/XML, Turtle, N3, and N-Triples.现在,RDF 也可以序列化成多种不同的格式,例如 RDF/XML、Turtle、N3 和 N-Triples。

So, you've got the RDF/XML serialization of the RDF mapping of an OWL ontology.因此,您已经获得了 OWL 本体的 RDF 映射的 RDF/XML 序列化。 So it is an RDF file, because it's the serialization of an RDF graph.所以它一个 RDF 文件,因为它是一个 RDF 图的序列化。 It also makes sense to call it an OWL file, because it's an OWL ontology.将其称为 OWL 文件很有意义,因为它是一个 OWL 本体。 In fact, many of the OWL files you'll find online are RDF/XML serializations of RDF mappings of OWL ontologies.事实上,您可以在网上找到的许多 OWL 文件是 OWL 本体的 RDF 映射的 RDF/XML 序列化。

Examples例子

Your OWL ontology can be written in a number of ways.您的 OWL 本体可以用多种方式编写。 For instance, in the functional syntax :例如,在函数语法中

Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(:=<http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)

Ontology(<http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13>

Declaration(Class(:Student))
Declaration(Class(:University))
)

In the OWL/XML serialization:在 OWL/XML 序列化中:

<?xml version="1.0"?>
<!DOCTYPE Ontology [
    <!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
    <!ENTITY xml "http://www.w3.org/XML/1998/namespace" >
    <!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
    <!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
]>
<Ontology xmlns="http://www.w3.org/2002/07/owl#"
     xml:base="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13"
     xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
     xmlns:xml="http://www.w3.org/XML/1998/namespace"
     ontologyIRI="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13">
    <Prefix name="xsd" IRI="http://www.w3.org/2001/XMLSchema#"/>
    <Prefix name="owl" IRI="http://www.w3.org/2002/07/owl#"/>
    <Prefix name="" IRI="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#"/>
    <Prefix name="rdf" IRI="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <Prefix name="rdfs" IRI="http://www.w3.org/2000/01/rdf-schema#"/>
    <Declaration>
        <Class IRI="#Student"/>
    </Declaration>
    <Declaration>
        <Class IRI="#University"/>
    </Declaration>
</Ontology>
<!-- Generated by the OWL API (version 3.2.5.1912) http://owlapi.sourceforge.net -->

These are different serializations of the same OWL ontology.这些是相同OWL 本体的不同序列化 Because they're serializations of an OWL ontology, it makes sense to call them OWL files.因为它们是 OWL 本体的序列化,所以将它们称为 OWL 文件是有意义的。

One more way to serialize an OWL ontology is an RDF Graph.序列化 OWL 本体的另一种方法是 RDF 图。 An RDF graph is an abstract thing though;然而,RDF 图是一个抽象的东西; it's just a set of triples.它只是一组三元组。 OWL 2 Web Ontology Language Mapping to RDF Graphs (Second Edition) describes the RDF mapping of OWL ontologies. OWL 2 Web Ontology Language Mapping to RDF Graphs(第二版)描述了 OWL 本体的 RDF 映射。 So from the OWL ontology, you can generate a set of RDF triples, ie, an RDF graph.所以从OWL本体,可以生成一组RDF三元组,即一个RDF图。 An RDF graph can be written in a number of different formats, too, though.不过,RDF 图也可以用多种不同的格式编写。 Here's the RDF Graph for your OWL ontology in a few different RDF serializations.下面是您的 OWL 本体的 RDF 图表,包含几个不同的 RDF 序列化。 All of the following are the same RDF graph.以下所有都是相同的RDF 图。 SInce all of these are RDF serializations, it makes sense to call of them RDF files.由于所有这些都是 RDF 序列化,因此将它们称为 RDF 文件是有意义的。 Since they're RDF encodings of an OWL ontology, it also makes sense to call them OWL files.由于它们是 OWL 本体的 RDF 编码,因此将它们称为 OWL 文件也很有意义。

In the Turtle RDF serialization:在 Turtle RDF 序列化中:

@prefix :      <http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#> .
@prefix owl:   <http://www.w3.org/2002/07/owl#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd:   <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .

<http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13>
        a       owl:Ontology .

:University  a  owl:Class .

:Student  a     owl:Class .

In the N-Triples serialization (one triple per line):在 N-Triples 序列化中(每行一个三元组):

<http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Ontology> .
<http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#University> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .
<http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#Student> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://www.w3.org/2002/07/owl#Class> .

In RDF/XML with no "shortcuts":在没有“快捷方式”的 RDF/XML 中:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#" > 
  <rdf:Description rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Ontology"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#University">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#Student">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#Class"/>
  </rdf:Description>
</rdf:RDF>

In RDF/XML using some of the shortcuts:在 RDF/XML 中使用一些快捷方式:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema#">
  <owl:Ontology rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13"/>
  <owl:Class rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#University"/>
  <owl:Class rdf:about="http://www.semanticweb.org/q49f318b/ontologies/2014/5/untitled-ontology-13#Student"/>
</rdf:RDF>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM