commons-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wik...@apache.org
Subject svn commit: r1022644 [19/31] - in /websites/production/commons/content/proper/commons-rdf: ./ apidocs/ apidocs/org/apache/commons/rdf/api/ apidocs/org/apache/commons/rdf/api/class-use/ apidocs/org/apache/commons/rdf/experimental/ apidocs/org/apache/com...
Date Sat, 23 Dec 2017 20:15:33 GMT
Modified: websites/production/commons/content/proper/commons-rdf/xref-test/org/apache/commons/rdf/api/AbstractDatasetTest.html
==============================================================================
--- websites/production/commons/content/proper/commons-rdf/xref-test/org/apache/commons/rdf/api/AbstractDatasetTest.html (original)
+++ websites/production/commons/content/proper/commons-rdf/xref-test/org/apache/commons/rdf/api/AbstractDatasetTest.html Sat Dec 23 20:15:28 2017
@@ -53,7 +53,7 @@
 <a class="jxr_linenumber" name="L45" href="#L45">45</a>  <em class="jxr_javadoccomment"> * &lt;p&gt;</em>
 <a class="jxr_linenumber" name="L46" href="#L46">46</a>  <em class="jxr_javadoccomment"> * This test uses try-with-resources blocks for calls to {@link Dataset#stream()}</em>
 <a class="jxr_linenumber" name="L47" href="#L47">47</a>  <em class="jxr_javadoccomment"> * and {@link Dataset#iterate()}.</em>
-<a class="jxr_linenumber" name="L48" href="#L48">48</a>  <em class="jxr_javadoccomment"> * </em>
+<a class="jxr_linenumber" name="L48" href="#L48">48</a>  <em class="jxr_javadoccomment"> *</em>
 <a class="jxr_linenumber" name="L49" href="#L49">49</a>  <em class="jxr_javadoccomment"> * @see Dataset</em>
 <a class="jxr_linenumber" name="L50" href="#L50">50</a>  <em class="jxr_javadoccomment"> * @see RDF</em>
 <a class="jxr_linenumber" name="L51" href="#L51">51</a>  <em class="jxr_javadoccomment"> */</em>
@@ -78,10 +78,10 @@
 <a class="jxr_linenumber" name="L70" href="#L70">70</a>      <strong class="jxr_keyword">private</strong> BlankNode graph2;
 <a class="jxr_linenumber" name="L71" href="#L71">71</a>  
 <a class="jxr_linenumber" name="L72" href="#L72">72</a>      <em class="jxr_javadoccomment">/**</em>
-<a class="jxr_linenumber" name="L73" href="#L73">73</a>  <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L73" href="#L73">73</a>  <em class="jxr_javadoccomment">     *</em>
 <a class="jxr_linenumber" name="L74" href="#L74">74</a>  <em class="jxr_javadoccomment">     * This method must be overridden by the implementing test to provide a</em>
 <a class="jxr_linenumber" name="L75" href="#L75">75</a>  <em class="jxr_javadoccomment">     * factory for the test to create {@link Dataset}, {@link IRI} etc.</em>
-<a class="jxr_linenumber" name="L76" href="#L76">76</a>  <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L76" href="#L76">76</a>  <em class="jxr_javadoccomment">     *</em>
 <a class="jxr_linenumber" name="L77" href="#L77">77</a>  <em class="jxr_javadoccomment">     * @return {@link RDF} instance to be tested.</em>
 <a class="jxr_linenumber" name="L78" href="#L78">78</a>  <em class="jxr_javadoccomment">     */</em>
 <a class="jxr_linenumber" name="L79" href="#L79">79</a>      <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">abstract</strong> RDF createFactory();
@@ -94,7 +94,7 @@
 <a class="jxr_linenumber" name="L86" href="#L86">86</a>  
 <a class="jxr_linenumber" name="L87" href="#L87">87</a>          graph1 = factory.createIRI(<span class="jxr_string">"http://example.com/graph1"</span>);
 <a class="jxr_linenumber" name="L88" href="#L88">88</a>          graph2 = factory.createBlankNode();
-<a class="jxr_linenumber" name="L89" href="#L89">89</a>          
+<a class="jxr_linenumber" name="L89" href="#L89">89</a>  
 <a class="jxr_linenumber" name="L90" href="#L90">90</a>          alice = factory.createIRI(<span class="jxr_string">"http://example.com/alice"</span>);
 <a class="jxr_linenumber" name="L91" href="#L91">91</a>          bob = factory.createIRI(<span class="jxr_string">"http://example.com/bob"</span>);
 <a class="jxr_linenumber" name="L92" href="#L92">92</a>          name = factory.createIRI(<span class="jxr_string">"http://xmlns.com/foaf/0.1/name"</span>);
@@ -121,13 +121,13 @@
 <a class="jxr_linenumber" name="L113" href="#L113">113</a>         <em class="jxr_comment">// NOTE: bnode1 used in both graph1 and graph2</em>
 <a class="jxr_linenumber" name="L114" href="#L114">114</a>         dataset.add(graph1, bnode1, name, secretClubName);
 <a class="jxr_linenumber" name="L115" href="#L115">115</a>         dataset.add(graph2, bnode2, name, companyName);
-<a class="jxr_linenumber" name="L116" href="#L116">116</a>         
-<a class="jxr_linenumber" name="L117" href="#L117">117</a>         <em class="jxr_comment">// default graph describes graph1 and graph2        </em>
+<a class="jxr_linenumber" name="L116" href="#L116">116</a> 
+<a class="jxr_linenumber" name="L117" href="#L117">117</a>         <em class="jxr_comment">// default graph describes graph1 and graph2</em>
 <a class="jxr_linenumber" name="L118" href="#L118">118</a>         isPrimaryTopicOf = factory.createIRI(<span class="jxr_string">"http://xmlns.com/foaf/0.1/isPrimaryTopicOf"</span>);
 <a class="jxr_linenumber" name="L119" href="#L119">119</a>         dataset.add(<strong class="jxr_keyword">null</strong>, alice, isPrimaryTopicOf, graph1);
 <a class="jxr_linenumber" name="L120" href="#L120">120</a>         dataset.add(<strong class="jxr_keyword">null</strong>, bob, isPrimaryTopicOf, graph2);
-<a class="jxr_linenumber" name="L121" href="#L121">121</a>         
-<a class="jxr_linenumber" name="L122" href="#L122">122</a>         
+<a class="jxr_linenumber" name="L121" href="#L121">121</a> 
+<a class="jxr_linenumber" name="L122" href="#L122">122</a> 
 <a class="jxr_linenumber" name="L123" href="#L123">123</a>     }
 <a class="jxr_linenumber" name="L124" href="#L124">124</a> 
 <a class="jxr_linenumber" name="L125" href="#L125">125</a>     @Test
@@ -143,10 +143,10 @@
 <a class="jxr_linenumber" name="L135" href="#L135">135</a>             quads.add(t);
 <a class="jxr_linenumber" name="L136" href="#L136">136</a>         }
 <a class="jxr_linenumber" name="L137" href="#L137">137</a>         assertEquals(dataset.size(), quads.size());
-<a class="jxr_linenumber" name="L138" href="#L138">138</a>         
+<a class="jxr_linenumber" name="L138" href="#L138">138</a> 
 <a class="jxr_linenumber" name="L139" href="#L139">139</a>         <em class="jxr_comment">//assertTrue(quads.contains(bobNameQuad));</em>
-<a class="jxr_linenumber" name="L140" href="#L140">140</a>         <em class="jxr_comment">// java.util.List won't do any BlankNode mapping, so </em>
-<a class="jxr_linenumber" name="L141" href="#L141">141</a>         <em class="jxr_comment">// instead bobNameQuad of let's check for an IRI-centric quad </em>
+<a class="jxr_linenumber" name="L140" href="#L140">140</a>         <em class="jxr_comment">// java.util.List won't do any BlankNode mapping, so</em>
+<a class="jxr_linenumber" name="L141" href="#L141">141</a>         <em class="jxr_comment">// instead bobNameQuad of let's check for an IRI-centric quad</em>
 <a class="jxr_linenumber" name="L142" href="#L142">142</a>         <strong class="jxr_keyword">final</strong> Quad q = factory.createQuad(graph1, alice, name, aliceName);
 <a class="jxr_linenumber" name="L143" href="#L143">143</a>         quads.contains(q);
 <a class="jxr_linenumber" name="L144" href="#L144">144</a> 
@@ -167,24 +167,24 @@
 <a class="jxr_linenumber" name="L159" href="#L159">159</a>             count++;
 <a class="jxr_linenumber" name="L160" href="#L160">160</a>         }
 <a class="jxr_linenumber" name="L161" href="#L161">161</a>         assertEquals(dataset.size(), count);
-<a class="jxr_linenumber" name="L162" href="#L162">162</a>         
+<a class="jxr_linenumber" name="L162" href="#L162">162</a> 
 <a class="jxr_linenumber" name="L163" href="#L163">163</a>         <em class="jxr_comment">// Pattern iteration which should cover multiple graphs.</em>
-<a class="jxr_linenumber" name="L164" href="#L164">164</a>         
-<a class="jxr_linenumber" name="L165" href="#L165">165</a>         Set&lt;Quad&gt; aliceQuads = <strong class="jxr_keyword">new</strong> HashSet&lt;&gt;();
-<a class="jxr_linenumber" name="L166" href="#L166">166</a>         <strong class="jxr_keyword">for</strong> (Quad aliceQ : dataset.iterate(<strong class="jxr_keyword">null</strong>, alice, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>)) { 
+<a class="jxr_linenumber" name="L164" href="#L164">164</a> 
+<a class="jxr_linenumber" name="L165" href="#L165">165</a>         <strong class="jxr_keyword">final</strong> Set&lt;Quad&gt; aliceQuads = <strong class="jxr_keyword">new</strong> HashSet&lt;&gt;();
+<a class="jxr_linenumber" name="L166" href="#L166">166</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">final</strong> Quad aliceQ : dataset.iterate(<strong class="jxr_keyword">null</strong>, alice, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>)) {
 <a class="jxr_linenumber" name="L167" href="#L167">167</a>             aliceQuads.add(aliceQ);
 <a class="jxr_linenumber" name="L168" href="#L168">168</a>         }
 <a class="jxr_linenumber" name="L169" href="#L169">169</a>         assertTrue(aliceQuads.contains(factory.createQuad(graph1, alice, name, aliceName)));
 <a class="jxr_linenumber" name="L170" href="#L170">170</a>         assertTrue(aliceQuads.contains(factory.createQuad(graph1, alice, knows, bob)));
