Modified: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdRDF.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdRDF.html (original) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdRDF.html Tue Nov 22 07:55:35 2016 @@ -55,7 +55,7 @@ <span class="sourceLineNo">047</span> this("urn:uuid:" + UUID.randomUUID() + "#b");<a name="line.47"></a> <span class="sourceLineNo">048</span> }<a name="line.48"></a> <span class="sourceLineNo">049</span><a name="line.49"></a> -<span class="sourceLineNo">050</span> JsonLdRDF(String bnodePrefix) {<a name="line.50"></a> +<span class="sourceLineNo">050</span> JsonLdRDF(final String bnodePrefix) {<a name="line.50"></a> <span class="sourceLineNo">051</span> this.bnodePrefix = Objects.requireNonNull(bnodePrefix);<a name="line.51"></a> <span class="sourceLineNo">052</span> }<a name="line.52"></a> <span class="sourceLineNo">053</span><a name="line.53"></a> @@ -70,7 +70,7 @@ <span class="sourceLineNo">062</span> * JsonLd {@link RDFDataset} to adapt<a name="line.62"></a> <span class="sourceLineNo">063</span> * @return Adapted {@link Dataset}<a name="line.63"></a> <span class="sourceLineNo">064</span> */<a name="line.64"></a> -<span class="sourceLineNo">065</span> public JsonLdDataset asDataset(RDFDataset rdfDataSet) {<a name="line.65"></a> +<span class="sourceLineNo">065</span> public JsonLdDataset asDataset(final RDFDataset rdfDataSet) {<a name="line.65"></a> <span class="sourceLineNo">066</span> return new JsonLdDatasetImpl(rdfDataSet);<a name="line.66"></a> <span class="sourceLineNo">067</span> }<a name="line.67"></a> <span class="sourceLineNo">068</span><a name="line.68"></a> @@ -90,13 +90,13 @@ <span class="sourceLineNo">082</span> * JsonLd {@link RDFDataset} to adapt<a name="line.82"></a> <span class="sourceLineNo">083</span> * @return Adapted {@link Graph} covering the <em>default graph</em><a name="line.83"></a> <span class="sourceLineNo">084</span> */<a name="line.84"></a> -<span class="sourceLineNo">085</span> public JsonLdGraph asGraph(RDFDataset rdfDataSet) {<a name="line.85"></a> +<span class="sourceLineNo">085</span> public JsonLdGraph asGraph(final RDFDataset rdfDataSet) {<a name="line.85"></a> <span class="sourceLineNo">086</span> return new JsonLdGraphImpl(rdfDataSet);<a name="line.86"></a> <span class="sourceLineNo">087</span> }<a name="line.87"></a> <span class="sourceLineNo">088</span><a name="line.88"></a> -<span class="sourceLineNo">089</span> public Node asJsonLdNode(RDFTerm term) {<a name="line.89"></a> +<span class="sourceLineNo">089</span> public Node asJsonLdNode(final RDFTerm term) {<a name="line.89"></a> <span class="sourceLineNo">090</span> if (term instanceof JsonLdBlankNode) {<a name="line.90"></a> -<span class="sourceLineNo">091</span> JsonLdBlankNode jsonLdBlankNode = (JsonLdBlankNode) term;<a name="line.91"></a> +<span class="sourceLineNo">091</span> final JsonLdBlankNode jsonLdBlankNode = (JsonLdBlankNode) term;<a name="line.91"></a> <span class="sourceLineNo">092</span> if (jsonLdBlankNode.uniqueReference().startsWith(bnodePrefix)) {<a name="line.92"></a> <span class="sourceLineNo">093</span> // Only return blank nodes 'as is' if they have the same prefix<a name="line.93"></a> <span class="sourceLineNo">094</span> return jsonLdBlankNode.asJsonLdNode();<a name="line.94"></a> @@ -109,7 +109,7 @@ <span class="sourceLineNo">101</span> return new RDFDataset.IRI(((IRI) term).getIRIString());<a name="line.101"></a> <span class="sourceLineNo">102</span> }<a name="line.102"></a> <span class="sourceLineNo">103</span> if (term instanceof BlankNode) {<a name="line.103"></a> -<span class="sourceLineNo">104</span> String ref = ((BlankNode) term).uniqueReference();<a name="line.104"></a> +<span class="sourceLineNo">104</span> final String ref = ((BlankNode) term).uniqueReference();<a name="line.104"></a> <span class="sourceLineNo">105</span> if (ref.startsWith(bnodePrefix)) {<a name="line.105"></a> <span class="sourceLineNo">106</span> // one of our own (but no longer a JsonLdBlankNode),<a name="line.106"></a> <span class="sourceLineNo">107</span> // we can recover the label after our unique prefix<a name="line.107"></a> @@ -117,11 +117,11 @@ <span class="sourceLineNo">109</span> }<a name="line.109"></a> <span class="sourceLineNo">110</span> // The "foreign" unique reference might not be a valid bnode string,<a name="line.110"></a> <span class="sourceLineNo">111</span> // we'll convert to a UUID<a name="line.111"></a> -<span class="sourceLineNo">112</span> UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));<a name="line.112"></a> +<span class="sourceLineNo">112</span> final UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));<a name="line.112"></a> <span class="sourceLineNo">113</span> return new RDFDataset.BlankNode("_:" + uuid);<a name="line.113"></a> <span class="sourceLineNo">114</span> }<a name="line.114"></a> <span class="sourceLineNo">115</span> if (term instanceof Literal) {<a name="line.115"></a> -<span class="sourceLineNo">116</span> Literal literal = (Literal) term;<a name="line.116"></a> +<span class="sourceLineNo">116</span> final Literal literal = (Literal) term;<a name="line.116"></a> <span class="sourceLineNo">117</span> return new RDFDataset.Literal(literal.getLexicalForm(), literal.getDatatype().getIRIString(),<a name="line.117"></a> <span class="sourceLineNo">118</span> literal.getLanguageTag().orElse(null));<a name="line.118"></a> <span class="sourceLineNo">119</span> }<a name="line.119"></a> @@ -136,8 +136,8 @@ <span class="sourceLineNo">128</span> * Commons RDF {@link org.apache.commons.rdf.api.Quad} to adapt<a name="line.128"></a> <span class="sourceLineNo">129</span> * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}<a name="line.129"></a> <span class="sourceLineNo">130</span> */<a name="line.130"></a> -<span class="sourceLineNo">131</span> public RDFDataset.Quad asJsonLdQuad(org.apache.commons.rdf.api.Quad quad) {<a name="line.131"></a> -<span class="sourceLineNo">132</span> BlankNodeOrIRI g = quad.getGraphName().orElse(null);<a name="line.132"></a> +<span class="sourceLineNo">131</span> public RDFDataset.Quad asJsonLdQuad(final org.apache.commons.rdf.api.Quad quad) {<a name="line.131"></a> +<span class="sourceLineNo">132</span> final BlankNodeOrIRI g = quad.getGraphName().orElse(null);<a name="line.132"></a> <span class="sourceLineNo">133</span> return createJsonLdQuad(g, quad.getSubject(), quad.getPredicate(), quad.getObject());<a name="line.133"></a> <span class="sourceLineNo">134</span> }<a name="line.134"></a> <span class="sourceLineNo">135</span><a name="line.135"></a> @@ -149,7 +149,7 @@ <span class="sourceLineNo">141</span> * Commons RDF {@link Triple} to adapt<a name="line.141"></a> <span class="sourceLineNo">142</span> * @return Adapted JsonLd {@link com.github.jsonldjava.core.RDFDataset.Quad}<a name="line.142"></a> <span class="sourceLineNo">143</span> */<a name="line.143"></a> -<span class="sourceLineNo">144</span> public RDFDataset.Quad asJsonLdQuad(Triple triple) {<a name="line.144"></a> +<span class="sourceLineNo">144</span> public RDFDataset.Quad asJsonLdQuad(final Triple triple) {<a name="line.144"></a> <span class="sourceLineNo">145</span> return createJsonLdQuad(null, triple.getSubject(), triple.getPredicate(), triple.getObject());<a name="line.145"></a> <span class="sourceLineNo">146</span> }<a name="line.146"></a> <span class="sourceLineNo">147</span><a name="line.147"></a> @@ -217,19 +217,19 @@ <span class="sourceLineNo">209</span> * JsonLd {@link RDFDataset} to adapt<a name="line.209"></a> <span class="sourceLineNo">210</span> * @return Adapted {@link Dataset}<a name="line.210"></a> <span class="sourceLineNo">211</span> */<a name="line.211"></a> -<span class="sourceLineNo">212</span> public JsonLdUnionGraph asUnionGraph(RDFDataset rdfDataSet) {<a name="line.212"></a> +<span class="sourceLineNo">212</span> public JsonLdUnionGraph asUnionGraph(final RDFDataset rdfDataSet) {<a name="line.212"></a> <span class="sourceLineNo">213</span> return new JsonLdUnionGraphImpl(rdfDataSet);<a name="line.213"></a> <span class="sourceLineNo">214</span> }<a name="line.214"></a> <span class="sourceLineNo">215</span><a name="line.215"></a> <span class="sourceLineNo">216</span> @Override<a name="line.216"></a> <span class="sourceLineNo">217</span> public JsonLdBlankNode createBlankNode() {<a name="line.217"></a> -<span class="sourceLineNo">218</span> String id = "_:" + UUID.randomUUID().toString();<a name="line.218"></a> +<span class="sourceLineNo">218</span> final String id = "_:" + UUID.randomUUID().toString();<a name="line.218"></a> <span class="sourceLineNo">219</span> return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);<a name="line.219"></a> <span class="sourceLineNo">220</span> }<a name="line.220"></a> <span class="sourceLineNo">221</span><a name="line.221"></a> <span class="sourceLineNo">222</span> @Override<a name="line.222"></a> -<span class="sourceLineNo">223</span> public JsonLdBlankNode createBlankNode(String name) {<a name="line.223"></a> -<span class="sourceLineNo">224</span> String id = "_:" + name;<a name="line.224"></a> +<span class="sourceLineNo">223</span> public JsonLdBlankNode createBlankNode(final String name) {<a name="line.223"></a> +<span class="sourceLineNo">224</span> final String id = "_:" + name;<a name="line.224"></a> <span class="sourceLineNo">225</span> // TODO: Check if name is valid JSON-LD BlankNode identifier<a name="line.225"></a> <span class="sourceLineNo">226</span> return new JsonLdBlankNodeImpl(new RDFDataset.BlankNode(id), bnodePrefix);<a name="line.226"></a> <span class="sourceLineNo">227</span> }<a name="line.227"></a> @@ -245,45 +245,45 @@ <span class="sourceLineNo">237</span> }<a name="line.237"></a> <span class="sourceLineNo">238</span><a name="line.238"></a> <span class="sourceLineNo">239</span> @Override<a name="line.239"></a> -<span class="sourceLineNo">240</span> public JsonLdIRI createIRI(String iri) {<a name="line.240"></a> +<span class="sourceLineNo">240</span> public JsonLdIRI createIRI(final String iri) {<a name="line.240"></a> <span class="sourceLineNo">241</span> return new JsonLdIRIImpl(iri);<a name="line.241"></a> <span class="sourceLineNo">242</span> }<a name="line.242"></a> <span class="sourceLineNo">243</span><a name="line.243"></a> <span class="sourceLineNo">244</span> @Override<a name="line.244"></a> -<span class="sourceLineNo">245</span> public JsonLdLiteral createLiteral(String literal) {<a name="line.245"></a> +<span class="sourceLineNo">245</span> public JsonLdLiteral createLiteral(final String literal) {<a name="line.245"></a> <span class="sourceLineNo">246</span> return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, null, null));<a name="line.246"></a> <span class="sourceLineNo">247</span> }<a name="line.247"></a> <span class="sourceLineNo">248</span><a name="line.248"></a> <span class="sourceLineNo">249</span> @Override<a name="line.249"></a> -<span class="sourceLineNo">250</span> public JsonLdLiteral createLiteral(String literal, IRI dataType) {<a name="line.250"></a> +<span class="sourceLineNo">250</span> public JsonLdLiteral createLiteral(final String literal, final IRI dataType) {<a name="line.250"></a> <span class="sourceLineNo">251</span> return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, dataType.getIRIString(), null));<a name="line.251"></a> <span class="sourceLineNo">252</span> }<a name="line.252"></a> <span class="sourceLineNo">253</span><a name="line.253"></a> <span class="sourceLineNo">254</span> @Override<a name="line.254"></a> -<span class="sourceLineNo">255</span> public JsonLdLiteral createLiteral(String literal, String language) {<a name="line.255"></a> +<span class="sourceLineNo">255</span> public JsonLdLiteral createLiteral(final String literal, final String language) {<a name="line.255"></a> <span class="sourceLineNo">256</span> return new JsonLdLiteralImpl(new RDFDataset.Literal(literal, Types.RDF_LANGSTRING.getIRIString(), language));<a name="line.256"></a> <span class="sourceLineNo">257</span> }<a name="line.257"></a> <span class="sourceLineNo">258</span><a name="line.258"></a> <span class="sourceLineNo">259</span> @Override<a name="line.259"></a> -<span class="sourceLineNo">260</span> public JsonLdQuad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object)<a name="line.260"></a> +<span class="sourceLineNo">260</span> public JsonLdQuad createQuad(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object)<a name="line.260"></a> <span class="sourceLineNo">261</span> throws IllegalArgumentException, UnsupportedOperationException {<a name="line.261"></a> <span class="sourceLineNo">262</span> return new JsonLdQuadImpl(createJsonLdQuad(graphName, subject, predicate, object), bnodePrefix);<a name="line.262"></a> <span class="sourceLineNo">263</span> }<a name="line.263"></a> <span class="sourceLineNo">264</span><a name="line.264"></a> <span class="sourceLineNo">265</span> @Override<a name="line.265"></a> -<span class="sourceLineNo">266</span> public JsonLdTriple createTriple(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {<a name="line.266"></a> +<span class="sourceLineNo">266</span> public JsonLdTriple createTriple(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {<a name="line.266"></a> <span class="sourceLineNo">267</span> return new JsonLdTripleImpl(createJsonLdQuad(null, subject, predicate, object), bnodePrefix);<a name="line.267"></a> <span class="sourceLineNo">268</span> }<a name="line.268"></a> <span class="sourceLineNo">269</span><a name="line.269"></a> -<span class="sourceLineNo">270</span> String asJsonLdString(BlankNodeOrIRI blankNodeOrIRI) {<a name="line.270"></a> +<span class="sourceLineNo">270</span> String asJsonLdString(final BlankNodeOrIRI blankNodeOrIRI) {<a name="line.270"></a> <span class="sourceLineNo">271</span> if (blankNodeOrIRI == null) {<a name="line.271"></a> <span class="sourceLineNo">272</span> return null;<a name="line.272"></a> <span class="sourceLineNo">273</span> }<a name="line.273"></a> <span class="sourceLineNo">274</span> if (blankNodeOrIRI instanceof IRI) {<a name="line.274"></a> <span class="sourceLineNo">275</span> return ((IRI) blankNodeOrIRI).getIRIString();<a name="line.275"></a> <span class="sourceLineNo">276</span> } else if (blankNodeOrIRI instanceof BlankNode) {<a name="line.276"></a> -<span class="sourceLineNo">277</span> BlankNode blankNode = (BlankNode) blankNodeOrIRI;<a name="line.277"></a> -<span class="sourceLineNo">278</span> String ref = blankNode.uniqueReference();<a name="line.278"></a> +<span class="sourceLineNo">277</span> final BlankNode blankNode = (BlankNode) blankNodeOrIRI;<a name="line.277"></a> +<span class="sourceLineNo">278</span> final String ref = blankNode.uniqueReference();<a name="line.278"></a> <span class="sourceLineNo">279</span> if (ref.startsWith(bnodePrefix)) {<a name="line.279"></a> <span class="sourceLineNo">280</span> // One of ours (but possibly not a JsonLdBlankNode) -<a name="line.280"></a> <span class="sourceLineNo">281</span> // we can use the suffix directly<a name="line.281"></a> @@ -291,7 +291,7 @@ <span class="sourceLineNo">283</span> } else {<a name="line.283"></a> <span class="sourceLineNo">284</span> // Map to unique bnode identifier, e.g.<a name="line.284"></a> <span class="sourceLineNo">285</span> // _:0dbd92ee-ab1a-45e7-bba2-7ade54f87ec5<a name="line.285"></a> -<span class="sourceLineNo">286</span> UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));<a name="line.286"></a> +<span class="sourceLineNo">286</span> final UUID uuid = UUID.nameUUIDFromBytes(ref.getBytes(StandardCharsets.UTF_8));<a name="line.286"></a> <span class="sourceLineNo">287</span> return "_:" + uuid;<a name="line.287"></a> <span class="sourceLineNo">288</span> }<a name="line.288"></a> <span class="sourceLineNo">289</span> } else {<a name="line.289"></a> @@ -299,7 +299,7 @@ <span class="sourceLineNo">291</span> }<a name="line.291"></a> <span class="sourceLineNo">292</span> }<a name="line.292"></a> <span class="sourceLineNo">293</span><a name="line.293"></a> -<span class="sourceLineNo">294</span> JsonLdTerm asRDFTerm(final Node node, String blankNodePrefix) {<a name="line.294"></a> +<span class="sourceLineNo">294</span> JsonLdTerm asRDFTerm(final Node node, final String blankNodePrefix) {<a name="line.294"></a> <span class="sourceLineNo">295</span> if (node == null) {<a name="line.295"></a> <span class="sourceLineNo">296</span> return null; // e.g. default graph<a name="line.296"></a> <span class="sourceLineNo">297</span> }<a name="line.297"></a> @@ -319,7 +319,7 @@ <span class="sourceLineNo">311</span> }<a name="line.311"></a> <span class="sourceLineNo">312</span> }<a name="line.312"></a> <span class="sourceLineNo">313</span><a name="line.313"></a> -<span class="sourceLineNo">314</span> RDFDataset.Quad createJsonLdQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {<a name="line.314"></a> +<span class="sourceLineNo">314</span> RDFDataset.Quad createJsonLdQuad(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {<a name="line.314"></a> <span class="sourceLineNo">315</span> return new RDFDataset.Quad(asJsonLdNode(subject), asJsonLdNode(predicate), asJsonLdNode(object),<a name="line.315"></a> <span class="sourceLineNo">316</span> asJsonLdString(graphName));<a name="line.316"></a> <span class="sourceLineNo">317</span> }<a name="line.317"></a>
Modified: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdTerm.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdTerm.html (original) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdTerm.html Tue Nov 22 07:55:35 2016 @@ -42,20 +42,21 @@ <span class="sourceLineNo">034</span>abstract class JsonLdTermImpl implements JsonLdTerm {<a name="line.34"></a> <span class="sourceLineNo">035</span> final Node node;<a name="line.35"></a> <span class="sourceLineNo">036</span><a name="line.36"></a> -<span class="sourceLineNo">037</span> JsonLdTermImpl(Node node) {<a name="line.37"></a> +<span class="sourceLineNo">037</span> JsonLdTermImpl(final Node node) {<a name="line.37"></a> <span class="sourceLineNo">038</span> this.node = node;<a name="line.38"></a> <span class="sourceLineNo">039</span> }<a name="line.39"></a> <span class="sourceLineNo">040</span><a name="line.40"></a> -<span class="sourceLineNo">041</span> public Node asJsonLdNode() {<a name="line.41"></a> -<span class="sourceLineNo">042</span> return node;<a name="line.42"></a> -<span class="sourceLineNo">043</span> }<a name="line.43"></a> -<span class="sourceLineNo">044</span> <a name="line.44"></a> -<span class="sourceLineNo">045</span> @Override<a name="line.45"></a> -<span class="sourceLineNo">046</span> public String toString() {<a name="line.46"></a> -<span class="sourceLineNo">047</span> return ntriplesString();<a name="line.47"></a> -<span class="sourceLineNo">048</span> }<a name="line.48"></a> -<span class="sourceLineNo">049</span> <a name="line.49"></a> -<span class="sourceLineNo">050</span>}<a name="line.50"></a> +<span class="sourceLineNo">041</span> @Override<a name="line.41"></a> +<span class="sourceLineNo">042</span> public Node asJsonLdNode() {<a name="line.42"></a> +<span class="sourceLineNo">043</span> return node;<a name="line.43"></a> +<span class="sourceLineNo">044</span> }<a name="line.44"></a> +<span class="sourceLineNo">045</span> <a name="line.45"></a> +<span class="sourceLineNo">046</span> @Override<a name="line.46"></a> +<span class="sourceLineNo">047</span> public String toString() {<a name="line.47"></a> +<span class="sourceLineNo">048</span> return ntriplesString();<a name="line.48"></a> +<span class="sourceLineNo">049</span> }<a name="line.49"></a> +<span class="sourceLineNo">050</span> <a name="line.50"></a> +<span class="sourceLineNo">051</span>}<a name="line.51"></a> Modified: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdTriple.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdTriple.html (original) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdTriple.html Tue Nov 22 07:55:35 2016 @@ -40,16 +40,16 @@ <span class="sourceLineNo">032</span><a name="line.32"></a> <span class="sourceLineNo">033</span>final class JsonLdTripleImpl extends JsonLdQuadLikeImpl<BlankNodeOrIRI, IRI, RDFTerm, RDFTerm> implements JsonLdTriple {<a name="line.33"></a> <span class="sourceLineNo">034</span><a name="line.34"></a> -<span class="sourceLineNo">035</span> JsonLdTripleImpl(Quad quad, String blankNodePrefix) {<a name="line.35"></a> +<span class="sourceLineNo">035</span> JsonLdTripleImpl(final Quad quad, final String blankNodePrefix) {<a name="line.35"></a> <span class="sourceLineNo">036</span> super(quad, blankNodePrefix);<a name="line.36"></a> <span class="sourceLineNo">037</span> }<a name="line.37"></a> <span class="sourceLineNo">038</span><a name="line.38"></a> <span class="sourceLineNo">039</span> @Override<a name="line.39"></a> -<span class="sourceLineNo">040</span> public boolean equals(Object obj) {<a name="line.40"></a> +<span class="sourceLineNo">040</span> public boolean equals(final Object obj) {<a name="line.40"></a> <span class="sourceLineNo">041</span> if (!(obj instanceof Triple)) {<a name="line.41"></a> <span class="sourceLineNo">042</span> return false;<a name="line.42"></a> <span class="sourceLineNo">043</span> }<a name="line.43"></a> -<span class="sourceLineNo">044</span> Triple other = (Triple) obj;<a name="line.44"></a> +<span class="sourceLineNo">044</span> final Triple other = (Triple) obj;<a name="line.44"></a> <span class="sourceLineNo">045</span> return getSubject().equals(other.getSubject()) && getPredicate().equals(other.getPredicate())<a name="line.45"></a> <span class="sourceLineNo">046</span> && getObject().equals(other.getObject());<a name="line.46"></a> <span class="sourceLineNo">047</span> }<a name="line.47"></a> Modified: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdUnionGraph.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdUnionGraph.html (original) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/JsonLdUnionGraph.html Tue Nov 22 07:55:35 2016 @@ -58,41 +58,41 @@ <span class="sourceLineNo">050</span>class JsonLdUnionGraphImpl extends AbstractJsonLdGraphLike<org.apache.commons.rdf.api.Triple><a name="line.50"></a> <span class="sourceLineNo">051</span> implements JsonLdUnionGraph {<a name="line.51"></a> <span class="sourceLineNo">052</span><a name="line.52"></a> -<span class="sourceLineNo">053</span> JsonLdUnionGraphImpl(String bnodePrefix) {<a name="line.53"></a> +<span class="sourceLineNo">053</span> JsonLdUnionGraphImpl(final String bnodePrefix) {<a name="line.53"></a> <span class="sourceLineNo">054</span> super(bnodePrefix);<a name="line.54"></a> <span class="sourceLineNo">055</span> }<a name="line.55"></a> <span class="sourceLineNo">056</span><a name="line.56"></a> -<span class="sourceLineNo">057</span> JsonLdUnionGraphImpl(RDFDataset rdfDataSet) {<a name="line.57"></a> +<span class="sourceLineNo">057</span> JsonLdUnionGraphImpl(final RDFDataset rdfDataSet) {<a name="line.57"></a> <span class="sourceLineNo">058</span> super(rdfDataSet);<a name="line.58"></a> <span class="sourceLineNo">059</span> }<a name="line.59"></a> <span class="sourceLineNo">060</span><a name="line.60"></a> -<span class="sourceLineNo">061</span> JsonLdUnionGraphImpl(RDFDataset rdfDataSet, String bnodePrefix) {<a name="line.61"></a> +<span class="sourceLineNo">061</span> JsonLdUnionGraphImpl(final RDFDataset rdfDataSet, final String bnodePrefix) {<a name="line.61"></a> <span class="sourceLineNo">062</span> super(rdfDataSet, bnodePrefix);<a name="line.62"></a> <span class="sourceLineNo">063</span> }<a name="line.63"></a> <span class="sourceLineNo">064</span><a name="line.64"></a> <span class="sourceLineNo">065</span> @Override<a name="line.65"></a> -<span class="sourceLineNo">066</span> public void add(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {<a name="line.66"></a> +<span class="sourceLineNo">066</span> public void add(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {<a name="line.66"></a> <span class="sourceLineNo">067</span> super.add(null, subject, predicate, object);<a name="line.67"></a> <span class="sourceLineNo">068</span> }<a name="line.68"></a> <span class="sourceLineNo">069</span><a name="line.69"></a> <span class="sourceLineNo">070</span> @Override<a name="line.70"></a> -<span class="sourceLineNo">071</span> public boolean contains(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {<a name="line.71"></a> +<span class="sourceLineNo">071</span> public boolean contains(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {<a name="line.71"></a> <span class="sourceLineNo">072</span> return super.contains(null, subject, predicate, object);<a name="line.72"></a> <span class="sourceLineNo">073</span> }<a name="line.73"></a> <span class="sourceLineNo">074</span><a name="line.74"></a> <span class="sourceLineNo">075</span> @Override<a name="line.75"></a> -<span class="sourceLineNo">076</span> public void remove(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {<a name="line.76"></a> +<span class="sourceLineNo">076</span> public void remove(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {<a name="line.76"></a> <span class="sourceLineNo">077</span> super.remove(null, subject, predicate, object);<a name="line.77"></a> <span class="sourceLineNo">078</span> }<a name="line.78"></a> <span class="sourceLineNo">079</span><a name="line.79"></a> <span class="sourceLineNo">080</span> @Override<a name="line.80"></a> -<span class="sourceLineNo">081</span> public void remove(Triple t) {<a name="line.81"></a> +<span class="sourceLineNo">081</span> public void remove(final Triple t) {<a name="line.81"></a> <span class="sourceLineNo">082</span> // Remove from ALL graphs, not just default graph<a name="line.82"></a> <span class="sourceLineNo">083</span> super.remove(null, t.getSubject(), t.getPredicate(), t.getObject());<a name="line.83"></a> <span class="sourceLineNo">084</span> }<a name="line.84"></a> <span class="sourceLineNo">085</span><a name="line.85"></a> <span class="sourceLineNo">086</span> @Override<a name="line.86"></a> -<span class="sourceLineNo">087</span> public Stream<JsonLdTriple> stream(BlankNodeOrIRI subject, IRI predicate, RDFTerm object) {<a name="line.87"></a> +<span class="sourceLineNo">087</span> public Stream<JsonLdTriple> stream(final BlankNodeOrIRI subject, final IRI predicate, final RDFTerm object) {<a name="line.87"></a> <span class="sourceLineNo">088</span> return filteredGraphs(null).flatMap(List::stream).filter(quadFilter(subject, predicate, object))<a name="line.88"></a> <span class="sourceLineNo">089</span> .map(factory::asTriple)<a name="line.89"></a> <span class="sourceLineNo">090</span> // Make sure we don't have duplicate triples<a name="line.90"></a> @@ -108,7 +108,7 @@ <span class="sourceLineNo">100</span> }<a name="line.100"></a> <span class="sourceLineNo">101</span><a name="line.101"></a> <span class="sourceLineNo">102</span> @Override<a name="line.102"></a> -<span class="sourceLineNo">103</span> JsonLdTriple asTripleOrQuad(com.github.jsonldjava.core.RDFDataset.Quad jsonldQuad) {<a name="line.103"></a> +<span class="sourceLineNo">103</span> JsonLdTriple asTripleOrQuad(final com.github.jsonldjava.core.RDFDataset.Quad jsonldQuad) {<a name="line.103"></a> <span class="sourceLineNo">104</span> return factory.asTriple(jsonldQuad);<a name="line.104"></a> <span class="sourceLineNo">105</span> }<a name="line.105"></a> <span class="sourceLineNo">106</span><a name="line.106"></a> Modified: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.html (original) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/jsonldjava/experimental/JsonLdParser.html Tue Nov 22 07:55:35 2016 @@ -57,7 +57,7 @@ <span class="sourceLineNo">049</span> }<a name="line.49"></a> <span class="sourceLineNo">050</span><a name="line.50"></a> <span class="sourceLineNo">051</span> @Override<a name="line.51"></a> -<span class="sourceLineNo">052</span> public JsonLdParser contentType(RDFSyntax rdfSyntax) throws IllegalArgumentException {<a name="line.52"></a> +<span class="sourceLineNo">052</span> public JsonLdParser contentType(final RDFSyntax rdfSyntax) throws IllegalArgumentException {<a name="line.52"></a> <span class="sourceLineNo">053</span> if (rdfSyntax != null && rdfSyntax != RDFSyntax.JSONLD) {<a name="line.53"></a> <span class="sourceLineNo">054</span> throw new IllegalArgumentException("Unsupported contentType: " + rdfSyntax);<a name="line.54"></a> <span class="sourceLineNo">055</span> }<a name="line.55"></a> @@ -65,15 +65,15 @@ <span class="sourceLineNo">057</span> }<a name="line.57"></a> <span class="sourceLineNo">058</span><a name="line.58"></a> <span class="sourceLineNo">059</span> @Override<a name="line.59"></a> -<span class="sourceLineNo">060</span> public JsonLdParser contentType(String contentType) throws IllegalArgumentException {<a name="line.60"></a> -<span class="sourceLineNo">061</span> JsonLdParser c = (JsonLdParser) super.contentType(contentType);<a name="line.61"></a> +<span class="sourceLineNo">060</span> public JsonLdParser contentType(final String contentType) throws IllegalArgumentException {<a name="line.60"></a> +<span class="sourceLineNo">061</span> final JsonLdParser c = super.contentType(contentType);<a name="line.61"></a> <span class="sourceLineNo">062</span> if (c.getContentType().filter(Predicate.isEqual(RDFSyntax.JSONLD).negate()).isPresent()) {<a name="line.62"></a> <span class="sourceLineNo">063</span> throw new IllegalArgumentException("Unsupported contentType: " + contentType);<a name="line.63"></a> <span class="sourceLineNo">064</span> }<a name="line.64"></a> <span class="sourceLineNo">065</span> return c;<a name="line.65"></a> <span class="sourceLineNo">066</span> }<a name="line.66"></a> <span class="sourceLineNo">067</span><a name="line.67"></a> -<span class="sourceLineNo">068</span> private static URL asURL(IRI iri) throws IllegalStateException {<a name="line.68"></a> +<span class="sourceLineNo">068</span> private static URL asURL(final IRI iri) throws IllegalStateException {<a name="line.68"></a> <span class="sourceLineNo">069</span> try {<a name="line.69"></a> <span class="sourceLineNo">070</span> return new URI(iri.getIRIString()).toURL();<a name="line.70"></a> <span class="sourceLineNo">071</span> } catch (MalformedURLException | URISyntaxException e) {<a name="line.71"></a> @@ -90,8 +90,8 @@ <span class="sourceLineNo">082</span><a name="line.82"></a> <span class="sourceLineNo">083</span> @Override<a name="line.83"></a> <span class="sourceLineNo">084</span> protected void parseSynchronusly() throws IOException {<a name="line.84"></a> -<span class="sourceLineNo">085</span> Object json = readSource();<a name="line.85"></a> -<span class="sourceLineNo">086</span> JsonLdOptions options = new JsonLdOptions();<a name="line.86"></a> +<span class="sourceLineNo">085</span> final Object json = readSource();<a name="line.85"></a> +<span class="sourceLineNo">086</span> final JsonLdOptions options = new JsonLdOptions();<a name="line.86"></a> <span class="sourceLineNo">087</span> getBase().map(IRI::getIRIString).ifPresent(options::setBase);<a name="line.87"></a> <span class="sourceLineNo">088</span> // TODO: base from readSource() (after redirection and Content-Location<a name="line.88"></a> <span class="sourceLineNo">089</span> // header)<a name="line.89"></a> @@ -101,26 +101,26 @@ <span class="sourceLineNo">093</span> RDFDataset rdfDataset;<a name="line.93"></a> <span class="sourceLineNo">094</span> try {<a name="line.94"></a> <span class="sourceLineNo">095</span> rdfDataset = (RDFDataset) JsonLdProcessor.toRDF(json, options);<a name="line.95"></a> -<span class="sourceLineNo">096</span> } catch (JsonLdError e) {<a name="line.96"></a> +<span class="sourceLineNo">096</span> } catch (final JsonLdError e) {<a name="line.96"></a> <span class="sourceLineNo">097</span> throw new IOException("Could not parse Json-LD", e);<a name="line.97"></a> <span class="sourceLineNo">098</span> }<a name="line.98"></a> <span class="sourceLineNo">099</span> if (getTargetGraph().isPresent()) {<a name="line.99"></a> -<span class="sourceLineNo">100</span> Graph intoGraph = getTargetGraph().get();<a name="line.100"></a> +<span class="sourceLineNo">100</span> final Graph intoGraph = getTargetGraph().get();<a name="line.100"></a> <span class="sourceLineNo">101</span> if (intoGraph instanceof JsonLdGraph && !intoGraph.contains(null, null, null)) {<a name="line.101"></a> <span class="sourceLineNo">102</span> // Empty graph, we can just move over the map content directly:<a name="line.102"></a> -<span class="sourceLineNo">103</span> JsonLdGraph jsonLdGraph = (JsonLdGraph) intoGraph;<a name="line.103"></a> +<span class="sourceLineNo">103</span> final JsonLdGraph jsonLdGraph = (JsonLdGraph) intoGraph;<a name="line.103"></a> <span class="sourceLineNo">104</span> jsonLdGraph.getRdfDataSet().putAll(rdfDataset);<a name="line.104"></a> <span class="sourceLineNo">105</span> return;<a name="line.105"></a> <span class="sourceLineNo">106</span> // otherwise we have to merge as normal<a name="line.106"></a> <span class="sourceLineNo">107</span> }<a name="line.107"></a> <span class="sourceLineNo">108</span> // TODO: Modify JsonLdProcessor to have an actual triple callback<a name="line.108"></a> -<span class="sourceLineNo">109</span> Graph parsedGraph = getJsonLdFactory().asGraph(rdfDataset);<a name="line.109"></a> +<span class="sourceLineNo">109</span> final Graph parsedGraph = getJsonLdFactory().asGraph(rdfDataset);<a name="line.109"></a> <span class="sourceLineNo">110</span> // sequential() as we don't know if destination is thread safe :-/<a name="line.110"></a> <span class="sourceLineNo">111</span> parsedGraph.stream().sequential().forEach(intoGraph::add);<a name="line.111"></a> <span class="sourceLineNo">112</span> } else if (getTargetDataset().isPresent()) {<a name="line.112"></a> -<span class="sourceLineNo">113</span> Dataset intoDataset = getTargetDataset().get();<a name="line.113"></a> +<span class="sourceLineNo">113</span> final Dataset intoDataset = getTargetDataset().get();<a name="line.113"></a> <span class="sourceLineNo">114</span> if (intoDataset instanceof JsonLdDataset && !intoDataset.contains(null, null, null, null)) {<a name="line.114"></a> -<span class="sourceLineNo">115</span> JsonLdDataset jsonLdDataset = (JsonLdDataset) intoDataset;<a name="line.115"></a> +<span class="sourceLineNo">115</span> final JsonLdDataset jsonLdDataset = (JsonLdDataset) intoDataset;<a name="line.115"></a> <span class="sourceLineNo">116</span> // Empty - we can just do a brave replace!<a name="line.116"></a> <span class="sourceLineNo">117</span> jsonLdDataset.getRdfDataSet().putAll(rdfDataset);<a name="line.117"></a> <span class="sourceLineNo">118</span> return;<a name="line.118"></a> @@ -129,11 +129,11 @@ <span class="sourceLineNo">121</span> // map blank nodes etc, so we'll fall back to normal Dataset<a name="line.121"></a> <span class="sourceLineNo">122</span> // appending.<a name="line.122"></a> <span class="sourceLineNo">123</span> }<a name="line.123"></a> -<span class="sourceLineNo">124</span> Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);<a name="line.124"></a> +<span class="sourceLineNo">124</span> final Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);<a name="line.124"></a> <span class="sourceLineNo">125</span> // .sequential() as we don't know if destination is thread-safe :-/<a name="line.125"></a> <span class="sourceLineNo">126</span> fromDataset.stream().sequential().forEach(intoDataset::add);<a name="line.126"></a> <span class="sourceLineNo">127</span> } else {<a name="line.127"></a> -<span class="sourceLineNo">128</span> Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);<a name="line.128"></a> +<span class="sourceLineNo">128</span> final Dataset fromDataset = getJsonLdFactory().asDataset(rdfDataset);<a name="line.128"></a> <span class="sourceLineNo">129</span> // No need for .sequential() here<a name="line.129"></a> <span class="sourceLineNo">130</span> fromDataset.stream().forEach(getTarget());<a name="line.130"></a> <span class="sourceLineNo">131</span> }<a name="line.131"></a> Modified: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/rdf4j/RDF4J.Option.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/rdf4j/RDF4J.Option.html (original) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/rdf4j/RDF4J.Option.html Tue Nov 22 07:55:35 2016 @@ -150,7 +150,7 @@ <span class="sourceLineNo">142</span> * @param valueFactory<a name="line.142"></a> <span class="sourceLineNo">143</span> * The RDF4J {@link ValueFactory} to use<a name="line.143"></a> <span class="sourceLineNo">144</span> */<a name="line.144"></a> -<span class="sourceLineNo">145</span> public RDF4J(ValueFactory valueFactory) {<a name="line.145"></a> +<span class="sourceLineNo">145</span> public RDF4J(final ValueFactory valueFactory) {<a name="line.145"></a> <span class="sourceLineNo">146</span> this(valueFactory, UUID.randomUUID());<a name="line.146"></a> <span class="sourceLineNo">147</span> }<a name="line.147"></a> <span class="sourceLineNo">148</span><a name="line.148"></a> @@ -165,7 +165,7 @@ <span class="sourceLineNo">157</span> * {@link BlankNode}s for the purpose of<a name="line.157"></a> <span class="sourceLineNo">158</span> * {@link BlankNode#uniqueReference()}<a name="line.158"></a> <span class="sourceLineNo">159</span> */<a name="line.159"></a> -<span class="sourceLineNo">160</span> public RDF4J(UUID salt) {<a name="line.160"></a> +<span class="sourceLineNo">160</span> public RDF4J(final UUID salt) {<a name="line.160"></a> <span class="sourceLineNo">161</span> this(SimpleValueFactory.getInstance(), salt);<a name="line.161"></a> <span class="sourceLineNo">162</span> }<a name="line.162"></a> <span class="sourceLineNo">163</span><a name="line.163"></a> @@ -182,7 +182,7 @@ <span class="sourceLineNo">174</span> * {@link BlankNode}s for the purpose of<a name="line.174"></a> <span class="sourceLineNo">175</span> * {@link BlankNode#uniqueReference()}<a name="line.175"></a> <span class="sourceLineNo">176</span> */<a name="line.176"></a> -<span class="sourceLineNo">177</span> public RDF4J(ValueFactory valueFactory, UUID salt) {<a name="line.177"></a> +<span class="sourceLineNo">177</span> public RDF4J(final ValueFactory valueFactory, final UUID salt) {<a name="line.177"></a> <span class="sourceLineNo">178</span> this.valueFactory = valueFactory;<a name="line.178"></a> <span class="sourceLineNo">179</span> this.salt = salt;<a name="line.179"></a> <span class="sourceLineNo">180</span> }<a name="line.180"></a> @@ -236,7 +236,7 @@ <span class="sourceLineNo">228</span> * @throws IllegalArgumentException<a name="line.228"></a> <span class="sourceLineNo">229</span> * if the value is not a BNode, Literal or IRI<a name="line.229"></a> <span class="sourceLineNo">230</span> */<a name="line.230"></a> -<span class="sourceLineNo">231</span> public RDF4JTerm asRDFTerm(Value value) {<a name="line.231"></a> +<span class="sourceLineNo">231</span> public RDF4JTerm asRDFTerm(final Value value) {<a name="line.231"></a> <span class="sourceLineNo">232</span> return asRDFTerm(value, salt);<a name="line.232"></a> <span class="sourceLineNo">233</span> }<a name="line.233"></a> <span class="sourceLineNo">234</span><a name="line.234"></a> @@ -263,7 +263,7 @@ <span class="sourceLineNo">255</span> * @throws IllegalArgumentException<a name="line.255"></a> <span class="sourceLineNo">256</span> * if the value is not a BNode, Literal or IRI<a name="line.256"></a> <span class="sourceLineNo">257</span> */<a name="line.257"></a> -<span class="sourceLineNo">258</span> public static RDF4JTerm asRDFTerm(final Value value, UUID salt) {<a name="line.258"></a> +<span class="sourceLineNo">258</span> public static RDF4JTerm asRDFTerm(final Value value, final UUID salt) {<a name="line.258"></a> <span class="sourceLineNo">259</span> if (value instanceof BNode) {<a name="line.259"></a> <span class="sourceLineNo">260</span> return rdf4j.createBlankNodeImpl((BNode) value, salt);<a name="line.260"></a> <span class="sourceLineNo">261</span> }<a name="line.261"></a> @@ -292,8 +292,8 @@ <span class="sourceLineNo">284</span> * Zero or more {@link Option}<a name="line.284"></a> <span class="sourceLineNo">285</span> * @return A {@link Dataset} backed by the RDF4J repository.<a name="line.285"></a> <span class="sourceLineNo">286</span> */<a name="line.286"></a> -<span class="sourceLineNo">287</span> public RDF4JDataset asDataset(Repository repository, Option... options) {<a name="line.287"></a> -<span class="sourceLineNo">288</span> EnumSet<Option> opts = optionSet(options);<a name="line.288"></a> +<span class="sourceLineNo">287</span> public RDF4JDataset asDataset(final Repository repository, final Option... options) {<a name="line.287"></a> +<span class="sourceLineNo">288</span> final EnumSet<Option> opts = optionSet(options);<a name="line.288"></a> <span class="sourceLineNo">289</span> return rdf4j.createRepositoryDatasetImpl(repository, opts.contains(Option.handleInitAndShutdown),<a name="line.289"></a> <span class="sourceLineNo">290</span> opts.contains(Option.includeInferred));<a name="line.290"></a> <span class="sourceLineNo">291</span> }<a name="line.291"></a> @@ -307,7 +307,7 @@ <span class="sourceLineNo">299</span> * RDF4J {@link Model} to adapt.<a name="line.299"></a> <span class="sourceLineNo">300</span> * @return Adapted {@link Graph}.<a name="line.300"></a> <span class="sourceLineNo">301</span> */<a name="line.301"></a> -<span class="sourceLineNo">302</span> public RDF4JGraph asGraph(Model model) {<a name="line.302"></a> +<span class="sourceLineNo">302</span> public RDF4JGraph asGraph(final Model model) {<a name="line.302"></a> <span class="sourceLineNo">303</span> return rdf4j.createModelGraphImpl(model, this);<a name="line.303"></a> <span class="sourceLineNo">304</span> }<a name="line.304"></a> <span class="sourceLineNo">305</span><a name="line.305"></a> @@ -330,8 +330,8 @@ <span class="sourceLineNo">322</span> * Zero or more {@link Option}<a name="line.322"></a> <span class="sourceLineNo">323</span> * @return A {@link Graph} backed by the RDF4J repository.<a name="line.323"></a> <span class="sourceLineNo">324</span> */<a name="line.324"></a> -<span class="sourceLineNo">325</span> public RDF4JGraph asGraph(Repository repository, Option... options) {<a name="line.325"></a> -<span class="sourceLineNo">326</span> EnumSet<Option> opts = optionSet(options);<a name="line.326"></a> +<span class="sourceLineNo">325</span> public RDF4JGraph asGraph(final Repository repository, final Option... options) {<a name="line.325"></a> +<span class="sourceLineNo">326</span> final EnumSet<Option> opts = optionSet(options);<a name="line.326"></a> <span class="sourceLineNo">327</span> return rdf4j.createRepositoryGraphImpl(repository, opts.contains(Option.handleInitAndShutdown),<a name="line.327"></a> <span class="sourceLineNo">328</span> opts.contains(Option.includeInferred), new Resource[] { null }); // default<a name="line.328"></a> <span class="sourceLineNo">329</span> // graph<a name="line.329"></a> @@ -350,8 +350,8 @@ <span class="sourceLineNo">342</span> * Zero or more {@link Option}<a name="line.342"></a> <span class="sourceLineNo">343</span> * @return A union {@link Graph} backed by the RDF4J repository.<a name="line.343"></a> <span class="sourceLineNo">344</span> */<a name="line.344"></a> -<span class="sourceLineNo">345</span> public RDF4JGraph asGraphUnion(Repository repository, Option... options) {<a name="line.345"></a> -<span class="sourceLineNo">346</span> EnumSet<Option> opts = optionSet(options);<a name="line.346"></a> +<span class="sourceLineNo">345</span> public RDF4JGraph asGraphUnion(final Repository repository, final Option... options) {<a name="line.345"></a> +<span class="sourceLineNo">346</span> final EnumSet<Option> opts = optionSet(options);<a name="line.346"></a> <span class="sourceLineNo">347</span> return rdf4j.createRepositoryGraphImpl(repository, opts.contains(Option.handleInitAndShutdown),<a name="line.347"></a> <span class="sourceLineNo">348</span> opts.contains(Option.includeInferred), new Resource[] {}); // union<a name="line.348"></a> <span class="sourceLineNo">349</span> // graph<a name="line.349"></a> @@ -383,10 +383,10 @@ <span class="sourceLineNo">375</span> * Zero or more {@link Option}s<a name="line.375"></a> <span class="sourceLineNo">376</span> * @return A {@link Graph} backed by the RDF4J repository.<a name="line.376"></a> <span class="sourceLineNo">377</span> */<a name="line.377"></a> -<span class="sourceLineNo">378</span> public RDF4JGraph asGraph(Repository repository, Set<? extends BlankNodeOrIRI> contexts, Option... option) {<a name="line.378"></a> -<span class="sourceLineNo">379</span> EnumSet<Option> opts = optionSet(option);<a name="line.379"></a> +<span class="sourceLineNo">378</span> public RDF4JGraph asGraph(final Repository repository, final Set<? extends BlankNodeOrIRI> contexts, final Option... option) {<a name="line.378"></a> +<span class="sourceLineNo">379</span> final EnumSet<Option> opts = optionSet(option);<a name="line.379"></a> <span class="sourceLineNo">380</span> /** NOTE: asValue() deliberately CAN handle <code>null</code> */<a name="line.380"></a> -<span class="sourceLineNo">381</span> Resource[] resources = contexts.stream().map(g -> (Resource) asValue(g)).toArray(Resource[]::new);<a name="line.381"></a> +<span class="sourceLineNo">381</span> final Resource[] resources = contexts.stream().map(g -> (Resource) asValue(g)).toArray(Resource[]::new);<a name="line.381"></a> <span class="sourceLineNo">382</span> return rdf4j.createRepositoryGraphImpl(Objects.requireNonNull(repository),<a name="line.382"></a> <span class="sourceLineNo">383</span> opts.contains(Option.handleInitAndShutdown), opts.contains(Option.includeInferred), resources);<a name="line.383"></a> <span class="sourceLineNo">384</span> }<a name="line.384"></a> @@ -406,20 +406,20 @@ <span class="sourceLineNo">398</span> * A {@link Triple} or {@link Quad} to adapt<a name="line.398"></a> <span class="sourceLineNo">399</span> * @return A corresponding {@link Statement}<a name="line.399"></a> <span class="sourceLineNo">400</span> */<a name="line.400"></a> -<span class="sourceLineNo">401</span> public Statement asStatement(TripleLike tripleLike) {<a name="line.401"></a> +<span class="sourceLineNo">401</span> public Statement asStatement(final TripleLike tripleLike) {<a name="line.401"></a> <span class="sourceLineNo">402</span> if (tripleLike instanceof RDF4JTripleLike) {<a name="line.402"></a> <span class="sourceLineNo">403</span> // Return original statement - this covers both RDF4JQuad and<a name="line.403"></a> <span class="sourceLineNo">404</span> // RDF4JTriple<a name="line.404"></a> <span class="sourceLineNo">405</span> return ((RDF4JTripleLike) tripleLike).asStatement();<a name="line.405"></a> <span class="sourceLineNo">406</span> }<a name="line.406"></a> <span class="sourceLineNo">407</span><a name="line.407"></a> -<span class="sourceLineNo">408</span> org.eclipse.rdf4j.model.Resource subject = (org.eclipse.rdf4j.model.Resource) asValue(tripleLike.getSubject());<a name="line.408"></a> -<span class="sourceLineNo">409</span> org.eclipse.rdf4j.model.IRI predicate = (org.eclipse.rdf4j.model.IRI) asValue(tripleLike.getPredicate());<a name="line.409"></a> -<span class="sourceLineNo">410</span> Value object = asValue(tripleLike.getObject());<a name="line.410"></a> +<span class="sourceLineNo">408</span> final org.eclipse.rdf4j.model.Resource subject = (org.eclipse.rdf4j.model.Resource) asValue(tripleLike.getSubject());<a name="line.408"></a> +<span class="sourceLineNo">409</span> final org.eclipse.rdf4j.model.IRI predicate = (org.eclipse.rdf4j.model.IRI) asValue(tripleLike.getPredicate());<a name="line.409"></a> +<span class="sourceLineNo">410</span> final Value object = asValue(tripleLike.getObject());<a name="line.410"></a> <span class="sourceLineNo">411</span><a name="line.411"></a> <span class="sourceLineNo">412</span> org.eclipse.rdf4j.model.Resource context = null;<a name="line.412"></a> <span class="sourceLineNo">413</span> if (tripleLike instanceof Quad) {<a name="line.413"></a> -<span class="sourceLineNo">414</span> Quad quad = (Quad) tripleLike;<a name="line.414"></a> +<span class="sourceLineNo">414</span> final Quad quad = (Quad) tripleLike;<a name="line.414"></a> <span class="sourceLineNo">415</span> context = (org.eclipse.rdf4j.model.Resource) asValue(quad.getGraphName().orElse(null));<a name="line.415"></a> <span class="sourceLineNo">416</span> }<a name="line.416"></a> <span class="sourceLineNo">417</span><a name="line.417"></a> @@ -470,7 +470,7 @@ <span class="sourceLineNo">462</span> * RDFTerm to adapt to RDF4J Value<a name="line.462"></a> <span class="sourceLineNo">463</span> * @return Adapted RDF4J {@link Value}<a name="line.463"></a> <span class="sourceLineNo">464</span> */<a name="line.464"></a> -<span class="sourceLineNo">465</span> public Value asValue(RDFTerm term) {<a name="line.465"></a> +<span class="sourceLineNo">465</span> public Value asValue(final RDFTerm term) {<a name="line.465"></a> <span class="sourceLineNo">466</span> if (term == null) {<a name="line.466"></a> <span class="sourceLineNo">467</span> return null;<a name="line.467"></a> <span class="sourceLineNo">468</span> }<a name="line.468"></a> @@ -480,22 +480,22 @@ <span class="sourceLineNo">472</span> return ((RDF4JTerm) term).asValue();<a name="line.472"></a> <span class="sourceLineNo">473</span> }<a name="line.473"></a> <span class="sourceLineNo">474</span> if (term instanceof org.apache.commons.rdf.api.IRI) {<a name="line.474"></a> -<span class="sourceLineNo">475</span> org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) term;<a name="line.475"></a> +<span class="sourceLineNo">475</span> final org.apache.commons.rdf.api.IRI iri = (org.apache.commons.rdf.api.IRI) term;<a name="line.475"></a> <span class="sourceLineNo">476</span> return getValueFactory().createIRI(iri.getIRIString());<a name="line.476"></a> <span class="sourceLineNo">477</span> }<a name="line.477"></a> <span class="sourceLineNo">478</span> if (term instanceof org.apache.commons.rdf.api.Literal) {<a name="line.478"></a> -<span class="sourceLineNo">479</span> org.apache.commons.rdf.api.Literal literal = (org.apache.commons.rdf.api.Literal) term;<a name="line.479"></a> -<span class="sourceLineNo">480</span> String label = literal.getLexicalForm();<a name="line.480"></a> +<span class="sourceLineNo">479</span> final org.apache.commons.rdf.api.Literal literal = (org.apache.commons.rdf.api.Literal) term;<a name="line.479"></a> +<span class="sourceLineNo">480</span> final String label = literal.getLexicalForm();<a name="line.480"></a> <span class="sourceLineNo">481</span> if (literal.getLanguageTag().isPresent()) {<a name="line.481"></a> -<span class="sourceLineNo">482</span> String lang = literal.getLanguageTag().get();<a name="line.482"></a> +<span class="sourceLineNo">482</span> final String lang = literal.getLanguageTag().get();<a name="line.482"></a> <span class="sourceLineNo">483</span> return getValueFactory().createLiteral(label, lang);<a name="line.483"></a> <span class="sourceLineNo">484</span> }<a name="line.484"></a> -<span class="sourceLineNo">485</span> org.eclipse.rdf4j.model.IRI dataType = (org.eclipse.rdf4j.model.IRI) asValue(literal.getDatatype());<a name="line.485"></a> +<span class="sourceLineNo">485</span> final org.eclipse.rdf4j.model.IRI dataType = (org.eclipse.rdf4j.model.IRI) asValue(literal.getDatatype());<a name="line.485"></a> <span class="sourceLineNo">486</span> return getValueFactory().createLiteral(label, dataType);<a name="line.486"></a> <span class="sourceLineNo">487</span> }<a name="line.487"></a> <span class="sourceLineNo">488</span> if (term instanceof BlankNode) {<a name="line.488"></a> <span class="sourceLineNo">489</span> // This is where it gets tricky to support round trips!<a name="line.489"></a> -<span class="sourceLineNo">490</span> BlankNode blankNode = (BlankNode) term;<a name="line.490"></a> +<span class="sourceLineNo">490</span> final BlankNode blankNode = (BlankNode) term;<a name="line.490"></a> <span class="sourceLineNo">491</span> // FIXME: The uniqueReference might not be a valid BlankNode<a name="line.491"></a> <span class="sourceLineNo">492</span> // identifier..<a name="line.492"></a> <span class="sourceLineNo">493</span> // does it have to be in RDF4J?<a name="line.493"></a> @@ -506,13 +506,13 @@ <span class="sourceLineNo">498</span><a name="line.498"></a> <span class="sourceLineNo">499</span> @Override<a name="line.499"></a> <span class="sourceLineNo">500</span> public RDF4JBlankNode createBlankNode() {<a name="line.500"></a> -<span class="sourceLineNo">501</span> BNode bnode = getValueFactory().createBNode();<a name="line.501"></a> +<span class="sourceLineNo">501</span> final BNode bnode = getValueFactory().createBNode();<a name="line.501"></a> <span class="sourceLineNo">502</span> return (RDF4JBlankNode) asRDFTerm(bnode);<a name="line.502"></a> <span class="sourceLineNo">503</span> }<a name="line.503"></a> <span class="sourceLineNo">504</span><a name="line.504"></a> <span class="sourceLineNo">505</span> @Override<a name="line.505"></a> -<span class="sourceLineNo">506</span> public RDF4JBlankNode createBlankNode(String name) {<a name="line.506"></a> -<span class="sourceLineNo">507</span> BNode bnode = getValueFactory().createBNode(name);<a name="line.507"></a> +<span class="sourceLineNo">506</span> public RDF4JBlankNode createBlankNode(final String name) {<a name="line.506"></a> +<span class="sourceLineNo">507</span> final BNode bnode = getValueFactory().createBNode(name);<a name="line.507"></a> <span class="sourceLineNo">508</span> return (RDF4JBlankNode) asRDFTerm(bnode);<a name="line.508"></a> <span class="sourceLineNo">509</span> }<a name="line.509"></a> <span class="sourceLineNo">510</span><a name="line.510"></a> @@ -527,8 +527,8 @@ <span class="sourceLineNo">519</span> */<a name="line.519"></a> <span class="sourceLineNo">520</span> @Override<a name="line.520"></a> <span class="sourceLineNo">521</span> public RDF4JDataset createDataset() {<a name="line.521"></a> -<span class="sourceLineNo">522</span> Sail sail = new MemoryStore();<a name="line.522"></a> -<span class="sourceLineNo">523</span> Repository repository = new SailRepository(sail);<a name="line.523"></a> +<span class="sourceLineNo">522</span> final Sail sail = new MemoryStore();<a name="line.522"></a> +<span class="sourceLineNo">523</span> final Repository repository = new SailRepository(sail);<a name="line.523"></a> <span class="sourceLineNo">524</span> return rdf4j.createRepositoryDatasetImpl(repository, true, false);<a name="line.524"></a> <span class="sourceLineNo">525</span> }<a name="line.525"></a> <span class="sourceLineNo">526</span><a name="line.526"></a> @@ -538,33 +538,33 @@ <span class="sourceLineNo">530</span> }<a name="line.530"></a> <span class="sourceLineNo">531</span><a name="line.531"></a> <span class="sourceLineNo">532</span> @Override<a name="line.532"></a> -<span class="sourceLineNo">533</span> public RDF4JIRI createIRI(String iri) throws IllegalArgumentException {<a name="line.533"></a> +<span class="sourceLineNo">533</span> public RDF4JIRI createIRI(final String iri) throws IllegalArgumentException {<a name="line.533"></a> <span class="sourceLineNo">534</span> return (RDF4JIRI) asRDFTerm(getValueFactory().createIRI(iri));<a name="line.534"></a> <span class="sourceLineNo">535</span> }<a name="line.535"></a> <span class="sourceLineNo">536</span><a name="line.536"></a> <span class="sourceLineNo">537</span> @Override<a name="line.537"></a> -<span class="sourceLineNo">538</span> public RDF4JLiteral createLiteral(String lexicalForm) throws IllegalArgumentException {<a name="line.538"></a> -<span class="sourceLineNo">539</span> org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm);<a name="line.539"></a> +<span class="sourceLineNo">538</span> public RDF4JLiteral createLiteral(final String lexicalForm) throws IllegalArgumentException {<a name="line.538"></a> +<span class="sourceLineNo">539</span> final org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm);<a name="line.539"></a> <span class="sourceLineNo">540</span> return (RDF4JLiteral) asRDFTerm(lit);<a name="line.540"></a> <span class="sourceLineNo">541</span> }<a name="line.541"></a> <span class="sourceLineNo">542</span><a name="line.542"></a> <span class="sourceLineNo">543</span> @Override<a name="line.543"></a> -<span class="sourceLineNo">544</span> public org.apache.commons.rdf.api.Literal createLiteral(String lexicalForm, org.apache.commons.rdf.api.IRI dataType)<a name="line.544"></a> +<span class="sourceLineNo">544</span> public org.apache.commons.rdf.api.Literal createLiteral(final String lexicalForm, final org.apache.commons.rdf.api.IRI dataType)<a name="line.544"></a> <span class="sourceLineNo">545</span> throws IllegalArgumentException {<a name="line.545"></a> -<span class="sourceLineNo">546</span> org.eclipse.rdf4j.model.IRI iri = getValueFactory().createIRI(dataType.getIRIString());<a name="line.546"></a> -<span class="sourceLineNo">547</span> org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, iri);<a name="line.547"></a> +<span class="sourceLineNo">546</span> final org.eclipse.rdf4j.model.IRI iri = getValueFactory().createIRI(dataType.getIRIString());<a name="line.546"></a> +<span class="sourceLineNo">547</span> final org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, iri);<a name="line.547"></a> <span class="sourceLineNo">548</span> return (org.apache.commons.rdf.api.Literal) asRDFTerm(lit);<a name="line.548"></a> <span class="sourceLineNo">549</span> }<a name="line.549"></a> <span class="sourceLineNo">550</span><a name="line.550"></a> <span class="sourceLineNo">551</span> @Override<a name="line.551"></a> -<span class="sourceLineNo">552</span> public org.apache.commons.rdf.api.Literal createLiteral(String lexicalForm, String languageTag)<a name="line.552"></a> +<span class="sourceLineNo">552</span> public org.apache.commons.rdf.api.Literal createLiteral(final String lexicalForm, final String languageTag)<a name="line.552"></a> <span class="sourceLineNo">553</span> throws IllegalArgumentException {<a name="line.553"></a> -<span class="sourceLineNo">554</span> org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, languageTag);<a name="line.554"></a> +<span class="sourceLineNo">554</span> final org.eclipse.rdf4j.model.Literal lit = getValueFactory().createLiteral(lexicalForm, languageTag);<a name="line.554"></a> <span class="sourceLineNo">555</span> return (org.apache.commons.rdf.api.Literal) asRDFTerm(lit);<a name="line.555"></a> <span class="sourceLineNo">556</span> }<a name="line.556"></a> <span class="sourceLineNo">557</span><a name="line.557"></a> <span class="sourceLineNo">558</span> @Override<a name="line.558"></a> -<span class="sourceLineNo">559</span> public RDF4JTriple createTriple(BlankNodeOrIRI subject, org.apache.commons.rdf.api.IRI predicate, RDFTerm object)<a name="line.559"></a> +<span class="sourceLineNo">559</span> public RDF4JTriple createTriple(final BlankNodeOrIRI subject, final org.apache.commons.rdf.api.IRI predicate, final RDFTerm object)<a name="line.559"></a> <span class="sourceLineNo">560</span> throws IllegalArgumentException {<a name="line.560"></a> <span class="sourceLineNo">561</span> final Statement statement = getValueFactory().createStatement(<a name="line.561"></a> <span class="sourceLineNo">562</span> (org.eclipse.rdf4j.model.Resource) asValue(subject), (org.eclipse.rdf4j.model.IRI) asValue(predicate),<a name="line.562"></a> @@ -573,8 +573,8 @@ <span class="sourceLineNo">565</span> }<a name="line.565"></a> <span class="sourceLineNo">566</span><a name="line.566"></a> <span class="sourceLineNo">567</span> @Override<a name="line.567"></a> -<span class="sourceLineNo">568</span> public Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, org.apache.commons.rdf.api.IRI predicate,<a name="line.568"></a> -<span class="sourceLineNo">569</span> RDFTerm object) throws IllegalArgumentException {<a name="line.569"></a> +<span class="sourceLineNo">568</span> public Quad createQuad(final BlankNodeOrIRI graphName, final BlankNodeOrIRI subject, final org.apache.commons.rdf.api.IRI predicate,<a name="line.568"></a> +<span class="sourceLineNo">569</span> final RDFTerm object) throws IllegalArgumentException {<a name="line.569"></a> <span class="sourceLineNo">570</span> final Statement statement = getValueFactory().createStatement(<a name="line.570"></a> <span class="sourceLineNo">571</span> (org.eclipse.rdf4j.model.Resource) asValue(subject), (org.eclipse.rdf4j.model.IRI) asValue(predicate),<a name="line.571"></a> <span class="sourceLineNo">572</span> asValue(object), (org.eclipse.rdf4j.model.Resource) asValue(graphName));<a name="line.572"></a> @@ -585,8 +585,8 @@ <span class="sourceLineNo">577</span> return valueFactory;<a name="line.577"></a> <span class="sourceLineNo">578</span> }<a name="line.578"></a> <span class="sourceLineNo">579</span><a name="line.579"></a> -<span class="sourceLineNo">580</span> private EnumSet<Option> optionSet(Option... options) {<a name="line.580"></a> -<span class="sourceLineNo">581</span> EnumSet<Option> opts = EnumSet.noneOf(Option.class);<a name="line.581"></a> +<span class="sourceLineNo">580</span> private EnumSet<Option> optionSet(final Option... options) {<a name="line.580"></a> +<span class="sourceLineNo">581</span> final EnumSet<Option> opts = EnumSet.noneOf(Option.class);<a name="line.581"></a> <span class="sourceLineNo">582</span> opts.addAll(Arrays.asList(options));<a name="line.582"></a> <span class="sourceLineNo">583</span> return opts;<a name="line.583"></a> <span class="sourceLineNo">584</span> }<a name="line.584"></a>