Skip to content

Commit

Permalink
Rigorously define equals for Quad.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubenVerborgh committed Jan 22, 2019
1 parent 279e81f commit afaaed8
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions interface-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,20 @@ <h3><dfn>Quad</dfn> interface</h3>
<code>NamedNode</code>, <code>BlankNode</code> or <code>Variable</code>.
</p>
<p>
<dfn>equals()</dfn> returns <code>true</code> if and only if the argument is a) of the same
type b) has all components equal.
<dfn id="quad-equals">equals()</dfn> returns <code>true</code>
when called with parameter <code>other</code>
on an object <code>quad</code> if and only if
all of the conditions below hold:
</p>
<ul>
<li><code>other</code> is <em>neither</em> <code>null</code> nor <code>undefined</code>;</li>
<li><code>quad.subject.equals(other.subject)</code> evaluates to <code>true</code>;</li>
<li><code>quad.predicate.equals(other.predicate)</code> evaluates to <code>true</code>;</li>
<li><code>quad.object.equals(other.object)</code> evaluates to a <code>true</code>;</li>
<li><code>quad.graph.equals(other.graph)</code> evaluates to a <code>true</code>;</li>
</ul>
<p>
otherwise, it returns <code>false</code>.
</p>
</section>

Expand Down

0 comments on commit afaaed8

Please sign in to comment.