-<a class="jxr_linenumber" name="L171" href="#L171">171</a>         <em class="jxr_comment">// We can't test this by Quad equality, as bnode1 might become mapped by the </em>
+<a class="jxr_linenumber" name="L171" href="#L171">171</a>         <em class="jxr_comment">// We can't test this by Quad equality, as bnode1 might become mapped by the</em>
 <a class="jxr_linenumber" name="L172" href="#L172">172</a>         <em class="jxr_comment">// dataset</em>
 <a class="jxr_linenumber" name="L173" href="#L173">173</a>         <em class="jxr_comment">//assertTrue(aliceQuads.contains(factory.createQuad(graph1, alice, member, bnode1)));</em>
 <a class="jxr_linenumber" name="L174" href="#L174">174</a>         assertTrue(aliceQuads.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, alice, isPrimaryTopicOf, graph1)));
 <a class="jxr_linenumber" name="L175" href="#L175">175</a>         assertEquals(4, aliceQuads.size());
-<a class="jxr_linenumber" name="L176" href="#L176">176</a>         
+<a class="jxr_linenumber" name="L176" href="#L176">176</a> 
 <a class="jxr_linenumber" name="L177" href="#L177">177</a>         <em class="jxr_comment">// Check the isPrimaryTopicOf statements in the default graph</em>
 <a class="jxr_linenumber" name="L178" href="#L178">178</a>         <strong class="jxr_keyword">int</strong> topics = 0;
