Skip to content

Commit b8b739d

Browse files
authored
Merge pull request #160 from w3c/Issue157
Unifies definitions of graph isomorphism and dataset isomorphism (alternative proposal)
2 parents 536b67e + c62aff1 commit b8b739d

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

spec/index.html

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -901,27 +901,30 @@ <h3>Triple Terms</h3>
901901
<section id="graph-isomorphism">
902902
<h3>Graph Comparison</h3>
903903

904-
<p id="section-graph-equality">Two
905-
<a>RDF graphs</a> <var>G</var> and <var>G'</var> are
906-
<dfn data-lt="graph isomorphism|isomorphic" data-lt-noDefault class="export">isomorphic</dfn>
907-
(that is, they have an identical form)
908-
if there is a bijection <var>M</var>
909-
from the set of all <a>RDF terms</a> into that same set,
910-
such that all of the following properties hold:</p>
911-
912-
<ul>
913-
<li><var>M</var> maps blank nodes to blank nodes.</li>
914-
<li><var>M</var>(<var>lit</var>)=<var>lit</var> for every <a>RDF literal</a> <var>lit</var>.</li>
915-
916-
<li><var>M</var>(<var>iri</var>)=<var>iri</var> for every <a>IRI</a> <var>iri</var>.</li>
904+
<p>This section introduces a notion of graph isomorphism for [=RDF graphs=]
905+
which is based on a mapping between [=RDF terms=]
906+
that maps blank nodes to blank nodes
907+
and is the identity function for IRIs and literals.</p>
917908

918-
<li><var>M</var>(<var>tt</var>) is the triple term ( <var>M</var>(<var>s</var>), <var>M</var>(<var>p</var>), <var>M</var>(<var>o</var>) ) if <var>tt</var> is a triple term of the form ( <var>s</var>, <var>p</var>, <var>o</var> ).</li>
909+
<p>A function |M| from the set of all [=RDF terms=] into that same set
910+
is called an <dfn>isomorphic RDF-term mapping</dfn>
911+
if it is has all of the following properties:</p>
919912

920-
<li>The triple ( <var>s</var>, <var>p</var>, <var>o</var> ) is in <var>G</var> if and
921-
only if the triple ( <var>M</var>(<var>s</var>), <var>M</var>(<var>p</var>), <var>M</var>(<var>o</var>) ) is in
922-
<var>G'</var>.</li>
913+
<ul>
914+
<li>|M| is bijective.</li>
915+
<li>For every [=blank node=] |b|, |M|(|b|) is a [=blank node=] (but not necessarily the same as |b|).</li>
916+
<li>For every [=literal=] |lit|, |M|(|lit|) = |lit|.</li>
917+
<li>For every [=IRI=] |iri|, |M|(|iri|) = |iri|.</li>
918+
<li>For every [=triple term=] |tt| of the form (|s|, |p|, |o|), |M|(|tt|) is the triple term ( |M|(|s|), |M|(|p|), |M|(|o|) ).</li>
923919
</ul>
924920

921+
<p id="section-graph-equality">Two [=RDF graphs=] |G| and <var>G'</var> are
922+
<dfn data-lt="graph isomorphism|isomorphic" data-lt-noDefault class="export">isomorphic</dfn>
923+
(that is, they have the same form)
924+
if there exists an [=isomorphic RDF-term mapping=] |M| such that
925+
the triple (|s|, |p|, |o|) is in |G| if and only if
926+
the triple ( |M|(|s|), |M|(|p|), |M|(|o|) ) is in <var>G'</var>.</p>
927+
925928
<p>See also: <a>IRI equality</a>, <a>literal term equality</a>.</p>
926929

927930
<p>With this definition, <var>M</var> shows how each blank node
@@ -1050,24 +1053,20 @@ <h2>RDF Datasets</h2>
10501053
<section id="section-dataset-isomorphism">
10511054
<h3>RDF Dataset Comparison</h3>
10521055

1053-
<p id="section-dataset-equality">Two <a>RDF datasets</a>
1054-
(the RDF dataset <var>D1</var> with default graph <var>DG1</var> and any named
1055-
graph <var>NG1</var> and the RDF dataset <var>D2</var> with default graph
1056-
<var>DG2</var> and any named graph <var>NG2</var>)
1056+
<p id="section-dataset-equality">Two <a>RDF datasets</a> |D1| and |D2|
1057+
(respectively, with [=default graphs=] |DG1| and |DG2| and sets |NG1| and |NG2| of [=named graphs=])
10571058
are <dfn data-lt="dataset isomorphism" class="export">dataset-isomorphic</dfn> if and only if
1058-
there is a bijection <var>M</var> between the nodes, triples and graphs in
1059-
<var>D1</var> and those in <var>D2</var> such that all of the following properties hold:</p>
1059+
there exists an [=isomorphic RDF-term mapping=] |M|
1060+
for which all of the following properties hold:</p>
10601061

10611062
<ul>
1062-
<li><var>M</var> maps <a>blank nodes</a> to blank nodes;</li>
1063-
<li><var>M</var> is the identity map on <a>literals</a> and URIs;</li>
1064-
<li>For every triple &lt;s p o&gt;, <var>M</var>(&lt;s, p, o&gt;)=
1065-
&lt;<var>M(s)</var>, <var>M(p)</var>, <var>M(o)</var>&gt;;</li>
1066-
<li>For every graph <var>G</var>={t1, ..., tn},
1067-
<var>M(G)</var>={<var>M(t1)</var>, ..., <var>M(tn)</var>};</li>
1068-
<li><var>DG2</var> = <var>M(DG1)</var>; and</li>
1069-
<li>&lt;n, G&gt; is in <var>NG1</var> if and only if
1070-
&lt;<var>M(n)</var>, <var>M(G)</var>&gt; is in <var>NG2</var>.
1063+
<li>The triple (|s|, |p|, |o|) is in |DG1| if and only if
1064+
the triple ( |M|(|s|), |M|(|p|), |M|(|o|) ) is in |DG2|.</li>
1065+
<li>The [=named graph=] (|n|, |G|) is in |NG1| if and only if
1066+
there is a [=named graph=] (<var>n'</var>, <var>G'</var>) in |NG2| such that
1067+
|M|(|n|) = <var>n'</var> and
1068+
the triple (|s|, |p|, |o|) is in |G| if and only if
1069+
the triple ( |M|(|s|), |M|(|p|), |M|(|o|) ) is in <var>G'</var>.</li>
10711070
</ul>
10721071

10731072
</section>

0 commit comments

Comments
 (0)