0

ブランク ノードへのドメイン制限を示す支援のリクエスト。 図 1: 空白ノードを使用した多対多の関係のモデル化。空白ノードを使用した多対多 (リレーショナル) テーブルのモデル化

ビジネス ルール: 登録は、1 人の生徒を 1 つのセクションに一度だけマップします。

私の試み:

∃hasStudent.⊤ ≡ ∃hasSection.⊤ ≡ ∃grade_code.⊤ 

i.e. "the set of individuals that have some value for the role 'hasStudent' is the same set of individuals that have some value for the role 'hasSection' ...e.t.c."

包含は両方向にあるため、ここでは包含ではなく同等であると想定しています。

さらに制限する:

∃hasStudent.⊤ ≡ ∃hasSection.⊤ ≡ ∃grade_code.⊤ ≡ =1hasStudent.⊤ ≡ =1hasSection.⊤ ≡ =1grade_code.⊤

i.e. "the set of individuals that have values for the roles 'hasStudent', 'hasSection' and 'grade_code', have one and only one value for them."

図 1 のオブジェクト プロパティのドメイン制限を正しく示すための支援またはコメントをいただければ幸いです。

ありがとう!!

4

2 に答える 2

2

OWL の Open World の仮定により、「'hasStudent'、'hasSection'、および 'grade_code' のロールの値を持つ個人のセットが、1 つの値しか持たない」ことを見つけることができなくなります。

ただし、SPARQL を使用すると、求めていることだけを実行する ASK クエリを作成できます。

ASK {
   SELECT (count(?student) AS ?stcount) (count(?section) AS ?secount) (count(?course) AS ?ccount)
   WHERE {
      ?indiv :hasStudent ?student .
      ?indiv :hasSection ?section .
      ?indiv :grade_course ?course .
   } GROUP BY ?student ?section ?course
   HAVING (stcount = 1 && ?secount = 1 && ?ccount = 1)
}

集計は SELECT ステートメントで計算する必要があるため、構文的に少しおかしくなりました。ASK は、「制約」(HAVING 句を参照) がすべて true の場合に true を返し、それ以外の場合は false を返します。

今後の参考として、W3C でのSHACL (RDF Shapes Constraint Language)の作業は、OWL では解決できないこの種の制約違反の問題を補強することを目的としています。

于 2016-02-14T21:04:39.630 に答える