-<a class="jxr_linenumber" name="L179" href="#L179">179</a>         <strong class="jxr_keyword">for</strong> (Quad topic : dataset.iterate(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>)) {
+<a class="jxr_linenumber" name="L179" href="#L179">179</a>         <strong class="jxr_keyword">for</strong> (<strong class="jxr_keyword">final</strong> Quad topic : dataset.iterate(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>)) {
 <a class="jxr_linenumber" name="L180" href="#L180">180</a>             topics++;
 <a class="jxr_linenumber" name="L181" href="#L181">181</a>             <em class="jxr_comment">// COMMONSRDF-55: should not be &lt;urn:x-arq:defaultgraph&gt; or similar</em>
 <a class="jxr_linenumber" name="L182" href="#L182">182</a>             assertFalse(topic.getGraphName().isPresent());
@@ -195,7 +195,7 @@
 <a class="jxr_linenumber" name="L187" href="#L187">187</a>     @Test
 <a class="jxr_linenumber" name="L188" href="#L188">188</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> streamDefaultGraphNameAlice() <strong class="jxr_keyword">throws</strong> Exception {
 <a class="jxr_linenumber" name="L189" href="#L189">189</a>         <em class="jxr_comment">// null below would match in ANY graph (including default graph)</em>
-<a class="jxr_linenumber" name="L190" href="#L190">190</a>         Optional&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; aliceTopic = dataset.stream(<strong class="jxr_keyword">null</strong>, alice, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>).findAny();
+<a class="jxr_linenumber" name="L190" href="#L190">190</a>         <strong class="jxr_keyword">final</strong> Optional&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; aliceTopic = dataset.stream(<strong class="jxr_keyword">null</strong>, alice, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>).findAny();
 <a class="jxr_linenumber" name="L191" href="#L191">191</a>         assertTrue(aliceTopic.isPresent());
 <a class="jxr_linenumber" name="L192" href="#L192">192</a>         <em class="jxr_comment">// COMMONSRDF-55: should not be &lt;urn:x-arq:defaultgraph&gt; or similar</em>
 <a class="jxr_linenumber" name="L193" href="#L193">193</a>         assertNull(aliceTopic.get().getGraphName().orElse(<strong class="jxr_keyword">null</strong>));
@@ -206,14 +206,14 @@
 <a class="jxr_linenumber" name="L198" href="#L198">198</a>     @Test
 <a class="jxr_linenumber" name="L199" href="#L199">199</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> streamDefaultGraphNameByPattern() <strong class="jxr_keyword">throws</strong> Exception {
 <a class="jxr_linenumber" name="L200" href="#L200">200</a>         <em class="jxr_comment">// Explicitly select in only the default graph Optional.empty()</em>
-<a class="jxr_linenumber" name="L201" href="#L201">201</a>         Optional&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; aliceTopic = dataset.stream(Optional.empty(), <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>).findAny();
+<a class="jxr_linenumber" name="L201" href="#L201">201</a>         <strong class="jxr_keyword">final</strong> Optional&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; aliceTopic = dataset.stream(Optional.empty(), <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>).findAny();
 <a class="jxr_linenumber" name="L202" href="#L202">202</a>         assertTrue(aliceTopic.isPresent());
 <a class="jxr_linenumber" name="L203" href="#L203">203</a>         <em class="jxr_comment">// COMMONSRDF-55: should not be &lt;urn:x-arq:defaultgraph&gt; or similar</em>
 <a class="jxr_linenumber" name="L204" href="#L204">204</a>         assertNull(aliceTopic.get().getGraphName().orElse(<strong class="jxr_keyword">null</strong>));
 <a class="jxr_linenumber" name="L205" href="#L205">205</a>         assertFalse(aliceTopic.get().getGraphName().isPresent());
 <a class="jxr_linenumber" name="L206" href="#L206">206</a>     }
-<a class="jxr_linenumber" name="L207" href="#L207">207</a>     
-<a class="jxr_linenumber" name="L208" href="#L208">208</a>     
+<a class="jxr_linenumber" name="L207" href="#L207">207</a> 
+<a class="jxr_linenumber" name="L208" href="#L208">208</a> 
 <a class="jxr_linenumber" name="L209" href="#L209">209</a>     <em class="jxr_javadoccomment">/**</em>
 <a class="jxr_linenumber" name="L210" href="#L210">210</a> <em class="jxr_javadoccomment">     * Special quad closing for RDF4J.</em>
 <a class="jxr_linenumber" name="L211" href="#L211">211</a> <em class="jxr_javadoccomment">     */</em>
@@ -352,70 +352,70 @@
 <a class="jxr_linenumber" name="L344" href="#L344">344</a>     }
 <a class="jxr_linenumber" name="L345" href="#L345">345</a> 
 <a class="jxr_linenumber" name="L346" href="#L346">346</a>     @Test
-<a class="jxr_linenumber" name="L347" href="#L347">347</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addBlankNodesFromMultipleDatasets() {
-<a class="jxr_linenumber" name="L348" href="#L348">348</a>             <em class="jxr_comment">// Create two separate Dataset instances</em>
-<a class="jxr_linenumber" name="L349" href="#L349">349</a>             <strong class="jxr_keyword">final</strong> Dataset g1 = createDataset1();
-<a class="jxr_linenumber" name="L350" href="#L350">350</a>             <strong class="jxr_keyword">final</strong> Dataset g2 = createDataset2();
-<a class="jxr_linenumber" name="L351" href="#L351">351</a> 
-<a class="jxr_linenumber" name="L352" href="#L352">352</a>             <em class="jxr_comment">// and add them to a new Dataset g3</em>
-<a class="jxr_linenumber" name="L353" href="#L353">353</a>             <strong class="jxr_keyword">final</strong> Dataset g3 = factory.createDataset();
-<a class="jxr_linenumber" name="L354" href="#L354">354</a>             addAllQuads(g1, g3);
-<a class="jxr_linenumber" name="L355" href="#L355">355</a>             addAllQuads(g2, g3);
-<a class="jxr_linenumber" name="L356" href="#L356">356</a> 
-<a class="jxr_linenumber" name="L357" href="#L357">357</a>             <em class="jxr_comment">// Let's make a map to find all those blank nodes after insertion</em>
-<a class="jxr_linenumber" name="L358" href="#L358">358</a>             <em class="jxr_comment">// (The Dataset implementation is not currently required to</em>
-<a class="jxr_linenumber" name="L359" href="#L359">359</a>             <em class="jxr_comment">// keep supporting those BlankNodes with contains() - see</em>
-<a class="jxr_linenumber" name="L360" href="#L360">360</a>             <em class="jxr_comment">// COMMONSRDF-15)</em>
-<a class="jxr_linenumber" name="L361" href="#L361">361</a> 
-<a class="jxr_linenumber" name="L362" href="#L362">362</a>             <strong class="jxr_keyword">final</strong> Map&lt;String, BlankNodeOrIRI&gt; whoIsWho = <strong class="jxr_keyword">new</strong> ConcurrentHashMap&lt;&gt;();
-<a class="jxr_linenumber" name="L363" href="#L363">363</a>             <em class="jxr_comment">// ConcurrentHashMap as we will try parallel forEach below,</em>
-<a class="jxr_linenumber" name="L364" href="#L364">364</a>             <em class="jxr_comment">// which should not give inconsistent results (it does with a</em>
-<a class="jxr_linenumber" name="L365" href="#L365">365</a>             <em class="jxr_comment">// HashMap!)</em>
-<a class="jxr_linenumber" name="L366" href="#L366">366</a> 
-<a class="jxr_linenumber" name="L367" href="#L367">367</a>             <em class="jxr_comment">// look up BlankNodes by name</em>
-<a class="jxr_linenumber" name="L368" href="#L368">368</a>             <strong class="jxr_keyword">final</strong> IRI name = factory.createIRI(<span class="jxr_string">"http://xmlns.com/foaf/0.1/name"</span>);
-<a class="jxr_linenumber" name="L369" href="#L369">369</a>             <strong class="jxr_keyword">try</strong> (Stream&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; stream = g3.stream(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, name, <strong class="jxr_keyword">null</strong>)) {
-<a class="jxr_linenumber" name="L370" href="#L370">370</a>                 stream.parallel().forEach(t -&gt; whoIsWho.put(t.getObject().ntriplesString(), t.getSubject()));
-<a class="jxr_linenumber" name="L371" href="#L371">371</a>             }
-<a class="jxr_linenumber" name="L372" href="#L372">372</a> 
-<a class="jxr_linenumber" name="L373" href="#L373">373</a>             assertEquals(4, whoIsWho.size());
-<a class="jxr_linenumber" name="L374" href="#L374">374</a>             <em class="jxr_comment">// and contains 4 unique values</em>
-<a class="jxr_linenumber" name="L375" href="#L375">375</a>             assertEquals(4, <strong class="jxr_keyword">new</strong> HashSet&lt;&gt;(whoIsWho.values()).size());
-<a class="jxr_linenumber" name="L376" href="#L376">376</a> 
-<a class="jxr_linenumber" name="L377" href="#L377">377</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b1Alice = whoIsWho.get(<span class="jxr_string">"\&quot;Alice\&quot;"</span>);
-<a class="jxr_linenumber" name="L378" href="#L378">378</a>             assertNotNull(b1Alice);
-<a class="jxr_linenumber" name="L379" href="#L379">379</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b2Bob = whoIsWho.get(<span class="jxr_string">"\&quot;Bob\&quot;"</span>);
-<a class="jxr_linenumber" name="L380" href="#L380">380</a>             assertNotNull(b2Bob);
-<a class="jxr_linenumber" name="L381" href="#L381">381</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b1Charlie = whoIsWho.get(<span class="jxr_string">"\&quot;Charlie\&quot;"</span>);
-<a class="jxr_linenumber" name="L382" href="#L382">382</a>             assertNotNull(b1Charlie);
-<a class="jxr_linenumber" name="L383" href="#L383">383</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b2Dave = whoIsWho.get(<span class="jxr_string">"\&quot;Dave\&quot;"</span>);
-<a class="jxr_linenumber" name="L384" href="#L384">384</a>             assertNotNull(b2Dave);
-<a class="jxr_linenumber" name="L385" href="#L385">385</a> 
-<a class="jxr_linenumber" name="L386" href="#L386">386</a>             <em class="jxr_comment">// All blank nodes should differ</em>
-<a class="jxr_linenumber" name="L387" href="#L387">387</a>             notEquals(b1Alice, b2Bob);
-<a class="jxr_linenumber" name="L388" href="#L388">388</a>             notEquals(b1Alice, b1Charlie);
-<a class="jxr_linenumber" name="L389" href="#L389">389</a>             notEquals(b1Alice, b2Dave);
-<a class="jxr_linenumber" name="L390" href="#L390">390</a>             notEquals(b2Bob, b1Charlie);
-<a class="jxr_linenumber" name="L391" href="#L391">391</a>             notEquals(b2Bob, b2Dave);
-<a class="jxr_linenumber" name="L392" href="#L392">392</a>             notEquals(b1Charlie, b2Dave);
-<a class="jxr_linenumber" name="L393" href="#L393">393</a> 
-<a class="jxr_linenumber" name="L394" href="#L394">394</a>             <em class="jxr_comment">// And we should be able to query with them again</em>
-<a class="jxr_linenumber" name="L395" href="#L395">395</a>             <em class="jxr_comment">// as we got them back from g3</em>
-<a class="jxr_linenumber" name="L396" href="#L396">396</a>             <strong class="jxr_keyword">final</strong> IRI hasChild = factory.createIRI(<span class="jxr_string">"http://example.com/hasChild"</span>);
-<a class="jxr_linenumber" name="L397" href="#L397">397</a>             <em class="jxr_comment">// FIXME: Check graph2 BlankNode in these ..?</em>
-<a class="jxr_linenumber" name="L398" href="#L398">398</a>             assertTrue(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b2Bob));
-<a class="jxr_linenumber" name="L399" href="#L399">399</a>             assertTrue(g3.contains(<strong class="jxr_keyword">null</strong>, b2Dave, hasChild, b1Charlie));
-<a class="jxr_linenumber" name="L400" href="#L400">400</a>             <em class="jxr_comment">// But not</em>
-<a class="jxr_linenumber" name="L401" href="#L401">401</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b1Alice));
-<a class="jxr_linenumber" name="L402" href="#L402">402</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b1Charlie));
-<a class="jxr_linenumber" name="L403" href="#L403">403</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b2Dave));
-<a class="jxr_linenumber" name="L404" href="#L404">404</a>             <em class="jxr_comment">// nor</em>
+<a class="jxr_linenumber" name="L347" href="#L347">347</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> addBlankNodesFromMultipleDatasets() <strong class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L348" href="#L348">348</a>         <em class="jxr_comment">// Create two separate Dataset instances</em>
+<a class="jxr_linenumber" name="L349" href="#L349">349</a>         <strong class="jxr_keyword">try</strong> (<strong class="jxr_keyword">final</strong> Dataset g1 = createDataset1();
+<a class="jxr_linenumber" name="L350" href="#L350">350</a>                 <strong class="jxr_keyword">final</strong> Dataset g2 = createDataset2();
+<a class="jxr_linenumber" name="L351" href="#L351">351</a>                 <strong class="jxr_keyword">final</strong> Dataset g3 = factory.createDataset()) {
+<a class="jxr_linenumber" name="L352" href="#L352">352</a> 
+<a class="jxr_linenumber" name="L353" href="#L353">353</a>             addAllQuads(g1, g3);
+<a class="jxr_linenumber" name="L354" href="#L354">354</a>             addAllQuads(g2, g3);
+<a class="jxr_linenumber" name="L355" href="#L355">355</a> 
+<a class="jxr_linenumber" name="L356" href="#L356">356</a>             <em class="jxr_comment">// Let's make a map to find all those blank nodes after insertion</em>
+<a class="jxr_linenumber" name="L357" href="#L357">357</a>             <em class="jxr_comment">// (The Dataset implementation is not currently required to</em>
+<a class="jxr_linenumber" name="L358" href="#L358">358</a>             <em class="jxr_comment">// keep supporting those BlankNodes with contains() - see</em>
+<a class="jxr_linenumber" name="L359" href="#L359">359</a>             <em class="jxr_comment">// COMMONSRDF-15)</em>
+<a class="jxr_linenumber" name="L360" href="#L360">360</a> 
+<a class="jxr_linenumber" name="L361" href="#L361">361</a>             <strong class="jxr_keyword">final</strong> Map&lt;String, BlankNodeOrIRI&gt; whoIsWho = <strong class="jxr_keyword">new</strong> ConcurrentHashMap&lt;&gt;();
+<a class="jxr_linenumber" name="L362" href="#L362">362</a>             <em class="jxr_comment">// ConcurrentHashMap as we will try parallel forEach below,</em>
+<a class="jxr_linenumber" name="L363" href="#L363">363</a>             <em class="jxr_comment">// which should not give inconsistent results (it does with a</em>
+<a class="jxr_linenumber" name="L364" href="#L364">364</a>             <em class="jxr_comment">// HashMap!)</em>
+<a class="jxr_linenumber" name="L365" href="#L365">365</a> 
+<a class="jxr_linenumber" name="L366" href="#L366">366</a>             <em class="jxr_comment">// look up BlankNodes by name</em>
+<a class="jxr_linenumber" name="L367" href="#L367">367</a>             <strong class="jxr_keyword">final</strong> IRI name = factory.createIRI(<span class="jxr_string">"http://xmlns.com/foaf/0.1/name"</span>);
+<a class="jxr_linenumber" name="L368" href="#L368">368</a>             <strong class="jxr_keyword">try</strong> (Stream&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; stream = g3.stream(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, name, <strong class="jxr_keyword">null</strong>)) {
+<a class="jxr_linenumber" name="L369" href="#L369">369</a>                 stream.parallel().forEach(t -&gt; whoIsWho.put(t.getObject().ntriplesString(), t.getSubject()));
+<a class="jxr_linenumber" name="L370" href="#L370">370</a>             }
+<a class="jxr_linenumber" name="L371" href="#L371">371</a> 
+<a class="jxr_linenumber" name="L372" href="#L372">372</a>             assertEquals(4, whoIsWho.size());
+<a class="jxr_linenumber" name="L373" href="#L373">373</a>             <em class="jxr_comment">// and contains 4 unique values</em>
+<a class="jxr_linenumber" name="L374" href="#L374">374</a>             assertEquals(4, <strong class="jxr_keyword">new</strong> HashSet&lt;&gt;(whoIsWho.values()).size());
+<a class="jxr_linenumber" name="L375" href="#L375">375</a> 
+<a class="jxr_linenumber" name="L376" href="#L376">376</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b1Alice = whoIsWho.get(<span class="jxr_string">"\&quot;Alice\&quot;"</span>);
+<a class="jxr_linenumber" name="L377" href="#L377">377</a>             assertNotNull(b1Alice);
+<a class="jxr_linenumber" name="L378" href="#L378">378</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b2Bob = whoIsWho.get(<span class="jxr_string">"\&quot;Bob\&quot;"</span>);
+<a class="jxr_linenumber" name="L379" href="#L379">379</a>             assertNotNull(b2Bob);
+<a class="jxr_linenumber" name="L380" href="#L380">380</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b1Charlie = whoIsWho.get(<span class="jxr_string">"\&quot;Charlie\&quot;"</span>);
+<a class="jxr_linenumber" name="L381" href="#L381">381</a>             assertNotNull(b1Charlie);
+<a class="jxr_linenumber" name="L382" href="#L382">382</a>             <strong class="jxr_keyword">final</strong> BlankNodeOrIRI b2Dave = whoIsWho.get(<span class="jxr_string">"\&quot;Dave\&quot;"</span>);
+<a class="jxr_linenumber" name="L383" href="#L383">383</a>             assertNotNull(b2Dave);
+<a class="jxr_linenumber" name="L384" href="#L384">384</a> 
+<a class="jxr_linenumber" name="L385" href="#L385">385</a>             <em class="jxr_comment">// All blank nodes should differ</em>
+<a class="jxr_linenumber" name="L386" href="#L386">386</a>             notEquals(b1Alice, b2Bob);
+<a class="jxr_linenumber" name="L387" href="#L387">387</a>             notEquals(b1Alice, b1Charlie);
+<a class="jxr_linenumber" name="L388" href="#L388">388</a>             notEquals(b1Alice, b2Dave);
+<a class="jxr_linenumber" name="L389" href="#L389">389</a>             notEquals(b2Bob, b1Charlie);
+<a class="jxr_linenumber" name="L390" href="#L390">390</a>             notEquals(b2Bob, b2Dave);
+<a class="jxr_linenumber" name="L391" href="#L391">391</a>             notEquals(b1Charlie, b2Dave);
+<a class="jxr_linenumber" name="L392" href="#L392">392</a> 
+<a class="jxr_linenumber" name="L393" href="#L393">393</a>             <em class="jxr_comment">// And we should be able to query with them again</em>
+<a class="jxr_linenumber" name="L394" href="#L394">394</a>             <em class="jxr_comment">// as we got them back from g3</em>
+<a class="jxr_linenumber" name="L395" href="#L395">395</a>             <strong class="jxr_keyword">final</strong> IRI hasChild = factory.createIRI(<span class="jxr_string">"http://example.com/hasChild"</span>);
+<a class="jxr_linenumber" name="L396" href="#L396">396</a>             <em class="jxr_comment">// FIXME: Check graph2 BlankNode in these ..?</em>
+<a class="jxr_linenumber" name="L397" href="#L397">397</a>             assertTrue(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b2Bob));
+<a class="jxr_linenumber" name="L398" href="#L398">398</a>             assertTrue(g3.contains(<strong class="jxr_keyword">null</strong>, b2Dave, hasChild, b1Charlie));
+<a class="jxr_linenumber" name="L399" href="#L399">399</a>             <em class="jxr_comment">// But not</em>
+<a class="jxr_linenumber" name="L400" href="#L400">400</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b1Alice));
+<a class="jxr_linenumber" name="L401" href="#L401">401</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b1Charlie));
+<a class="jxr_linenumber" name="L402" href="#L402">402</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Alice, hasChild, b2Dave));
+<a class="jxr_linenumber" name="L403" href="#L403">403</a>             <em class="jxr_comment">// nor</em>
+<a class="jxr_linenumber" name="L404" href="#L404">404</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b2Dave, hasChild, b1Alice));
 <a class="jxr_linenumber" name="L405" href="#L405">405</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b2Dave, hasChild, b1Alice));
