2

名前が付けられたオブジェクトプロパティがemployありemployedBy、それらは互いに逆になっています。これらのプロパティをインスタンスに与える方法は? 私のemploy財産:

<owl:ObjectProperty rdf:ID="employ">
  <rdf:type rdf:resource="http://rdf.pozitron.com/organizations/" />
  <rdfs:domain rdf:resource="http://rdf.pozitron.com/organizations/"/>
  <rdfs:range rdf:resource="http://rdf.pozitron.com/people/"/>
</owl:ObjectProperty>

私のemployedBy財産:

<owl:ObjectProperty rdf:ID="employedBy">
  <rdf:type rdf:resource="http://rdf.pozitron.com/people/" />
  <owl:inverseOf rdf:resource="#Employ" />
  <rdfs:domain rdf:resource="http://rdf.pozitron.com/people/"/>
  <rdfs:range rdf:resource="http://rdf.pozitron.com/organizations/"/>
</owl:ObjectProperty>

今、この例でemployはどのように説明するのですか?employedByPozitron が john を雇用しており、john が Pozitron に雇用されているとします。

<rdf:Description rdf:about="http://rdf.pozitron.com/people/john">
  <rdf:type rdf:resource="http://rdf.pozitron.com/people/"/>
  <person:personName>John</person:personName>
  <organization:organizationName>Pozitron</organization:organizationName>
</rdf:Description>
4

1 に答える 1

7

RDF/XML よりも、Turtle のような構文で RDF を作成する方がはるかに簡単です。あなたが提供したデータは、私たちが作業するのに十分ではありません (例えば、ベース URI が定義されていません)。以下は、データを含む完全な RDF/XML ドキュメントです (ex名前空間に注意してください)。

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:person="http://rdf.pozitron.com/people/"
    xmlns:organization="http://rdf.pozitron.com/organizations/"
    xml:base="http://example.org/"
    xmlns:ex="http://example.org/#">
  <owl:ObjectProperty rdf:ID="employ">
    <rdf:type rdf:resource="http://rdf.pozitron.com/organizations/" />
    <rdfs:domain rdf:resource="http://rdf.pozitron.com/organizations/"/>
    <rdfs:range rdf:resource="http://rdf.pozitron.com/people/"/>
  </owl:ObjectProperty>
  <owl:ObjectProperty rdf:ID="employedBy">
    <rdf:type rdf:resource="http://rdf.pozitron.com/people/" />
    <owl:inverseOf rdf:resource="#Employ" />
    <rdfs:domain rdf:resource="http://rdf.pozitron.com/people/"/>
    <rdfs:range rdf:resource="http://rdf.pozitron.com/organizations/"/>
  </owl:ObjectProperty>
  <rdf:Description rdf:about="http://rdf.pozitron.com/people/john">
    <rdf:type rdf:resource="http://rdf.pozitron.com/people/"/>
    <person:personName>John</person:personName>
    <organization:organizationName>Pozitron</organization:organizationName>
  </rdf:Description>
</rdf:RDF>

Turtle では次のようになり、いくつかの問題が明らかになりました。

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex:      <http://example.org/#> .
@prefix person:  <http://rdf.pozitron.com/people/> .
@prefix organization:  <http://rdf.pozitron.com/organizations/> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

ex:employedBy
      a       person: , owl:ObjectProperty ;
      rdfs:domain person: ;
      rdfs:range organization: ;
      owl:inverseOf ex:Employ .

person:john
      a       person: ;
      organization:organizationName
              "Pozitron" ;
      person:personName "John" .

ex:employ
      a       owl:ObjectProperty , organization: ;
      rdfs:domain organization: ;
      rdfs:range person: .

ここでの問題は次のとおりです。

  • employedByの逆は ですがEmploy、その名前のプロパティはありませんemploy
  • プロパティemployorganization
  • プロパティemployedByperson
  • john持っていますorganizationName
  • 組織はありませんPozitron

これらは、この構文で簡単に修正できます。これを行っている間にトリプルを追加することもできjohn employedBy Pozitronます。Pozitron employ john最終的には次のようになります。

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex:      <http://example.org/#> .
@prefix person:  <http://rdf.pozitron.com/people/> .
@prefix organization:  <http://rdf.pozitron.com/organizations/> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .

ex:employedBy
      a       owl:ObjectProperty ;
      rdfs:domain person: ;
      rdfs:range organization: ;
      owl:inverseOf ex:employ .

organization:Pozitron
      a       organization: ;
      organization:organizationName
              "Pozitron" ;
      ex:employ person:john .

person:john
      a       person: ;
      person:personName "John" ;
      ex:employedBy organization:Pozitron .

ex:employ
      a       owl:ObjectProperty ;
      rdfs:domain organization: ;
      rdfs:range person: .

RDF/XML でこれがどのように見えるかは、元に戻すことで確認できます。

<rdf:RDF
    xmlns:ex="http://example.org/#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:person="http://rdf.pozitron.com/people/"
    xmlns:organization="http://rdf.pozitron.com/organizations/"
    xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" > 
  <rdf:Description rdf:about="http://example.org/#employedBy">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
    <rdfs:domain rdf:resource="http://rdf.pozitron.com/people/"/>
    <rdfs:range rdf:resource="http://rdf.pozitron.com/organizations/"/>
    <owl:inverseOf rdf:resource="http://example.org/#employ"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://rdf.pozitron.com/organizations/Pozitron">
    <rdf:type rdf:resource="http://rdf.pozitron.com/organizations/"/>
    <organization:organizationName>Pozitron</organization:organizationName>
    <ex:employ rdf:resource="http://rdf.pozitron.com/people/john"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://rdf.pozitron.com/people/john">
    <rdf:type rdf:resource="http://rdf.pozitron.com/people/"/>
    <person:personName>John</person:personName>
    <ex:employedBy rdf:resource="http://rdf.pozitron.com/organizations/Pozitron"/>
  </rdf:Description>
  <rdf:Description rdf:about="http://example.org/#employ">
    <rdf:type rdf:resource="http://www.w3.org/2002/07/owl#ObjectProperty"/>
    <rdfs:domain rdf:resource="http://rdf.pozitron.com/organizations/"/>
    <rdfs:range rdf:resource="http://rdf.pozitron.com/people/"/>
  </rdf:Description>
</rdf:RDF>

逆のプロパティを処理できる OWL 推論を使用している場合は、実際には と の両方を記述する必要はありませjohn employedBy Pozitron Pozitron employ john。1 つだけを記述すれば、推論機能がもう 1 つを推論します。

于 2013-08-07T14:23:59.050 に答える