-<a class="jxr_linenumber" name="L406" href="#L406">406</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b2Dave, hasChild, b1Alice));
-<a class="jxr_linenumber" name="L407" href="#L407">407</a> 
-<a class="jxr_linenumber" name="L408" href="#L408">408</a>             <em class="jxr_comment">// and these don't have any children (as far as we know)</em>
-<a class="jxr_linenumber" name="L409" href="#L409">409</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b2Bob, hasChild, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L410" href="#L410">410</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Charlie, hasChild, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L406" href="#L406">406</a> 
+<a class="jxr_linenumber" name="L407" href="#L407">407</a>             <em class="jxr_comment">// and these don't have any children (as far as we know)</em>
+<a class="jxr_linenumber" name="L408" href="#L408">408</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b2Bob, hasChild, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L409" href="#L409">409</a>             assertFalse(g3.contains(<strong class="jxr_keyword">null</strong>, b1Charlie, hasChild, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L410" href="#L410">410</a>         }
 <a class="jxr_linenumber" name="L411" href="#L411">411</a>     }
 <a class="jxr_linenumber" name="L412" href="#L412">412</a> 
 <a class="jxr_linenumber" name="L413" href="#L413">413</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">void</strong> notEquals(<strong class="jxr_keyword">final</strong> BlankNodeOrIRI node1, <strong class="jxr_keyword">final</strong> BlankNodeOrIRI node2) {
@@ -472,14 +472,14 @@
 <a class="jxr_linenumber" name="L464" href="#L464">464</a> <em class="jxr_javadoccomment">     * Create a different implementation of BlankNode to be tested with</em>
 <a class="jxr_linenumber" name="L465" href="#L465">465</a> <em class="jxr_javadoccomment">     * dataset.add(a,b,c); (the implementation may or may not then choose to</em>
 <a class="jxr_linenumber" name="L466" href="#L466">466</a> <em class="jxr_javadoccomment">     * translate such to its own instances)</em>
-<a class="jxr_linenumber" name="L467" href="#L467">467</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L467" href="#L467">467</a> <em class="jxr_javadoccomment">     *</em>
 <a class="jxr_linenumber" name="L468" href="#L468">468</a> <em class="jxr_javadoccomment">     * @param name</em>
 <a class="jxr_linenumber" name="L469" href="#L469">469</a> <em class="jxr_javadoccomment">     * @return</em>
 <a class="jxr_linenumber" name="L470" href="#L470">470</a> <em class="jxr_javadoccomment">     */</em>
 <a class="jxr_linenumber" name="L471" href="#L471">471</a>     <strong class="jxr_keyword">private</strong> BlankNode createOwnBlankNode(<strong class="jxr_keyword">final</strong> String name, <strong class="jxr_keyword">final</strong> String uuid) {
 <a class="jxr_linenumber" name="L472" href="#L472">472</a>         <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">new</strong> BlankNode() {
 <a class="jxr_linenumber" name="L473" href="#L473">473</a>             @Override
-<a class="jxr_linenumber" name="L474" href="#L474">474</a>             <strong class="jxr_keyword">public</strong> String ntriplesString() {                
+<a class="jxr_linenumber" name="L474" href="#L474">474</a>             <strong class="jxr_keyword">public</strong> String ntriplesString() {
 <a class="jxr_linenumber" name="L475" href="#L475">475</a>                 <strong class="jxr_keyword">return</strong> <span class="jxr_string">"_: "</span> + name;
 <a class="jxr_linenumber" name="L476" href="#L476">476</a>             }
 <a class="jxr_linenumber" name="L477" href="#L477">477</a> 
@@ -521,269 +521,272 @@
 <a class="jxr_linenumber" name="L513" href="#L513">513</a>         g2.add(b2, b2, hasChild, b1);
 <a class="jxr_linenumber" name="L514" href="#L514">514</a>         <strong class="jxr_keyword">return</strong> g2;
 <a class="jxr_linenumber" name="L515" href="#L515">515</a>     }
-<a class="jxr_linenumber" name="L516" href="#L516">516</a>     
+<a class="jxr_linenumber" name="L516" href="#L516">516</a> 
 <a class="jxr_linenumber" name="L517" href="#L517">517</a>     <em class="jxr_javadoccomment">/**</em>
 <a class="jxr_linenumber" name="L518" href="#L518">518</a> <em class="jxr_javadoccomment">     * Ensure {@link Dataset#getGraphNames()} contains our two graphs.</em>
-<a class="jxr_linenumber" name="L519" href="#L519">519</a> <em class="jxr_javadoccomment">     * </em>
+<a class="jxr_linenumber" name="L519" href="#L519">519</a> <em class="jxr_javadoccomment">     *</em>
 <a class="jxr_linenumber" name="L520" href="#L520">520</a> <em class="jxr_javadoccomment">     * @throws Exception</em>
 <a class="jxr_linenumber" name="L521" href="#L521">521</a> <em class="jxr_javadoccomment">     *             If test fails</em>
 <a class="jxr_linenumber" name="L522" href="#L522">522</a> <em class="jxr_javadoccomment">     */</em>
 <a class="jxr_linenumber" name="L523" href="#L523">523</a>     @Test
 <a class="jxr_linenumber" name="L524" href="#L524">524</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraphNames() <strong class="jxr_keyword">throws</strong> Exception {
-<a class="jxr_linenumber" name="L525" href="#L525">525</a>         <strong class="jxr_keyword">final</strong> Set&lt;BlankNodeOrIRI&gt; names = dataset.getGraphNames().collect(Collectors.toSet());        
+<a class="jxr_linenumber" name="L525" href="#L525">525</a>         <strong class="jxr_keyword">final</strong> Set&lt;BlankNodeOrIRI&gt; names = dataset.getGraphNames().collect(Collectors.toSet());
 <a class="jxr_linenumber" name="L526" href="#L526">526</a>         assertTrue(<span class="jxr_string">"Can't find graph name "</span> + graph1, names.contains(graph1));
 <a class="jxr_linenumber" name="L527" href="#L527">527</a>         assertTrue(<span class="jxr_string">"Found no quads in graph1"</span>, dataset.contains(Optional.of(graph1), <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L528" href="#L528">528</a>         
+<a class="jxr_linenumber" name="L528" href="#L528">528</a> 
 <a class="jxr_linenumber" name="L529" href="#L529">529</a>         <strong class="jxr_keyword">final</strong> Optional&lt;BlankNodeOrIRI&gt; graphName2 = dataset.getGraphNames().filter(BlankNode.<strong class="jxr_keyword">class</strong>::isInstance).findAny();
-<a class="jxr_linenumber" name="L530" href="#L530">530</a>         assertTrue(<span class="jxr_string">"Could not find graph2-like BlankNode"</span>, graphName2.isPresent()); 
+<a class="jxr_linenumber" name="L530" href="#L530">530</a>         assertTrue(<span class="jxr_string">"Could not find graph2-like BlankNode"</span>, graphName2.isPresent());
 <a class="jxr_linenumber" name="L531" href="#L531">531</a>         assertTrue(<span class="jxr_string">"Found no quads in graph2"</span>, dataset.contains(graphName2, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>));
 <a class="jxr_linenumber" name="L532" href="#L532">532</a> 
 <a class="jxr_linenumber" name="L533" href="#L533">533</a>         <em class="jxr_comment">// Some implementations like Virtuoso might have additional internal graphs,</em>
 <a class="jxr_linenumber" name="L534" href="#L534">534</a>         <em class="jxr_comment">// so we can't assume this:</em>
 <a class="jxr_linenumber" name="L535" href="#L535">535</a>         <em class="jxr_comment">//assertEquals(2, names.size());</em>
 <a class="jxr_linenumber" name="L536" href="#L536">536</a>     }
-<a class="jxr_linenumber" name="L537" href="#L537">537</a>     
+<a class="jxr_linenumber" name="L537" href="#L537">537</a> 
 <a class="jxr_linenumber" name="L538" href="#L538">538</a>     @Test
 <a class="jxr_linenumber" name="L539" href="#L539">539</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraph() <strong class="jxr_keyword">throws</strong> Exception {
-<a class="jxr_linenumber" name="L540" href="#L540">540</a>         <strong class="jxr_keyword">final</strong> Graph defaultGraph = dataset.getGraph();
-<a class="jxr_linenumber" name="L541" href="#L541">541</a>         <em class="jxr_comment">// TODO: Can we assume the default graph was empty before our new triples?</em>
-<a class="jxr_linenumber" name="L542" href="#L542">542</a>         assertEquals(2, defaultGraph.size());
-<a class="jxr_linenumber" name="L543" href="#L543">543</a>         assertTrue(defaultGraph.contains(alice, isPrimaryTopicOf, graph1));
-<a class="jxr_linenumber" name="L544" href="#L544">544</a>         <em class="jxr_comment">// NOTE: graph2 is a BlankNode</em>
-<a class="jxr_linenumber" name="L545" href="#L545">545</a>         assertTrue(defaultGraph.contains(bob, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L546" href="#L546">546</a>     }
-<a class="jxr_linenumber" name="L547" href="#L547">547</a> 
+<a class="jxr_linenumber" name="L540" href="#L540">540</a>         <strong class="jxr_keyword">try</strong> (<strong class="jxr_keyword">final</strong> Graph defaultGraph = dataset.getGraph()) {
+<a class="jxr_linenumber" name="L541" href="#L541">541</a>             <em class="jxr_comment">// TODO: Can we assume the default graph was empty before our new triples?</em>
+<a class="jxr_linenumber" name="L542" href="#L542">542</a>             assertEquals(2, defaultGraph.size());
+<a class="jxr_linenumber" name="L543" href="#L543">543</a>             assertTrue(defaultGraph.contains(alice, isPrimaryTopicOf, graph1));
+<a class="jxr_linenumber" name="L544" href="#L544">544</a>             <em class="jxr_comment">// NOTE: graph2 is a BlankNode</em>
+<a class="jxr_linenumber" name="L545" href="#L545">545</a>             assertTrue(defaultGraph.contains(bob, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L546" href="#L546">546</a>         }
+<a class="jxr_linenumber" name="L547" href="#L547">547</a>     }
 <a class="jxr_linenumber" name="L548" href="#L548">548</a> 
-<a class="jxr_linenumber" name="L549" href="#L549">549</a>     @Test
-<a class="jxr_linenumber" name="L550" href="#L550">550</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraphNull() <strong class="jxr_keyword">throws</strong> Exception {
-<a class="jxr_linenumber" name="L551" href="#L551">551</a>         <em class="jxr_comment">// Default graph should be present</em>
-<a class="jxr_linenumber" name="L552" href="#L552">552</a>         <strong class="jxr_keyword">final</strong> Graph defaultGraph = dataset.getGraph(<strong class="jxr_keyword">null</strong>).get();
-<a class="jxr_linenumber" name="L553" href="#L553">553</a>         <em class="jxr_comment">// TODO: Can we assume the default graph was empty before our new triples?</em>
-<a class="jxr_linenumber" name="L554" href="#L554">554</a>         assertEquals(2, defaultGraph.size());
-<a class="jxr_linenumber" name="L555" href="#L555">555</a>         assertTrue(defaultGraph.contains(alice, isPrimaryTopicOf, graph1));
-<a class="jxr_linenumber" name="L556" href="#L556">556</a>         <em class="jxr_comment">// NOTE: wildcard as graph2 is a (potentially mapped) BlankNode</em>
-<a class="jxr_linenumber" name="L557" href="#L557">557</a>         assertTrue(defaultGraph.contains(bob, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L558" href="#L558">558</a>     }
-<a class="jxr_linenumber" name="L559" href="#L559">559</a>     
-<a class="jxr_linenumber" name="L560" href="#L560">560</a> 
-<a class="jxr_linenumber" name="L561" href="#L561">561</a>     @Test
-<a class="jxr_linenumber" name="L562" href="#L562">562</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraph1() <strong class="jxr_keyword">throws</strong> Exception {
-<a class="jxr_linenumber" name="L563" href="#L563">563</a>         <em class="jxr_comment">// graph1 should be present</em>
-<a class="jxr_linenumber" name="L564" href="#L564">564</a>         <strong class="jxr_keyword">final</strong> Graph g1 = dataset.getGraph(graph1).get();
-<a class="jxr_linenumber" name="L565" href="#L565">565</a>         assertEquals(4, g1.size());
-<a class="jxr_linenumber" name="L566" href="#L566">566</a>         
-<a class="jxr_linenumber" name="L567" href="#L567">567</a>         assertTrue(g1.contains(alice, name, aliceName));
-<a class="jxr_linenumber" name="L568" href="#L568">568</a>         assertTrue(g1.contains(alice, knows, bob));
-<a class="jxr_linenumber" name="L569" href="#L569">569</a>         assertTrue(g1.contains(alice, member, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L570" href="#L570">570</a>         assertTrue(g1.contains(<strong class="jxr_keyword">null</strong>, name, secretClubName));
-<a class="jxr_linenumber" name="L571" href="#L571">571</a>     }
-<a class="jxr_linenumber" name="L572" href="#L572">572</a> 
-<a class="jxr_linenumber" name="L573" href="#L573">573</a>     @Test
-<a class="jxr_linenumber" name="L574" href="#L574">574</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraph2() <strong class="jxr_keyword">throws</strong> Exception {
-<a class="jxr_linenumber" name="L575" href="#L575">575</a>         <em class="jxr_comment">// graph2 should be present, even if is named by a BlankNode</em>
-<a class="jxr_linenumber" name="L576" href="#L576">576</a>         <em class="jxr_comment">// We'll look up the potentially mapped graph2 blanknode</em>
-<a class="jxr_linenumber" name="L577" href="#L577">577</a>         <strong class="jxr_keyword">final</strong> BlankNodeOrIRI graph2Name = (BlankNodeOrIRI) dataset.stream(Optional.empty(), bob, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>)
-<a class="jxr_linenumber" name="L578" href="#L578">578</a>                 .map(Quad::getObject).findAny().get();
-<a class="jxr_linenumber" name="L579" href="#L579">579</a>         
-<a class="jxr_linenumber" name="L580" href="#L580">580</a>         <strong class="jxr_keyword">final</strong> Graph g2 = dataset.getGraph(graph2Name).get();
-<a class="jxr_linenumber" name="L581" href="#L581">581</a>         assertEquals(4, g2.size());
-<a class="jxr_linenumber" name="L582" href="#L582">582</a>         <strong class="jxr_keyword">final</strong> Triple bobNameTriple = bobNameQuad.asTriple();
-<a class="jxr_linenumber" name="L583" href="#L583">583</a>         assertTrue(g2.contains(bobNameTriple));
-<a class="jxr_linenumber" name="L584" href="#L584">584</a>         assertTrue(g2.contains(bob, member, bnode1));
-<a class="jxr_linenumber" name="L585" href="#L585">585</a>         assertTrue(g2.contains(bob, member, bnode2));
-<a class="jxr_linenumber" name="L586" href="#L586">586</a>         assertFalse(g2.contains(bnode1, name, secretClubName));
-<a class="jxr_linenumber" name="L587" href="#L587">587</a>         assertTrue(g2.contains(bnode2, name, companyName));
-<a class="jxr_linenumber" name="L588" href="#L588">588</a>     }
-<a class="jxr_linenumber" name="L589" href="#L589">589</a>     
-<a class="jxr_linenumber" name="L590" href="#L590">590</a> 
-<a class="jxr_linenumber" name="L591" href="#L591">591</a>     @Test
-<a class="jxr_linenumber" name="L592" href="#L592">592</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> containsLanguageTagsCaseInsensitive() {
-<a class="jxr_linenumber" name="L593" href="#L593">593</a>         <em class="jxr_comment">// COMMONSRDF-51: Ensure we can add/contains/remove with any casing</em>
-<a class="jxr_linenumber" name="L594" href="#L594">594</a>         <em class="jxr_comment">// of literal language tag</em>
-<a class="jxr_linenumber" name="L595" href="#L595">595</a>         <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"Hello there"</span>, <span class="jxr_string">"en-gb"</span>);
-<a class="jxr_linenumber" name="L596" href="#L596">596</a>         <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"Hello there"</span>, <span class="jxr_string">"EN-GB"</span>);
-<a class="jxr_linenumber" name="L597" href="#L597">597</a>         <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"Hello there"</span>, <span class="jxr_string">"en-GB"</span>);
-<a class="jxr_linenumber" name="L598" href="#L598">598</a> 
-<a class="jxr_linenumber" name="L599" href="#L599">599</a>         <strong class="jxr_keyword">final</strong> IRI example1 = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
-<a class="jxr_linenumber" name="L600" href="#L600">600</a>         <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
+<a class="jxr_linenumber" name="L549" href="#L549">549</a> 
+<a class="jxr_linenumber" name="L550" href="#L550">550</a>     @Test
+<a class="jxr_linenumber" name="L551" href="#L551">551</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraphNull() <strong class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L552" href="#L552">552</a>         <em class="jxr_comment">// Default graph should be present</em>
+<a class="jxr_linenumber" name="L553" href="#L553">553</a>         <strong class="jxr_keyword">try</strong> (<strong class="jxr_keyword">final</strong> Graph defaultGraph = dataset.getGraph(<strong class="jxr_keyword">null</strong>).get()) {
+<a class="jxr_linenumber" name="L554" href="#L554">554</a>             <em class="jxr_comment">// TODO: Can we assume the default graph was empty before our new triples?</em>
+<a class="jxr_linenumber" name="L555" href="#L555">555</a>             assertEquals(2, defaultGraph.size());
+<a class="jxr_linenumber" name="L556" href="#L556">556</a>             assertTrue(defaultGraph.contains(alice, isPrimaryTopicOf, graph1));
+<a class="jxr_linenumber" name="L557" href="#L557">557</a>             <em class="jxr_comment">// NOTE: wildcard as graph2 is a (potentially mapped) BlankNode</em>
+<a class="jxr_linenumber" name="L558" href="#L558">558</a>             assertTrue(defaultGraph.contains(bob, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L559" href="#L559">559</a>         }
+<a class="jxr_linenumber" name="L560" href="#L560">560</a>     }
+<a class="jxr_linenumber" name="L561" href="#L561">561</a> 
+<a class="jxr_linenumber" name="L562" href="#L562">562</a> 
+<a class="jxr_linenumber" name="L563" href="#L563">563</a>     @Test
+<a class="jxr_linenumber" name="L564" href="#L564">564</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraph1() <strong class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L565" href="#L565">565</a>         <em class="jxr_comment">// graph1 should be present</em>
+<a class="jxr_linenumber" name="L566" href="#L566">566</a>         <strong class="jxr_keyword">try</strong> (<strong class="jxr_keyword">final</strong> Graph g1 = dataset.getGraph(graph1).get()) {
+<a class="jxr_linenumber" name="L567" href="#L567">567</a>             assertEquals(4, g1.size());
+<a class="jxr_linenumber" name="L568" href="#L568">568</a> 
+<a class="jxr_linenumber" name="L569" href="#L569">569</a>             assertTrue(g1.contains(alice, name, aliceName));
+<a class="jxr_linenumber" name="L570" href="#L570">570</a>             assertTrue(g1.contains(alice, knows, bob));
+<a class="jxr_linenumber" name="L571" href="#L571">571</a>             assertTrue(g1.contains(alice, member, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L572" href="#L572">572</a>             assertTrue(g1.contains(<strong class="jxr_keyword">null</strong>, name, secretClubName));
+<a class="jxr_linenumber" name="L573" href="#L573">573</a>         }
+<a class="jxr_linenumber" name="L574" href="#L574">574</a>     }
+<a class="jxr_linenumber" name="L575" href="#L575">575</a> 
+<a class="jxr_linenumber" name="L576" href="#L576">576</a>     @Test
+<a class="jxr_linenumber" name="L577" href="#L577">577</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> getGraph2() <strong class="jxr_keyword">throws</strong> Exception {
+<a class="jxr_linenumber" name="L578" href="#L578">578</a>         <em class="jxr_comment">// graph2 should be present, even if is named by a BlankNode</em>
+<a class="jxr_linenumber" name="L579" href="#L579">579</a>         <em class="jxr_comment">// We'll look up the potentially mapped graph2 blanknode</em>
+<a class="jxr_linenumber" name="L580" href="#L580">580</a>         <strong class="jxr_keyword">final</strong> BlankNodeOrIRI graph2Name = (BlankNodeOrIRI) dataset.stream(Optional.empty(), bob, isPrimaryTopicOf, <strong class="jxr_keyword">null</strong>)
+<a class="jxr_linenumber" name="L581" href="#L581">581</a>                 .map(Quad::getObject).findAny().get();
+<a class="jxr_linenumber" name="L582" href="#L582">582</a> 
+<a class="jxr_linenumber" name="L583" href="#L583">583</a>         <strong class="jxr_keyword">try</strong> (<strong class="jxr_keyword">final</strong> Graph g2 = dataset.getGraph(graph2Name).get()) {
+<a class="jxr_linenumber" name="L584" href="#L584">584</a>             assertEquals(4, g2.size());
+<a class="jxr_linenumber" name="L585" href="#L585">585</a>             <strong class="jxr_keyword">final</strong> Triple bobNameTriple = bobNameQuad.asTriple();
+<a class="jxr_linenumber" name="L586" href="#L586">586</a>             assertTrue(g2.contains(bobNameTriple));
+<a class="jxr_linenumber" name="L587" href="#L587">587</a>             assertTrue(g2.contains(bob, member, bnode1));
+<a class="jxr_linenumber" name="L588" href="#L588">588</a>             assertTrue(g2.contains(bob, member, bnode2));
+<a class="jxr_linenumber" name="L589" href="#L589">589</a>             assertFalse(g2.contains(bnode1, name, secretClubName));
+<a class="jxr_linenumber" name="L590" href="#L590">590</a>             assertTrue(g2.contains(bnode2, name, companyName));
+<a class="jxr_linenumber" name="L591" href="#L591">591</a>         }
+<a class="jxr_linenumber" name="L592" href="#L592">592</a>     }
+<a class="jxr_linenumber" name="L593" href="#L593">593</a> 
+<a class="jxr_linenumber" name="L594" href="#L594">594</a>     @Test
+<a class="jxr_linenumber" name="L595" href="#L595">595</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> containsLanguageTagsCaseInsensitive() {
+<a class="jxr_linenumber" name="L596" href="#L596">596</a>         <em class="jxr_comment">// COMMONSRDF-51: Ensure we can add/contains/remove with any casing</em>
+<a class="jxr_linenumber" name="L597" href="#L597">597</a>         <em class="jxr_comment">// of literal language tag</em>
+<a class="jxr_linenumber" name="L598" href="#L598">598</a>         <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"Hello there"</span>, <span class="jxr_string">"en-gb"</span>);
+<a class="jxr_linenumber" name="L599" href="#L599">599</a>         <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"Hello there"</span>, <span class="jxr_string">"EN-GB"</span>);
+<a class="jxr_linenumber" name="L600" href="#L600">600</a>         <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"Hello there"</span>, <span class="jxr_string">"en-GB"</span>);
 <a class="jxr_linenumber" name="L601" href="#L601">601</a> 
-<a class="jxr_linenumber" name="L602" href="#L602">602</a>         
-<a class="jxr_linenumber" name="L603" href="#L603">603</a>         dataset.add(<strong class="jxr_keyword">null</strong>, example1, greeting, upper);
-<a class="jxr_linenumber" name="L604" href="#L604">604</a>         
-<a class="jxr_linenumber" name="L605" href="#L605">605</a>         <em class="jxr_comment">// any kind of Triple should match</em>
-<a class="jxr_linenumber" name="L606" href="#L606">606</a>         assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, upper)));
-<a class="jxr_linenumber" name="L607" href="#L607">607</a>         assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, lower)));
-<a class="jxr_linenumber" name="L608" href="#L608">608</a>         assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, mixed)));
-<a class="jxr_linenumber" name="L609" href="#L609">609</a> 
-<a class="jxr_linenumber" name="L610" href="#L610">610</a>         <em class="jxr_comment">// or as patterns</em>
-<a class="jxr_linenumber" name="L611" href="#L611">611</a>         assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, upper));
-<a class="jxr_linenumber" name="L612" href="#L612">612</a>         assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, lower));
-<a class="jxr_linenumber" name="L613" href="#L613">613</a>         assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, mixed));
-<a class="jxr_linenumber" name="L614" href="#L614">614</a>     }
-<a class="jxr_linenumber" name="L615" href="#L615">615</a> 
-<a class="jxr_linenumber" name="L616" href="#L616">616</a>     @Test
-<a class="jxr_linenumber" name="L617" href="#L617">617</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> containsLanguageTagsCaseInsensitiveTurkish() {
-<a class="jxr_linenumber" name="L618" href="#L618">618</a>         <em class="jxr_comment">// COMMONSRDF-51: Special test for Turkish issue where</em>
-<a class="jxr_linenumber" name="L619" href="#L619">619</a>         <em class="jxr_comment">// "i".toLowerCase() != "i"</em>
-<a class="jxr_linenumber" name="L620" href="#L620">620</a>         <em class="jxr_comment">// See also:</em>
-<a class="jxr_linenumber" name="L621" href="#L621">621</a>         <em class="jxr_comment">// https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/</em>
-<a class="jxr_linenumber" name="L622" href="#L622">622</a> 
-<a class="jxr_linenumber" name="L623" href="#L623">623</a>         <em class="jxr_comment">// This is similar to the test in AbstractRDFTest, but on a graph</em>
-<a class="jxr_linenumber" name="L624" href="#L624">624</a>         Locale defaultLocale = Locale.getDefault();
-<a class="jxr_linenumber" name="L625" href="#L625">625</a>         <strong class="jxr_keyword">try</strong> {
-<a class="jxr_linenumber" name="L626" href="#L626">626</a>             Locale.setDefault(Locale.ROOT);
-<a class="jxr_linenumber" name="L627" href="#L627">627</a>             <strong class="jxr_keyword">final</strong> Literal lowerROOT = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fi"</span>);
-<a class="jxr_linenumber" name="L628" href="#L628">628</a>             <strong class="jxr_keyword">final</strong> Literal upperROOT = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"FI"</span>);
-<a class="jxr_linenumber" name="L629" href="#L629">629</a>             <strong class="jxr_keyword">final</strong> Literal mixedROOT = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fI"</span>);
-<a class="jxr_linenumber" name="L630" href="#L630">630</a>             <strong class="jxr_keyword">final</strong> IRI exampleROOT = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
-<a class="jxr_linenumber" name="L631" href="#L631">631</a>             <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
-<a class="jxr_linenumber" name="L632" href="#L632">632</a>             dataset.add(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, mixedROOT);
-<a class="jxr_linenumber" name="L633" href="#L633">633</a> 
-<a class="jxr_linenumber" name="L634" href="#L634">634</a>             Locale turkish = Locale.forLanguageTag(<span class="jxr_string">"TR"</span>);
-<a class="jxr_linenumber" name="L635" href="#L635">635</a>             Locale.setDefault(turkish);
-<a class="jxr_linenumber" name="L636" href="#L636">636</a>             <em class="jxr_comment">// If the below assertion fails, then the Turkish</em>
-<a class="jxr_linenumber" name="L637" href="#L637">637</a>             <em class="jxr_comment">// locale no longer have this peculiarity that</em>
-<a class="jxr_linenumber" name="L638" href="#L638">638</a>             <em class="jxr_comment">// we want to test.</em>
-<a class="jxr_linenumber" name="L639" href="#L639">639</a>             Assume.assumeFalse(<span class="jxr_string">"FI"</span>.toLowerCase().equals(<span class="jxr_string">"fi"</span>));
-<a class="jxr_linenumber" name="L640" href="#L640">640</a> 
-<a class="jxr_linenumber" name="L641" href="#L641">641</a>             <em class="jxr_comment">// Below is pretty much the same as in</em>
-<a class="jxr_linenumber" name="L642" href="#L642">642</a>             <em class="jxr_comment">// containsLanguageTagsCaseInsensitive()</em>
-<a class="jxr_linenumber" name="L643" href="#L643">643</a>             <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fi"</span>);
-<a class="jxr_linenumber" name="L644" href="#L644">644</a>             <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"FI"</span>);
-<a class="jxr_linenumber" name="L645" href="#L645">645</a>             <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fI"</span>);
-<a class="jxr_linenumber" name="L646" href="#L646">646</a> 
-<a class="jxr_linenumber" name="L647" href="#L647">647</a>             <strong class="jxr_keyword">final</strong> IRI exampleTR = factory.createIRI(<span class="jxr_string">"http://example.com/s2"</span>);
-<a class="jxr_linenumber" name="L648" href="#L648">648</a>             dataset.add(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, upper);
-<a class="jxr_linenumber" name="L649" href="#L649">649</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, upper)));
-<a class="jxr_linenumber" name="L650" href="#L650">650</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, upperROOT)));
-<a class="jxr_linenumber" name="L651" href="#L651">651</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, lower)));
-<a class="jxr_linenumber" name="L652" href="#L652">652</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, lowerROOT)));
-<a class="jxr_linenumber" name="L653" href="#L653">653</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, mixed)));
-<a class="jxr_linenumber" name="L654" href="#L654">654</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, mixedROOT)));
-<a class="jxr_linenumber" name="L655" href="#L655">655</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, upper));
-<a class="jxr_linenumber" name="L656" href="#L656">656</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, upperROOT));
-<a class="jxr_linenumber" name="L657" href="#L657">657</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, lower));
-<a class="jxr_linenumber" name="L658" href="#L658">658</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, lowerROOT));
-<a class="jxr_linenumber" name="L659" href="#L659">659</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, mixed));
-<a class="jxr_linenumber" name="L660" href="#L660">660</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, mixedROOT));
-<a class="jxr_linenumber" name="L661" href="#L661">661</a> 
-<a class="jxr_linenumber" name="L662" href="#L662">662</a>             <em class="jxr_comment">// What about the triple we added while in ROOT locale?</em>
-<a class="jxr_linenumber" name="L663" href="#L663">663</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, upper)));
-<a class="jxr_linenumber" name="L664" href="#L664">664</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, lower)));
-<a class="jxr_linenumber" name="L665" href="#L665">665</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, mixed)));
-<a class="jxr_linenumber" name="L666" href="#L666">666</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleROOT, <strong class="jxr_keyword">null</strong>, upper));
-<a class="jxr_linenumber" name="L667" href="#L667">667</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleROOT, <strong class="jxr_keyword">null</strong>, lower));
-<a class="jxr_linenumber" name="L668" href="#L668">668</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleROOT, <strong class="jxr_keyword">null</strong>, mixed));
-<a class="jxr_linenumber" name="L669" href="#L669">669</a>         } <strong class="jxr_keyword">finally</strong> {
-<a class="jxr_linenumber" name="L670" href="#L670">670</a>             Locale.setDefault(defaultLocale);
-<a class="jxr_linenumber" name="L671" href="#L671">671</a>         }
-<a class="jxr_linenumber" name="L672" href="#L672">672</a>     }
-<a class="jxr_linenumber" name="L673" href="#L673">673</a>     
-<a class="jxr_linenumber" name="L674" href="#L674">674</a> 
-<a class="jxr_linenumber" name="L675" href="#L675">675</a>     @Test
-<a class="jxr_linenumber" name="L676" href="#L676">676</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> removeLanguageTagsCaseInsensitive() {
-<a class="jxr_linenumber" name="L677" href="#L677">677</a>         <em class="jxr_comment">// COMMONSRDF-51: Ensure we can remove with any casing</em>
-<a class="jxr_linenumber" name="L678" href="#L678">678</a>         <em class="jxr_comment">// of literal language tag</em>
-<a class="jxr_linenumber" name="L679" href="#L679">679</a>         <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"Howdy"</span>, <span class="jxr_string">"en-us"</span>);
-<a class="jxr_linenumber" name="L680" href="#L680">680</a>         <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"Howdy"</span>, <span class="jxr_string">"EN-US"</span>);
-<a class="jxr_linenumber" name="L681" href="#L681">681</a>         <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"Howdy"</span>, <span class="jxr_string">"en-US"</span>);
-<a class="jxr_linenumber" name="L682" href="#L682">682</a> 
-<a class="jxr_linenumber" name="L683" href="#L683">683</a>         <strong class="jxr_keyword">final</strong> IRI example1 = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
-<a class="jxr_linenumber" name="L684" href="#L684">684</a>         <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
+<a class="jxr_linenumber" name="L602" href="#L602">602</a>         <strong class="jxr_keyword">final</strong> IRI example1 = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
+<a class="jxr_linenumber" name="L603" href="#L603">603</a>         <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
+<a class="jxr_linenumber" name="L604" href="#L604">604</a> 
+<a class="jxr_linenumber" name="L605" href="#L605">605</a> 
+<a class="jxr_linenumber" name="L606" href="#L606">606</a>         dataset.add(<strong class="jxr_keyword">null</strong>, example1, greeting, upper);
+<a class="jxr_linenumber" name="L607" href="#L607">607</a> 
+<a class="jxr_linenumber" name="L608" href="#L608">608</a>         <em class="jxr_comment">// any kind of Triple should match</em>
+<a class="jxr_linenumber" name="L609" href="#L609">609</a>         assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, upper)));
+<a class="jxr_linenumber" name="L610" href="#L610">610</a>         assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, lower)));
+<a class="jxr_linenumber" name="L611" href="#L611">611</a>         assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, mixed)));
+<a class="jxr_linenumber" name="L612" href="#L612">612</a> 
+<a class="jxr_linenumber" name="L613" href="#L613">613</a>         <em class="jxr_comment">// or as patterns</em>
+<a class="jxr_linenumber" name="L614" href="#L614">614</a>         assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, upper));
+<a class="jxr_linenumber" name="L615" href="#L615">615</a>         assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, lower));
+<a class="jxr_linenumber" name="L616" href="#L616">616</a>         assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, mixed));
+<a class="jxr_linenumber" name="L617" href="#L617">617</a>     }
+<a class="jxr_linenumber" name="L618" href="#L618">618</a> 
+<a class="jxr_linenumber" name="L619" href="#L619">619</a>     @Test
+<a class="jxr_linenumber" name="L620" href="#L620">620</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> containsLanguageTagsCaseInsensitiveTurkish() {
+<a class="jxr_linenumber" name="L621" href="#L621">621</a>         <em class="jxr_comment">// COMMONSRDF-51: Special test for Turkish issue where</em>
+<a class="jxr_linenumber" name="L622" href="#L622">622</a>         <em class="jxr_comment">// "i".toLowerCase() != "i"</em>
+<a class="jxr_linenumber" name="L623" href="#L623">623</a>         <em class="jxr_comment">// See also:</em>
+<a class="jxr_linenumber" name="L624" href="#L624">624</a>         <em class="jxr_comment">// https://garygregory.wordpress.com/2015/11/03/java-lowercase-conversion-turkey/</em>
+<a class="jxr_linenumber" name="L625" href="#L625">625</a> 
+<a class="jxr_linenumber" name="L626" href="#L626">626</a>         <em class="jxr_comment">// This is similar to the test in AbstractRDFTest, but on a graph</em>
+<a class="jxr_linenumber" name="L627" href="#L627">627</a>         <strong class="jxr_keyword">final</strong> Locale defaultLocale = Locale.getDefault();
+<a class="jxr_linenumber" name="L628" href="#L628">628</a>         <strong class="jxr_keyword">try</strong> {
+<a class="jxr_linenumber" name="L629" href="#L629">629</a>             Locale.setDefault(Locale.ROOT);
+<a class="jxr_linenumber" name="L630" href="#L630">630</a>             <strong class="jxr_keyword">final</strong> Literal lowerROOT = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fi"</span>);
+<a class="jxr_linenumber" name="L631" href="#L631">631</a>             <strong class="jxr_keyword">final</strong> Literal upperROOT = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"FI"</span>);
+<a class="jxr_linenumber" name="L632" href="#L632">632</a>             <strong class="jxr_keyword">final</strong> Literal mixedROOT = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fI"</span>);
+<a class="jxr_linenumber" name="L633" href="#L633">633</a>             <strong class="jxr_keyword">final</strong> IRI exampleROOT = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
+<a class="jxr_linenumber" name="L634" href="#L634">634</a>             <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
+<a class="jxr_linenumber" name="L635" href="#L635">635</a>             dataset.add(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, mixedROOT);
+<a class="jxr_linenumber" name="L636" href="#L636">636</a> 
+<a class="jxr_linenumber" name="L637" href="#L637">637</a>             <strong class="jxr_keyword">final</strong> Locale turkish = Locale.forLanguageTag(<span class="jxr_string">"TR"</span>);
+<a class="jxr_linenumber" name="L638" href="#L638">638</a>             Locale.setDefault(turkish);
+<a class="jxr_linenumber" name="L639" href="#L639">639</a>             <em class="jxr_comment">// If the below assertion fails, then the Turkish</em>
+<a class="jxr_linenumber" name="L640" href="#L640">640</a>             <em class="jxr_comment">// locale no longer have this peculiarity that</em>
+<a class="jxr_linenumber" name="L641" href="#L641">641</a>             <em class="jxr_comment">// we want to test.</em>
+<a class="jxr_linenumber" name="L642" href="#L642">642</a>             Assume.assumeFalse(<span class="jxr_string">"FI"</span>.toLowerCase().equals(<span class="jxr_string">"fi"</span>));
+<a class="jxr_linenumber" name="L643" href="#L643">643</a> 
+<a class="jxr_linenumber" name="L644" href="#L644">644</a>             <em class="jxr_comment">// Below is pretty much the same as in</em>
+<a class="jxr_linenumber" name="L645" href="#L645">645</a>             <em class="jxr_comment">// containsLanguageTagsCaseInsensitive()</em>
+<a class="jxr_linenumber" name="L646" href="#L646">646</a>             <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fi"</span>);
+<a class="jxr_linenumber" name="L647" href="#L647">647</a>             <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"FI"</span>);
+<a class="jxr_linenumber" name="L648" href="#L648">648</a>             <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"moi"</span>, <span class="jxr_string">"fI"</span>);
+<a class="jxr_linenumber" name="L649" href="#L649">649</a> 
+<a class="jxr_linenumber" name="L650" href="#L650">650</a>             <strong class="jxr_keyword">final</strong> IRI exampleTR = factory.createIRI(<span class="jxr_string">"http://example.com/s2"</span>);
+<a class="jxr_linenumber" name="L651" href="#L651">651</a>             dataset.add(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, upper);
+<a class="jxr_linenumber" name="L652" href="#L652">652</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, upper)));
+<a class="jxr_linenumber" name="L653" href="#L653">653</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, upperROOT)));
+<a class="jxr_linenumber" name="L654" href="#L654">654</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, lower)));
+<a class="jxr_linenumber" name="L655" href="#L655">655</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, lowerROOT)));
+<a class="jxr_linenumber" name="L656" href="#L656">656</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, mixed)));
+<a class="jxr_linenumber" name="L657" href="#L657">657</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleTR, greeting, mixedROOT)));
+<a class="jxr_linenumber" name="L658" href="#L658">658</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, upper));
+<a class="jxr_linenumber" name="L659" href="#L659">659</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, upperROOT));
+<a class="jxr_linenumber" name="L660" href="#L660">660</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, lower));
+<a class="jxr_linenumber" name="L661" href="#L661">661</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, lowerROOT));
+<a class="jxr_linenumber" name="L662" href="#L662">662</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, mixed));
+<a class="jxr_linenumber" name="L663" href="#L663">663</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleTR, <strong class="jxr_keyword">null</strong>, mixedROOT));
+<a class="jxr_linenumber" name="L664" href="#L664">664</a> 
+<a class="jxr_linenumber" name="L665" href="#L665">665</a>             <em class="jxr_comment">// What about the triple we added while in ROOT locale?</em>
+<a class="jxr_linenumber" name="L666" href="#L666">666</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, upper)));
+<a class="jxr_linenumber" name="L667" href="#L667">667</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, lower)));
+<a class="jxr_linenumber" name="L668" href="#L668">668</a>             assertTrue(dataset.contains(factory.createQuad(<strong class="jxr_keyword">null</strong>, exampleROOT, greeting, mixed)));
+<a class="jxr_linenumber" name="L669" href="#L669">669</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleROOT, <strong class="jxr_keyword">null</strong>, upper));
+<a class="jxr_linenumber" name="L670" href="#L670">670</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleROOT, <strong class="jxr_keyword">null</strong>, lower));
+<a class="jxr_linenumber" name="L671" href="#L671">671</a>             assertTrue(dataset.contains(<strong class="jxr_keyword">null</strong>, exampleROOT, <strong class="jxr_keyword">null</strong>, mixed));
+<a class="jxr_linenumber" name="L672" href="#L672">672</a>         } <strong class="jxr_keyword">finally</strong> {
+<a class="jxr_linenumber" name="L673" href="#L673">673</a>             Locale.setDefault(defaultLocale);
+<a class="jxr_linenumber" name="L674" href="#L674">674</a>         }
+<a class="jxr_linenumber" name="L675" href="#L675">675</a>     }
+<a class="jxr_linenumber" name="L676" href="#L676">676</a> 
+<a class="jxr_linenumber" name="L677" href="#L677">677</a> 
+<a class="jxr_linenumber" name="L678" href="#L678">678</a>     @Test
+<a class="jxr_linenumber" name="L679" href="#L679">679</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> removeLanguageTagsCaseInsensitive() {
+<a class="jxr_linenumber" name="L680" href="#L680">680</a>         <em class="jxr_comment">// COMMONSRDF-51: Ensure we can remove with any casing</em>
+<a class="jxr_linenumber" name="L681" href="#L681">681</a>         <em class="jxr_comment">// of literal language tag</em>
+<a class="jxr_linenumber" name="L682" href="#L682">682</a>         <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"Howdy"</span>, <span class="jxr_string">"en-us"</span>);
+<a class="jxr_linenumber" name="L683" href="#L683">683</a>         <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"Howdy"</span>, <span class="jxr_string">"EN-US"</span>);
+<a class="jxr_linenumber" name="L684" href="#L684">684</a>         <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"Howdy"</span>, <span class="jxr_string">"en-US"</span>);
 <a class="jxr_linenumber" name="L685" href="#L685">685</a> 
-<a class="jxr_linenumber" name="L686" href="#L686">686</a>         dataset.add(<strong class="jxr_keyword">null</strong>, example1, greeting, upper);
-<a class="jxr_linenumber" name="L687" href="#L687">687</a> 
-<a class="jxr_linenumber" name="L688" href="#L688">688</a>         <em class="jxr_comment">// Remove should also honour any case</em>
-<a class="jxr_linenumber" name="L689" href="#L689">689</a>         dataset.remove(<strong class="jxr_keyword">null</strong>, example1, <strong class="jxr_keyword">null</strong>, mixed);
-<a class="jxr_linenumber" name="L690" href="#L690">690</a>         assertFalse(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, greeting, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L691" href="#L691">691</a>         
-<a class="jxr_linenumber" name="L692" href="#L692">692</a>         dataset.add(<strong class="jxr_keyword">null</strong>, example1, greeting, lower);
-<a class="jxr_linenumber" name="L693" href="#L693">693</a>         dataset.remove(<strong class="jxr_keyword">null</strong>, example1, <strong class="jxr_keyword">null</strong>, upper);
+<a class="jxr_linenumber" name="L686" href="#L686">686</a>         <strong class="jxr_keyword">final</strong> IRI example1 = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
+<a class="jxr_linenumber" name="L687" href="#L687">687</a>         <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
+<a class="jxr_linenumber" name="L688" href="#L688">688</a> 
+<a class="jxr_linenumber" name="L689" href="#L689">689</a>         dataset.add(<strong class="jxr_keyword">null</strong>, example1, greeting, upper);
+<a class="jxr_linenumber" name="L690" href="#L690">690</a> 
+<a class="jxr_linenumber" name="L691" href="#L691">691</a>         <em class="jxr_comment">// Remove should also honour any case</em>
+<a class="jxr_linenumber" name="L692" href="#L692">692</a>         dataset.remove(<strong class="jxr_keyword">null</strong>, example1, <strong class="jxr_keyword">null</strong>, mixed);
+<a class="jxr_linenumber" name="L693" href="#L693">693</a>         assertFalse(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, greeting, <strong class="jxr_keyword">null</strong>));
 <a class="jxr_linenumber" name="L694" href="#L694">694</a> 
-<a class="jxr_linenumber" name="L695" href="#L695">695</a>         <em class="jxr_comment">// Check with Triple</em>
-<a class="jxr_linenumber" name="L696" href="#L696">696</a>         dataset.add(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, mixed));
-<a class="jxr_linenumber" name="L697" href="#L697">697</a>         dataset.remove(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, upper));
-<a class="jxr_linenumber" name="L698" href="#L698">698</a>         assertFalse(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, greeting, <strong class="jxr_keyword">null</strong>));
-<a class="jxr_linenumber" name="L699" href="#L699">699</a>     }
-<a class="jxr_linenumber" name="L700" href="#L700">700</a> 
-<a class="jxr_linenumber" name="L701" href="#L701">701</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> Optional&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; closableFindAny(Stream&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; stream) {
-<a class="jxr_linenumber" name="L702" href="#L702">702</a>         <strong class="jxr_keyword">try</strong> (Stream&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; s = stream) {
-<a class="jxr_linenumber" name="L703" href="#L703">703</a>             <strong class="jxr_keyword">return</strong> s.findAny();
-<a class="jxr_linenumber" name="L704" href="#L704">704</a>         }
-<a class="jxr_linenumber" name="L705" href="#L705">705</a>     }
-<a class="jxr_linenumber" name="L706" href="#L706">706</a>     
-<a class="jxr_linenumber" name="L707" href="#L707">707</a>     @Test
-<a class="jxr_linenumber" name="L708" href="#L708">708</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> streamLanguageTagsCaseInsensitive() {
-<a class="jxr_linenumber" name="L709" href="#L709">709</a>         <em class="jxr_comment">// COMMONSRDF-51: Ensure we can add/contains/remove with any casing</em>
-<a class="jxr_linenumber" name="L710" href="#L710">710</a>         <em class="jxr_comment">// of literal language tag</em>
-<a class="jxr_linenumber" name="L711" href="#L711">711</a>         <strong class="jxr_keyword">final</strong> Literal lower = factory.createLiteral(<span class="jxr_string">"Good afternoon"</span>, <span class="jxr_string">"en-gb"</span>);
-<a class="jxr_linenumber" name="L712" href="#L712">712</a>         <strong class="jxr_keyword">final</strong> Literal upper = factory.createLiteral(<span class="jxr_string">"Good afternoon"</span>, <span class="jxr_string">"EN-GB"</span>);
-<a class="jxr_linenumber" name="L713" href="#L713">713</a>         <strong class="jxr_keyword">final</strong> Literal mixed = factory.createLiteral(<span class="jxr_string">"Good afternoon"</span>, <span class="jxr_string">"en-GB"</span>);
-<a class="jxr_linenumber" name="L714" href="#L714">714</a> 
-<a class="jxr_linenumber" name="L715" href="#L715">715</a>         <strong class="jxr_keyword">final</strong> IRI example1 = factory.createIRI(<span class="jxr_string">"http://example.com/s1"</span>);
-<a class="jxr_linenumber" name="L716" href="#L716">716</a>         <strong class="jxr_keyword">final</strong> IRI greeting = factory.createIRI(<span class="jxr_string">"http://example.com/greeting"</span>);
+<a class="jxr_linenumber" name="L695" href="#L695">695</a>         dataset.add(<strong class="jxr_keyword">null</strong>, example1, greeting, lower);
+<a class="jxr_linenumber" name="L696" href="#L696">696</a>         dataset.remove(<strong class="jxr_keyword">null</strong>, example1, <strong class="jxr_keyword">null</strong>, upper);
+<a class="jxr_linenumber" name="L697" href="#L697">697</a> 
+<a class="jxr_linenumber" name="L698" href="#L698">698</a>         <em class="jxr_comment">// Check with Triple</em>
+<a class="jxr_linenumber" name="L699" href="#L699">699</a>         dataset.add(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, mixed));
+<a class="jxr_linenumber" name="L700" href="#L700">700</a>         dataset.remove(factory.createQuad(<strong class="jxr_keyword">null</strong>, example1, greeting, upper));
+<a class="jxr_linenumber" name="L701" href="#L701">701</a>         assertFalse(dataset.contains(<strong class="jxr_keyword">null</strong>, <strong class="jxr_keyword">null</strong>, greeting, <strong class="jxr_keyword">null</strong>));
+<a class="jxr_linenumber" name="L702" href="#L702">702</a>     }
+<a class="jxr_linenumber" name="L703" href="#L703">703</a> 
+<a class="jxr_linenumber" name="L704" href="#L704">704</a>     <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> Optional&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; closableFindAny(<strong class="jxr_keyword">final</strong> Stream&lt;? <strong class="jxr_keyword">extends</strong> Quad&gt; stream) {

[... 142 lines stripped ...]


Mime
View raw message