Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/simple/experimental/AbstractRDFParser.html Wed Nov 16 10:57:28 2016 @@ -0,0 +1,641 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>/**<a name="line.1"></a> +<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one<a name="line.2"></a> +<span class="sourceLineNo">003</span> * or more contributor license agreements. See the NOTICE file<a name="line.3"></a> +<span class="sourceLineNo">004</span> * distributed with this work for additional information<a name="line.4"></a> +<span class="sourceLineNo">005</span> * regarding copyright ownership. The ASF licenses this file<a name="line.5"></a> +<span class="sourceLineNo">006</span> * to you under the Apache License, Version 2.0 (the<a name="line.6"></a> +<span class="sourceLineNo">007</span> * "License"); you may not use this file except in compliance<a name="line.7"></a> +<span class="sourceLineNo">008</span> * with the License. You may obtain a copy of the License at<a name="line.8"></a> +<span class="sourceLineNo">009</span> *<a name="line.9"></a> +<span class="sourceLineNo">010</span> * http://www.apache.org/licenses/LICENSE-2.0<a name="line.10"></a> +<span class="sourceLineNo">011</span> *<a name="line.11"></a> +<span class="sourceLineNo">012</span> * Unless required by applicable law or agreed to in writing, software<a name="line.12"></a> +<span class="sourceLineNo">013</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.13"></a> +<span class="sourceLineNo">014</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.14"></a> +<span class="sourceLineNo">015</span> * See the License for the specific language governing permissions and<a name="line.15"></a> +<span class="sourceLineNo">016</span> * limitations under the License.<a name="line.16"></a> +<span class="sourceLineNo">017</span> */<a name="line.17"></a> +<span class="sourceLineNo">018</span>package org.apache.commons.rdf.simple.experimental;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>import java.io.IOException;<a name="line.20"></a> +<span class="sourceLineNo">021</span>import java.io.InputStream;<a name="line.21"></a> +<span class="sourceLineNo">022</span>import java.net.URI;<a name="line.22"></a> +<span class="sourceLineNo">023</span>import java.nio.file.Files;<a name="line.23"></a> +<span class="sourceLineNo">024</span>import java.nio.file.Path;<a name="line.24"></a> +<span class="sourceLineNo">025</span>import java.util.Optional;<a name="line.25"></a> +<span class="sourceLineNo">026</span>import java.util.concurrent.ExecutorService;<a name="line.26"></a> +<span class="sourceLineNo">027</span>import java.util.concurrent.Executors;<a name="line.27"></a> +<span class="sourceLineNo">028</span>import java.util.concurrent.Future;<a name="line.28"></a> +<span class="sourceLineNo">029</span>import java.util.function.Consumer;<a name="line.29"></a> +<span class="sourceLineNo">030</span><a name="line.30"></a> +<span class="sourceLineNo">031</span>import org.apache.commons.rdf.api.Dataset;<a name="line.31"></a> +<span class="sourceLineNo">032</span>import org.apache.commons.rdf.api.Graph;<a name="line.32"></a> +<span class="sourceLineNo">033</span>import org.apache.commons.rdf.api.IRI;<a name="line.33"></a> +<span class="sourceLineNo">034</span>import org.apache.commons.rdf.api.Quad;<a name="line.34"></a> +<span class="sourceLineNo">035</span>import org.apache.commons.rdf.api.RDFSyntax;<a name="line.35"></a> +<span class="sourceLineNo">036</span>import org.apache.commons.rdf.api.RDF;<a name="line.36"></a> +<span class="sourceLineNo">037</span>import org.apache.commons.rdf.experimental.RDFParser;<a name="line.37"></a> +<span class="sourceLineNo">038</span>import org.apache.commons.rdf.simple.SimpleRDF;<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> * Abstract RDFParser<a name="line.41"></a> +<span class="sourceLineNo">042</span> * <p><a name="line.42"></a> +<span class="sourceLineNo">043</span> * This abstract class keeps the properties in protected fields like<a name="line.43"></a> +<span class="sourceLineNo">044</span> * {@link #sourceFile} using {@link Optional}. Some basic checking like<a name="line.44"></a> +<span class="sourceLineNo">045</span> * {@link #checkIsAbsolute(IRI)} is performed.<a name="line.45"></a> +<span class="sourceLineNo">046</span> * <p><a name="line.46"></a> +<span class="sourceLineNo">047</span> * This class and its subclasses are {@link Cloneable}, immutable and<a name="line.47"></a> +<span class="sourceLineNo">048</span> * (therefore) thread-safe - each call to option methods like<a name="line.48"></a> +<span class="sourceLineNo">049</span> * {@link #contentType(String)} or {@link #source(IRI)} will return a cloned,<a name="line.49"></a> +<span class="sourceLineNo">050</span> * mutated copy.<a name="line.50"></a> +<span class="sourceLineNo">051</span> * <p><a name="line.51"></a> +<span class="sourceLineNo">052</span> * By default, parsing is done by the abstract method<a name="line.52"></a> +<span class="sourceLineNo">053</span> * {@link #parseSynchronusly()} - which is executed in a cloned snapshot - hence<a name="line.53"></a> +<span class="sourceLineNo">054</span> * multiple {@link #parse()} calls are thread-safe. The default {@link #parse()}<a name="line.54"></a> +<span class="sourceLineNo">055</span> * uses a thread pool in {@link #threadGroup} - but implementations can override<a name="line.55"></a> +<span class="sourceLineNo">056</span> * {@link #parse()} (e.g. because it has its own threading model or use<a name="line.56"></a> +<span class="sourceLineNo">057</span> * asynchronous remote execution).<a name="line.57"></a> +<span class="sourceLineNo">058</span> */<a name="line.58"></a> +<span class="sourceLineNo">059</span>public abstract class AbstractRDFParser<T extends AbstractRDFParser<T>> implements RDFParser, Cloneable {<a name="line.59"></a> +<span class="sourceLineNo">060</span><a name="line.60"></a> +<span class="sourceLineNo">061</span> public static final ThreadGroup threadGroup = new ThreadGroup("Commons RDF parsers");<a name="line.61"></a> +<span class="sourceLineNo">062</span> private static final ExecutorService threadpool = Executors.newCachedThreadPool(r -> new Thread(threadGroup, r));<a name="line.62"></a> +<span class="sourceLineNo">063</span><a name="line.63"></a> +<span class="sourceLineNo">064</span> // Basically only used for creating IRIs<a name="line.64"></a> +<span class="sourceLineNo">065</span> private static RDF internalRdfTermFactory = new SimpleRDF();<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> * Get the set {@link RDF}, if any.<a name="line.68"></a> +<span class="sourceLineNo">069</span> * <a name="line.69"></a> +<span class="sourceLineNo">070</span> * @return The {@link RDF} to use, or {@link Optional#empty()} if it has not<a name="line.70"></a> +<span class="sourceLineNo">071</span> * been set<a name="line.71"></a> +<span class="sourceLineNo">072</span> */<a name="line.72"></a> +<span class="sourceLineNo">073</span> public Optional<RDF> getRdfTermFactory() {<a name="line.73"></a> +<span class="sourceLineNo">074</span> return rdfTermFactory;<a name="line.74"></a> +<span class="sourceLineNo">075</span> }<a name="line.75"></a> +<span class="sourceLineNo">076</span><a name="line.76"></a> +<span class="sourceLineNo">077</span> /**<a name="line.77"></a> +<span class="sourceLineNo">078</span> * Get the set content-type {@link RDFSyntax}, if any.<a name="line.78"></a> +<span class="sourceLineNo">079</span> * <p><a name="line.79"></a> +<span class="sourceLineNo">080</span> * If this is {@link Optional#isPresent()}, then {@link #getContentType()}<a name="line.80"></a> +<span class="sourceLineNo">081</span> * contains the value of {@link RDFSyntax#mediaType}.<a name="line.81"></a> +<span class="sourceLineNo">082</span> * <a name="line.82"></a> +<span class="sourceLineNo">083</span> * @return The {@link RDFSyntax} of the content type, or<a name="line.83"></a> +<span class="sourceLineNo">084</span> * {@link Optional#empty()} if it has not been set<a name="line.84"></a> +<span class="sourceLineNo">085</span> */<a name="line.85"></a> +<span class="sourceLineNo">086</span> public Optional<RDFSyntax> getContentTypeSyntax() {<a name="line.86"></a> +<span class="sourceLineNo">087</span> return contentTypeSyntax;<a name="line.87"></a> +<span class="sourceLineNo">088</span> }<a name="line.88"></a> +<span class="sourceLineNo">089</span><a name="line.89"></a> +<span class="sourceLineNo">090</span> /**<a name="line.90"></a> +<span class="sourceLineNo">091</span> * Get the set content-type String, if any.<a name="line.91"></a> +<span class="sourceLineNo">092</span> * <p><a name="line.92"></a> +<span class="sourceLineNo">093</span> * If this is {@link Optional#isPresent()} and is recognized by<a name="line.93"></a> +<span class="sourceLineNo">094</span> * {@link RDFSyntax#byMediaType(String)}, then the corresponding<a name="line.94"></a> +<span class="sourceLineNo">095</span> * {@link RDFSyntax} is set on {@link #getContentType()}, otherwise that is<a name="line.95"></a> +<span class="sourceLineNo">096</span> * {@link Optional#empty()}.<a name="line.96"></a> +<span class="sourceLineNo">097</span> * <a name="line.97"></a> +<span class="sourceLineNo">098</span> * @return The Content-Type IANA media type, e.g. <code>text/turtle</code>,<a name="line.98"></a> +<span class="sourceLineNo">099</span> * or {@link Optional#empty()} if it has not been set<a name="line.99"></a> +<span class="sourceLineNo">100</span> */<a name="line.100"></a> +<span class="sourceLineNo">101</span> public final Optional<String> getContentType() {<a name="line.101"></a> +<span class="sourceLineNo">102</span> return contentType;<a name="line.102"></a> +<span class="sourceLineNo">103</span> }<a name="line.103"></a> +<span class="sourceLineNo">104</span><a name="line.104"></a> +<span class="sourceLineNo">105</span> /**<a name="line.105"></a> +<span class="sourceLineNo">106</span> * Get the target to consume parsed Quads.<a name="line.106"></a> +<span class="sourceLineNo">107</span> * <p><a name="line.107"></a> +<span class="sourceLineNo">108</span> * From the call to {@link #parseSynchronusly()}, this will be a<a name="line.108"></a> +<span class="sourceLineNo">109</span> * non-<code>null</code> value (as a target is a required setting).<a name="line.109"></a> +<span class="sourceLineNo">110</span> * <a name="line.110"></a> +<span class="sourceLineNo">111</span> * @return The target consumer of {@link Quad}s, or <code>null</code> if it<a name="line.111"></a> +<span class="sourceLineNo">112</span> * has not yet been set.<a name="line.112"></a> +<span class="sourceLineNo">113</span> * <a name="line.113"></a> +<span class="sourceLineNo">114</span> */<a name="line.114"></a> +<span class="sourceLineNo">115</span> public Consumer<Quad> getTarget() {<a name="line.115"></a> +<span class="sourceLineNo">116</span> return target;<a name="line.116"></a> +<span class="sourceLineNo">117</span> }<a name="line.117"></a> +<span class="sourceLineNo">118</span><a name="line.118"></a> +<span class="sourceLineNo">119</span> /**<a name="line.119"></a> +<span class="sourceLineNo">120</span> * Get the target dataset as set by {@link #target(Dataset)}.<a name="line.120"></a> +<span class="sourceLineNo">121</span> * <p><a name="line.121"></a> +<span class="sourceLineNo">122</span> * The return value is {@link Optional#isPresent()} if and only if<a name="line.122"></a> +<span class="sourceLineNo">123</span> * {@link #target(Dataset)} has been set, meaning that the implementation<a name="line.123"></a> +<span class="sourceLineNo">124</span> * may choose to append parsed quads to the {@link Dataset} directly instead<a name="line.124"></a> +<span class="sourceLineNo">125</span> * of relying on the generated {@link #getTarget()} consumer.<a name="line.125"></a> +<span class="sourceLineNo">126</span> * <p><a name="line.126"></a> +<span class="sourceLineNo">127</span> * If this value is present, then {@link #getTargetGraph()} MUST be<a name="line.127"></a> +<span class="sourceLineNo">128</span> * {@link Optional#empty()}.<a name="line.128"></a> +<span class="sourceLineNo">129</span> * <a name="line.129"></a> +<span class="sourceLineNo">130</span> * @return The target Dataset, or {@link Optional#empty()} if another kind<a name="line.130"></a> +<span class="sourceLineNo">131</span> * of target has been set.<a name="line.131"></a> +<span class="sourceLineNo">132</span> */<a name="line.132"></a> +<span class="sourceLineNo">133</span> public Optional<Dataset> getTargetDataset() {<a name="line.133"></a> +<span class="sourceLineNo">134</span> return targetDataset;<a name="line.134"></a> +<span class="sourceLineNo">135</span> }<a name="line.135"></a> +<span class="sourceLineNo">136</span><a name="line.136"></a> +<span class="sourceLineNo">137</span> /**<a name="line.137"></a> +<span class="sourceLineNo">138</span> * Get the target graph as set by {@link #target(Graph)}.<a name="line.138"></a> +<span class="sourceLineNo">139</span> * <p><a name="line.139"></a> +<span class="sourceLineNo">140</span> * The return value is {@link Optional#isPresent()} if and only if<a name="line.140"></a> +<span class="sourceLineNo">141</span> * {@link #target(Graph)} has been set, meaning that the implementation may<a name="line.141"></a> +<span class="sourceLineNo">142</span> * choose to append parsed triples to the {@link Graph} directly instead of<a name="line.142"></a> +<span class="sourceLineNo">143</span> * relying on the generated {@link #getTarget()} consumer.<a name="line.143"></a> +<span class="sourceLineNo">144</span> * <p><a name="line.144"></a> +<span class="sourceLineNo">145</span> * If this value is present, then {@link #getTargetDataset()} MUST be<a name="line.145"></a> +<span class="sourceLineNo">146</span> * {@link Optional#empty()}.<a name="line.146"></a> +<span class="sourceLineNo">147</span> * <a name="line.147"></a> +<span class="sourceLineNo">148</span> * @return The target Graph, or {@link Optional#empty()} if another kind of<a name="line.148"></a> +<span class="sourceLineNo">149</span> * target has been set.<a name="line.149"></a> +<span class="sourceLineNo">150</span> */<a name="line.150"></a> +<span class="sourceLineNo">151</span> public Optional<Graph> getTargetGraph() {<a name="line.151"></a> +<span class="sourceLineNo">152</span> return targetGraph;<a name="line.152"></a> +<span class="sourceLineNo">153</span> }<a name="line.153"></a> +<span class="sourceLineNo">154</span><a name="line.154"></a> +<span class="sourceLineNo">155</span> /**<a name="line.155"></a> +<span class="sourceLineNo">156</span> * Get the set base {@link IRI}, if present.<a name="line.156"></a> +<span class="sourceLineNo">157</span> * <a name="line.157"></a> +<span class="sourceLineNo">158</span> * @return The base {@link IRI}, or {@link Optional#empty()} if it has not<a name="line.158"></a> +<span class="sourceLineNo">159</span> * been set<a name="line.159"></a> +<span class="sourceLineNo">160</span> */<a name="line.160"></a> +<span class="sourceLineNo">161</span> public Optional<IRI> getBase() {<a name="line.161"></a> +<span class="sourceLineNo">162</span> return base;<a name="line.162"></a> +<span class="sourceLineNo">163</span> }<a name="line.163"></a> +<span class="sourceLineNo">164</span><a name="line.164"></a> +<span class="sourceLineNo">165</span> /**<a name="line.165"></a> +<span class="sourceLineNo">166</span> * Get the set source {@link InputStream}.<a name="line.166"></a> +<span class="sourceLineNo">167</span> * <p><a name="line.167"></a> +<span class="sourceLineNo">168</span> * If this is {@link Optional#isPresent()}, then {@link #getSourceFile()}<a name="line.168"></a> +<span class="sourceLineNo">169</span> * and {@link #getSourceIri()} are {@link Optional#empty()}.<a name="line.169"></a> +<span class="sourceLineNo">170</span> * <a name="line.170"></a> +<span class="sourceLineNo">171</span> * @return The source {@link InputStream}, or {@link Optional#empty()} if it<a name="line.171"></a> +<span class="sourceLineNo">172</span> * has not been set<a name="line.172"></a> +<span class="sourceLineNo">173</span> */<a name="line.173"></a> +<span class="sourceLineNo">174</span> public Optional<InputStream> getSourceInputStream() {<a name="line.174"></a> +<span class="sourceLineNo">175</span> return sourceInputStream;<a name="line.175"></a> +<span class="sourceLineNo">176</span> }<a name="line.176"></a> +<span class="sourceLineNo">177</span><a name="line.177"></a> +<span class="sourceLineNo">178</span> /**<a name="line.178"></a> +<span class="sourceLineNo">179</span> * Get the set source {@link Path}.<a name="line.179"></a> +<span class="sourceLineNo">180</span> * <p><a name="line.180"></a> +<span class="sourceLineNo">181</span> * If this is {@link Optional#isPresent()}, then<a name="line.181"></a> +<span class="sourceLineNo">182</span> * {@link #getSourceInputStream()} and {@link #getSourceIri()} are<a name="line.182"></a> +<span class="sourceLineNo">183</span> * {@link Optional#empty()}.<a name="line.183"></a> +<span class="sourceLineNo">184</span> *<a name="line.184"></a> +<span class="sourceLineNo">185</span> * @return The source {@link Path}, or {@link Optional#empty()} if it has<a name="line.185"></a> +<span class="sourceLineNo">186</span> * not been set<a name="line.186"></a> +<span class="sourceLineNo">187</span> */<a name="line.187"></a> +<span class="sourceLineNo">188</span> public Optional<Path> getSourceFile() {<a name="line.188"></a> +<span class="sourceLineNo">189</span> return sourceFile;<a name="line.189"></a> +<span class="sourceLineNo">190</span> }<a name="line.190"></a> +<span class="sourceLineNo">191</span><a name="line.191"></a> +<span class="sourceLineNo">192</span> /**<a name="line.192"></a> +<span class="sourceLineNo">193</span> * Get the set source {@link Path}.<a name="line.193"></a> +<span class="sourceLineNo">194</span> * <p><a name="line.194"></a> +<span class="sourceLineNo">195</span> * If this is {@link Optional#isPresent()}, then<a name="line.195"></a> +<span class="sourceLineNo">196</span> * {@link #getSourceInputStream()} and {@link #getSourceInputStream()} are<a name="line.196"></a> +<span class="sourceLineNo">197</span> * {@link Optional#empty()}.<a name="line.197"></a> +<span class="sourceLineNo">198</span> * <a name="line.198"></a> +<span class="sourceLineNo">199</span> * @return The source {@link IRI}, or {@link Optional#empty()} if it has not<a name="line.199"></a> +<span class="sourceLineNo">200</span> * been set<a name="line.200"></a> +<span class="sourceLineNo">201</span> */<a name="line.201"></a> +<span class="sourceLineNo">202</span> public Optional<IRI> getSourceIri() {<a name="line.202"></a> +<span class="sourceLineNo">203</span> return sourceIri;<a name="line.203"></a> +<span class="sourceLineNo">204</span> }<a name="line.204"></a> +<span class="sourceLineNo">205</span><a name="line.205"></a> +<span class="sourceLineNo">206</span> private Optional<RDF> rdfTermFactory = Optional.empty();<a name="line.206"></a> +<span class="sourceLineNo">207</span> private Optional<RDFSyntax> contentTypeSyntax = Optional.empty();<a name="line.207"></a> +<span class="sourceLineNo">208</span> private Optional<String> contentType = Optional.empty();<a name="line.208"></a> +<span class="sourceLineNo">209</span> private Optional<IRI> base = Optional.empty();<a name="line.209"></a> +<span class="sourceLineNo">210</span> private Optional<InputStream> sourceInputStream = Optional.empty();<a name="line.210"></a> +<span class="sourceLineNo">211</span> private Optional<Path> sourceFile = Optional.empty();<a name="line.211"></a> +<span class="sourceLineNo">212</span> private Optional<IRI> sourceIri = Optional.empty();<a name="line.212"></a> +<span class="sourceLineNo">213</span> private Consumer<Quad> target;<a name="line.213"></a> +<span class="sourceLineNo">214</span> private Optional<Dataset> targetDataset;<a name="line.214"></a> +<span class="sourceLineNo">215</span> private Optional<Graph> targetGraph;<a name="line.215"></a> +<span class="sourceLineNo">216</span><a name="line.216"></a> +<span class="sourceLineNo">217</span> @SuppressWarnings("unchecked")<a name="line.217"></a> +<span class="sourceLineNo">218</span> @Override<a name="line.218"></a> +<span class="sourceLineNo">219</span> public T clone() {<a name="line.219"></a> +<span class="sourceLineNo">220</span> try {<a name="line.220"></a> +<span class="sourceLineNo">221</span> return (T) super.clone();<a name="line.221"></a> +<span class="sourceLineNo">222</span> } catch (CloneNotSupportedException e) {<a name="line.222"></a> +<span class="sourceLineNo">223</span> throw new RuntimeException(e);<a name="line.223"></a> +<span class="sourceLineNo">224</span> }<a name="line.224"></a> +<span class="sourceLineNo">225</span> }<a name="line.225"></a> +<span class="sourceLineNo">226</span><a name="line.226"></a> +<span class="sourceLineNo">227</span> @SuppressWarnings("unchecked")<a name="line.227"></a> +<span class="sourceLineNo">228</span> protected T asT() {<a name="line.228"></a> +<span class="sourceLineNo">229</span> return (T) this;<a name="line.229"></a> +<span class="sourceLineNo">230</span> }<a name="line.230"></a> +<span class="sourceLineNo">231</span><a name="line.231"></a> +<span class="sourceLineNo">232</span> @Override<a name="line.232"></a> +<span class="sourceLineNo">233</span> public T rdfTermFactory(RDF rdfTermFactory) {<a name="line.233"></a> +<span class="sourceLineNo">234</span> AbstractRDFParser<T> c = clone();<a name="line.234"></a> +<span class="sourceLineNo">235</span> c.rdfTermFactory = Optional.ofNullable(rdfTermFactory);<a name="line.235"></a> +<span class="sourceLineNo">236</span> return c.asT();<a name="line.236"></a> +<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 T contentType(RDFSyntax rdfSyntax) throws IllegalArgumentException {<a name="line.240"></a> +<span class="sourceLineNo">241</span> AbstractRDFParser<T> c = clone();<a name="line.241"></a> +<span class="sourceLineNo">242</span> c.contentTypeSyntax = Optional.ofNullable(rdfSyntax);<a name="line.242"></a> +<span class="sourceLineNo">243</span> c.contentType = c.contentTypeSyntax.map(syntax -> syntax.mediaType);<a name="line.243"></a> +<span class="sourceLineNo">244</span> return c.asT();<a name="line.244"></a> +<span class="sourceLineNo">245</span> }<a name="line.245"></a> +<span class="sourceLineNo">246</span><a name="line.246"></a> +<span class="sourceLineNo">247</span> @Override<a name="line.247"></a> +<span class="sourceLineNo">248</span> public T contentType(String contentType) throws IllegalArgumentException {<a name="line.248"></a> +<span class="sourceLineNo">249</span> AbstractRDFParser<T> c = clone();<a name="line.249"></a> +<span class="sourceLineNo">250</span> c.contentType = Optional.ofNullable(contentType);<a name="line.250"></a> +<span class="sourceLineNo">251</span> c.contentTypeSyntax = c.contentType.flatMap(RDFSyntax::byMediaType);<a name="line.251"></a> +<span class="sourceLineNo">252</span> return c.asT();<a name="line.252"></a> +<span class="sourceLineNo">253</span> }<a name="line.253"></a> +<span class="sourceLineNo">254</span><a name="line.254"></a> +<span class="sourceLineNo">255</span> @Override<a name="line.255"></a> +<span class="sourceLineNo">256</span> public T base(IRI base) {<a name="line.256"></a> +<span class="sourceLineNo">257</span> AbstractRDFParser<T> c = clone();<a name="line.257"></a> +<span class="sourceLineNo">258</span> c.base = Optional.ofNullable(base);<a name="line.258"></a> +<span class="sourceLineNo">259</span> c.base.ifPresent(i -> checkIsAbsolute(i));<a name="line.259"></a> +<span class="sourceLineNo">260</span> return c.asT();<a name="line.260"></a> +<span class="sourceLineNo">261</span> }<a name="line.261"></a> +<span class="sourceLineNo">262</span><a name="line.262"></a> +<span class="sourceLineNo">263</span> @Override<a name="line.263"></a> +<span class="sourceLineNo">264</span> public T base(String base) throws IllegalArgumentException {<a name="line.264"></a> +<span class="sourceLineNo">265</span> return base(internalRdfTermFactory.createIRI(base));<a name="line.265"></a> +<span class="sourceLineNo">266</span> }<a name="line.266"></a> +<span class="sourceLineNo">267</span><a name="line.267"></a> +<span class="sourceLineNo">268</span> @Override<a name="line.268"></a> +<span class="sourceLineNo">269</span> public T source(InputStream inputStream) {<a name="line.269"></a> +<span class="sourceLineNo">270</span> AbstractRDFParser<T> c = clone();<a name="line.270"></a> +<span class="sourceLineNo">271</span> c.resetSource();<a name="line.271"></a> +<span class="sourceLineNo">272</span> c.sourceInputStream = Optional.ofNullable(inputStream);<a name="line.272"></a> +<span class="sourceLineNo">273</span> return c.asT();<a name="line.273"></a> +<span class="sourceLineNo">274</span> }<a name="line.274"></a> +<span class="sourceLineNo">275</span><a name="line.275"></a> +<span class="sourceLineNo">276</span> @Override<a name="line.276"></a> +<span class="sourceLineNo">277</span> public T source(Path file) {<a name="line.277"></a> +<span class="sourceLineNo">278</span> AbstractRDFParser<T> c = clone();<a name="line.278"></a> +<span class="sourceLineNo">279</span> c.resetSource();<a name="line.279"></a> +<span class="sourceLineNo">280</span> c.sourceFile = Optional.ofNullable(file);<a name="line.280"></a> +<span class="sourceLineNo">281</span> return c.asT();<a name="line.281"></a> +<span class="sourceLineNo">282</span> }<a name="line.282"></a> +<span class="sourceLineNo">283</span><a name="line.283"></a> +<span class="sourceLineNo">284</span> @Override<a name="line.284"></a> +<span class="sourceLineNo">285</span> public T source(IRI iri) {<a name="line.285"></a> +<span class="sourceLineNo">286</span> AbstractRDFParser<T> c = clone();<a name="line.286"></a> +<span class="sourceLineNo">287</span> c.resetSource();<a name="line.287"></a> +<span class="sourceLineNo">288</span> c.sourceIri = Optional.ofNullable(iri);<a name="line.288"></a> +<span class="sourceLineNo">289</span> c.sourceIri.ifPresent(i -> checkIsAbsolute(i));<a name="line.289"></a> +<span class="sourceLineNo">290</span> return c.asT();<a name="line.290"></a> +<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> @Override<a name="line.293"></a> +<span class="sourceLineNo">294</span> public T source(String iri) throws IllegalArgumentException {<a name="line.294"></a> +<span class="sourceLineNo">295</span> AbstractRDFParser<T> c = clone();<a name="line.295"></a> +<span class="sourceLineNo">296</span> c.resetSource();<a name="line.296"></a> +<span class="sourceLineNo">297</span> c.sourceIri = Optional.ofNullable(iri).map(internalRdfTermFactory::createIRI);<a name="line.297"></a> +<span class="sourceLineNo">298</span> c.sourceIri.ifPresent(i -> checkIsAbsolute(i));<a name="line.298"></a> +<span class="sourceLineNo">299</span> return source(internalRdfTermFactory.createIRI(iri));<a name="line.299"></a> +<span class="sourceLineNo">300</span> }<a name="line.300"></a> +<span class="sourceLineNo">301</span><a name="line.301"></a> +<span class="sourceLineNo">302</span> /**<a name="line.302"></a> +<span class="sourceLineNo">303</span> * Check if an iri is absolute.<a name="line.303"></a> +<span class="sourceLineNo">304</span> * <p><a name="line.304"></a> +<span class="sourceLineNo">305</span> * Used by {@link #source(String)} and {@link #base(String)}.<a name="line.305"></a> +<span class="sourceLineNo">306</span> * <a name="line.306"></a> +<span class="sourceLineNo">307</span> * @param iri<a name="line.307"></a> +<span class="sourceLineNo">308</span> * IRI to check<a name="line.308"></a> +<span class="sourceLineNo">309</span> * @throws IllegalArgumentException<a name="line.309"></a> +<span class="sourceLineNo">310</span> * If the IRI is not absolute<a name="line.310"></a> +<span class="sourceLineNo">311</span> */<a name="line.311"></a> +<span class="sourceLineNo">312</span> protected void checkIsAbsolute(IRI iri) throws IllegalArgumentException {<a name="line.312"></a> +<span class="sourceLineNo">313</span> if (!URI.create(iri.getIRIString()).isAbsolute()) {<a name="line.313"></a> +<span class="sourceLineNo">314</span> throw new IllegalArgumentException("IRI is not absolute: " + iri);<a name="line.314"></a> +<span class="sourceLineNo">315</span> }<a name="line.315"></a> +<span class="sourceLineNo">316</span> }<a name="line.316"></a> +<span class="sourceLineNo">317</span><a name="line.317"></a> +<span class="sourceLineNo">318</span> /**<a name="line.318"></a> +<span class="sourceLineNo">319</span> * Check that one and only one source is present and valid.<a name="line.319"></a> +<span class="sourceLineNo">320</span> * <p><a name="line.320"></a> +<span class="sourceLineNo">321</span> * Used by {@link #parse()}.<a name="line.321"></a> +<span class="sourceLineNo">322</span> * <p><a name="line.322"></a> +<span class="sourceLineNo">323</span> * Subclasses might override this method, e.g. to support other source<a name="line.323"></a> +<span class="sourceLineNo">324</span> * combinations, or to check if the sourceIri is resolvable.<a name="line.324"></a> +<span class="sourceLineNo">325</span> * <a name="line.325"></a> +<span class="sourceLineNo">326</span> * @throws IOException<a name="line.326"></a> +<span class="sourceLineNo">327</span> * If a source file can't be read<a name="line.327"></a> +<span class="sourceLineNo">328</span> */<a name="line.328"></a> +<span class="sourceLineNo">329</span> protected void checkSource() throws IOException {<a name="line.329"></a> +<span class="sourceLineNo">330</span> if (!sourceFile.isPresent() && !sourceInputStream.isPresent() && !sourceIri.isPresent()) {<a name="line.330"></a> +<span class="sourceLineNo">331</span> throw new IllegalStateException("No source has been set");<a name="line.331"></a> +<span class="sourceLineNo">332</span> }<a name="line.332"></a> +<span class="sourceLineNo">333</span> if (sourceIri.isPresent() && sourceInputStream.isPresent()) {<a name="line.333"></a> +<span class="sourceLineNo">334</span> throw new IllegalStateException("Both sourceIri and sourceInputStream have been set");<a name="line.334"></a> +<span class="sourceLineNo">335</span> }<a name="line.335"></a> +<span class="sourceLineNo">336</span> if (sourceIri.isPresent() && sourceFile.isPresent()) {<a name="line.336"></a> +<span class="sourceLineNo">337</span> throw new IllegalStateException("Both sourceIri and sourceFile have been set");<a name="line.337"></a> +<span class="sourceLineNo">338</span> }<a name="line.338"></a> +<span class="sourceLineNo">339</span> if (sourceInputStream.isPresent() && sourceFile.isPresent()) {<a name="line.339"></a> +<span class="sourceLineNo">340</span> throw new IllegalStateException("Both sourceInputStream and sourceFile have been set");<a name="line.340"></a> +<span class="sourceLineNo">341</span> }<a name="line.341"></a> +<span class="sourceLineNo">342</span> if (sourceFile.isPresent() && !sourceFile.filter(Files::isReadable).isPresent()) {<a name="line.342"></a> +<span class="sourceLineNo">343</span> throw new IOException("Can't read file: " + sourceFile);<a name="line.343"></a> +<span class="sourceLineNo">344</span> }<a name="line.344"></a> +<span class="sourceLineNo">345</span> }<a name="line.345"></a> +<span class="sourceLineNo">346</span><a name="line.346"></a> +<span class="sourceLineNo">347</span> /**<a name="line.347"></a> +<span class="sourceLineNo">348</span> * Check if base is required.<a name="line.348"></a> +<span class="sourceLineNo">349</span> * <a name="line.349"></a> +<span class="sourceLineNo">350</span> * @throws IllegalStateException<a name="line.350"></a> +<span class="sourceLineNo">351</span> * if base is required, but not set.<a name="line.351"></a> +<span class="sourceLineNo">352</span> */<a name="line.352"></a> +<span class="sourceLineNo">353</span> protected void checkBaseRequired() throws IllegalStateException {<a name="line.353"></a> +<span class="sourceLineNo">354</span> if (!base.isPresent() && sourceInputStream.isPresent()<a name="line.354"></a> +<span class="sourceLineNo">355</span> && !contentTypeSyntax.filter(t -> t == RDFSyntax.NQUADS || t == RDFSyntax.NTRIPLES).isPresent()) {<a name="line.355"></a> +<span class="sourceLineNo">356</span> throw new IllegalStateException("base iri required for inputstream source");<a name="line.356"></a> +<span class="sourceLineNo">357</span> }<a name="line.357"></a> +<span class="sourceLineNo">358</span> }<a name="line.358"></a> +<span class="sourceLineNo">359</span><a name="line.359"></a> +<span class="sourceLineNo">360</span> /**<a name="line.360"></a> +<span class="sourceLineNo">361</span> * Reset all source* fields to Optional.empty()<a name="line.361"></a> +<span class="sourceLineNo">362</span> * <p><a name="line.362"></a> +<span class="sourceLineNo">363</span> * Subclasses should override this and call <code>super.resetSource()</code><a name="line.363"></a> +<span class="sourceLineNo">364</span> * if they need to reset any additional source* fields.<a name="line.364"></a> +<span class="sourceLineNo">365</span> * <a name="line.365"></a> +<span class="sourceLineNo">366</span> */<a name="line.366"></a> +<span class="sourceLineNo">367</span> protected void resetSource() {<a name="line.367"></a> +<span class="sourceLineNo">368</span> sourceInputStream = Optional.empty();<a name="line.368"></a> +<span class="sourceLineNo">369</span> sourceIri = Optional.empty();<a name="line.369"></a> +<span class="sourceLineNo">370</span> sourceFile = Optional.empty();<a name="line.370"></a> +<span class="sourceLineNo">371</span> }<a name="line.371"></a> +<span class="sourceLineNo">372</span><a name="line.372"></a> +<span class="sourceLineNo">373</span> /**<a name="line.373"></a> +<span class="sourceLineNo">374</span> * Reset all optional target* fields to {@link Optional#empty()}.<a name="line.374"></a> +<span class="sourceLineNo">375</span> * <p><a name="line.375"></a> +<span class="sourceLineNo">376</span> * Note that the consumer set for {@link #getTarget()} is<a name="line.376"></a> +<span class="sourceLineNo">377</span> * <strong>note</strong> reset.<a name="line.377"></a> +<span class="sourceLineNo">378</span> * <p><a name="line.378"></a> +<span class="sourceLineNo">379</span> * Subclasses should override this and call <code>super.resetTarget()</code><a name="line.379"></a> +<span class="sourceLineNo">380</span> * if they need to reset any additional target* fields.<a name="line.380"></a> +<span class="sourceLineNo">381</span> * <a name="line.381"></a> +<span class="sourceLineNo">382</span> */<a name="line.382"></a> +<span class="sourceLineNo">383</span> protected void resetTarget() {<a name="line.383"></a> +<span class="sourceLineNo">384</span> targetDataset = Optional.empty();<a name="line.384"></a> +<span class="sourceLineNo">385</span> targetGraph = Optional.empty();<a name="line.385"></a> +<span class="sourceLineNo">386</span> }<a name="line.386"></a> +<span class="sourceLineNo">387</span><a name="line.387"></a> +<span class="sourceLineNo">388</span> /**<a name="line.388"></a> +<span class="sourceLineNo">389</span> * Parse {@link #sourceInputStream}, {@link #sourceFile} or<a name="line.389"></a> +<span class="sourceLineNo">390</span> * {@link #sourceIri}.<a name="line.390"></a> +<span class="sourceLineNo">391</span> * <p><a name="line.391"></a> +<span class="sourceLineNo">392</span> * One of the source fields MUST be present, as checked by<a name="line.392"></a> +<span class="sourceLineNo">393</span> * {@link #checkSource()}.<a name="line.393"></a> +<span class="sourceLineNo">394</span> * <p><a name="line.394"></a> +<span class="sourceLineNo">395</span> * {@link #checkBaseRequired()} is called to verify if {@link #getBase()} is<a name="line.395"></a> +<span class="sourceLineNo">396</span> * required.<a name="line.396"></a> +<span class="sourceLineNo">397</span> * <a name="line.397"></a> +<span class="sourceLineNo">398</span> * @throws IOException<a name="line.398"></a> +<span class="sourceLineNo">399</span> * If the source could not be read<a name="line.399"></a> +<span class="sourceLineNo">400</span> * @throws RDFParseException<a name="line.400"></a> +<span class="sourceLineNo">401</span> * If the source could not be parsed (e.g. a .ttl file was not<a name="line.401"></a> +<span class="sourceLineNo">402</span> * valid Turtle)<a name="line.402"></a> +<span class="sourceLineNo">403</span> */<a name="line.403"></a> +<span class="sourceLineNo">404</span> protected abstract void parseSynchronusly() throws IOException, RDFParseException;<a name="line.404"></a> +<span class="sourceLineNo">405</span><a name="line.405"></a> +<span class="sourceLineNo">406</span> /**<a name="line.406"></a> +<span class="sourceLineNo">407</span> * Prepare a clone of this RDFParser which have been checked and completed.<a name="line.407"></a> +<span class="sourceLineNo">408</span> * <p><a name="line.408"></a> +<span class="sourceLineNo">409</span> * The returned clone will always have {@link #getTarget()} and<a name="line.409"></a> +<span class="sourceLineNo">410</span> * {@link #getRdfTermFactory()} present.<a name="line.410"></a> +<span class="sourceLineNo">411</span> * <p><a name="line.411"></a> +<span class="sourceLineNo">412</span> * If the {@link #getSourceFile()} is present, but the {@link #getBase()} is<a name="line.412"></a> +<span class="sourceLineNo">413</span> * not present, the base will be set to the <code>file:///</code> IRI for<a name="line.413"></a> +<span class="sourceLineNo">414</span> * the Path's real path (e.g. resolving any symbolic links).<a name="line.414"></a> +<span class="sourceLineNo">415</span> * <a name="line.415"></a> +<span class="sourceLineNo">416</span> * @return A completed and checked clone of this RDFParser<a name="line.416"></a> +<span class="sourceLineNo">417</span> * @throws IOException<a name="line.417"></a> +<span class="sourceLineNo">418</span> * If the source was not accessible (e.g. a file was not found)<a name="line.418"></a> +<span class="sourceLineNo">419</span> * @throws IllegalStateException<a name="line.419"></a> +<span class="sourceLineNo">420</span> * If the parser was not in a compatible setting (e.g.<a name="line.420"></a> +<span class="sourceLineNo">421</span> * contentType was an invalid string)<a name="line.421"></a> +<span class="sourceLineNo">422</span> */<a name="line.422"></a> +<span class="sourceLineNo">423</span> protected T prepareForParsing() throws IOException, IllegalStateException {<a name="line.423"></a> +<span class="sourceLineNo">424</span> checkSource();<a name="line.424"></a> +<span class="sourceLineNo">425</span> checkBaseRequired();<a name="line.425"></a> +<span class="sourceLineNo">426</span> checkContentType();<a name="line.426"></a> +<span class="sourceLineNo">427</span> checkTarget();<a name="line.427"></a> +<span class="sourceLineNo">428</span><a name="line.428"></a> +<span class="sourceLineNo">429</span> // We'll make a clone of our current state which will be passed to<a name="line.429"></a> +<span class="sourceLineNo">430</span> // parseSynchronously()<a name="line.430"></a> +<span class="sourceLineNo">431</span> AbstractRDFParser<T> c = clone();<a name="line.431"></a> +<span class="sourceLineNo">432</span><a name="line.432"></a> +<span class="sourceLineNo">433</span> // Use a fresh SimpleRDF for each parse<a name="line.433"></a> +<span class="sourceLineNo">434</span> if (!c.rdfTermFactory.isPresent()) {<a name="line.434"></a> +<span class="sourceLineNo">435</span> c.rdfTermFactory = Optional.of(createRDFTermFactory());<a name="line.435"></a> +<span class="sourceLineNo">436</span> }<a name="line.436"></a> +<span class="sourceLineNo">437</span> // sourceFile, but no base? Let's follow any symlinks and use<a name="line.437"></a> +<span class="sourceLineNo">438</span> // the file:/// URI<a name="line.438"></a> +<span class="sourceLineNo">439</span> if (c.sourceFile.isPresent() && !c.base.isPresent()) {<a name="line.439"></a> +<span class="sourceLineNo">440</span> URI baseUri = c.sourceFile.get().toRealPath().toUri();<a name="line.440"></a> +<span class="sourceLineNo">441</span> c.base = Optional.of(internalRdfTermFactory.createIRI(baseUri.toString()));<a name="line.441"></a> +<span class="sourceLineNo">442</span> }<a name="line.442"></a> +<span class="sourceLineNo">443</span><a name="line.443"></a> +<span class="sourceLineNo">444</span> return c.asT();<a name="line.444"></a> +<span class="sourceLineNo">445</span> }<a name="line.445"></a> +<span class="sourceLineNo">446</span><a name="line.446"></a> +<span class="sourceLineNo">447</span> /**<a name="line.447"></a> +<span class="sourceLineNo">448</span> * Subclasses can override this method to check the target is valid.<a name="line.448"></a> +<span class="sourceLineNo">449</span> * <p><a name="line.449"></a> +<span class="sourceLineNo">450</span> * The default implementation throws an IllegalStateException if the target<a name="line.450"></a> +<span class="sourceLineNo">451</span> * has not been set.<a name="line.451"></a> +<span class="sourceLineNo">452</span> */<a name="line.452"></a> +<span class="sourceLineNo">453</span> protected void checkTarget() {<a name="line.453"></a> +<span class="sourceLineNo">454</span> if (target == null) {<a name="line.454"></a> +<span class="sourceLineNo">455</span> throw new IllegalStateException("target has not been set");<a name="line.455"></a> +<span class="sourceLineNo">456</span> }<a name="line.456"></a> +<span class="sourceLineNo">457</span> if (targetGraph.isPresent() && targetDataset.isPresent()) {<a name="line.457"></a> +<span class="sourceLineNo">458</span> // This should not happen as each target(..) method resets the<a name="line.458"></a> +<span class="sourceLineNo">459</span> // optionals<a name="line.459"></a> +<span class="sourceLineNo">460</span> throw new IllegalStateException("targetGraph and targetDataset can't both be set");<a name="line.460"></a> +<span class="sourceLineNo">461</span> }<a name="line.461"></a> +<span class="sourceLineNo">462</span> }<a name="line.462"></a> +<span class="sourceLineNo">463</span><a name="line.463"></a> +<span class="sourceLineNo">464</span> /**<a name="line.464"></a> +<span class="sourceLineNo">465</span> * Subclasses can override this method to check compatibility with the<a name="line.465"></a> +<span class="sourceLineNo">466</span> * contentType setting.<a name="line.466"></a> +<span class="sourceLineNo">467</span> * <a name="line.467"></a> +<span class="sourceLineNo">468</span> * @throws IllegalStateException<a name="line.468"></a> +<span class="sourceLineNo">469</span> * if the {@link #getContentType()} or<a name="line.469"></a> +<span class="sourceLineNo">470</span> * {@link #getContentTypeSyntax()} is not compatible or invalid<a name="line.470"></a> +<span class="sourceLineNo">471</span> */<a name="line.471"></a> +<span class="sourceLineNo">472</span> protected void checkContentType() throws IllegalStateException {<a name="line.472"></a> +<span class="sourceLineNo">473</span> }<a name="line.473"></a> +<span class="sourceLineNo">474</span><a name="line.474"></a> +<span class="sourceLineNo">475</span> /**<a name="line.475"></a> +<span class="sourceLineNo">476</span> * Guess RDFSyntax from a local file's extension.<a name="line.476"></a> +<span class="sourceLineNo">477</span> * <p><a name="line.477"></a> +<span class="sourceLineNo">478</span> * This method can be used by subclasses if {@link #getContentType()} is not<a name="line.478"></a> +<span class="sourceLineNo">479</span> * present and {@link #getSourceFile()} is set.<a name="line.479"></a> +<span class="sourceLineNo">480</span> * <a name="line.480"></a> +<span class="sourceLineNo">481</span> * @param path<a name="line.481"></a> +<span class="sourceLineNo">482</span> * Path which extension should be checked<a name="line.482"></a> +<span class="sourceLineNo">483</span> * @return The {@link RDFSyntax} which has a matching<a name="line.483"></a> +<span class="sourceLineNo">484</span> * {@link RDFSyntax#fileExtension}, otherwise<a name="line.484"></a> +<span class="sourceLineNo">485</span> * {@link Optional#empty()}.<a name="line.485"></a> +<span class="sourceLineNo">486</span> */<a name="line.486"></a> +<span class="sourceLineNo">487</span> protected static Optional<RDFSyntax> guessRDFSyntax(Path path) {<a name="line.487"></a> +<span class="sourceLineNo">488</span> return fileExtension(path).flatMap(RDFSyntax::byFileExtension);<a name="line.488"></a> +<span class="sourceLineNo">489</span> }<a name="line.489"></a> +<span class="sourceLineNo">490</span><a name="line.490"></a> +<span class="sourceLineNo">491</span> /**<a name="line.491"></a> +<span class="sourceLineNo">492</span> * Return the file extension of a Path - if any.<a name="line.492"></a> +<span class="sourceLineNo">493</span> * <p><a name="line.493"></a> +<span class="sourceLineNo">494</span> * The returned file extension includes the leading <code>.</code><a name="line.494"></a> +<span class="sourceLineNo">495</span> * <p><a name="line.495"></a> +<span class="sourceLineNo">496</span> * Note that this only returns the last extension, e.g. the file extension<a name="line.496"></a> +<span class="sourceLineNo">497</span> * for <code>archive.tar.gz</code> would be <code>.gz</code><a name="line.497"></a> +<span class="sourceLineNo">498</span> * <a name="line.498"></a> +<span class="sourceLineNo">499</span> * @param path<a name="line.499"></a> +<span class="sourceLineNo">500</span> * Path which filename might contain an extension<a name="line.500"></a> +<span class="sourceLineNo">501</span> * @return File extension (including the leading <code>.</code>, or<a name="line.501"></a> +<span class="sourceLineNo">502</span> * {@link Optional#empty()} if the path has no extension<a name="line.502"></a> +<span class="sourceLineNo">503</span> */<a name="line.503"></a> +<span class="sourceLineNo">504</span> private static Optional<String> fileExtension(Path path) {<a name="line.504"></a> +<span class="sourceLineNo">505</span> Path fileName = path.getFileName();<a name="line.505"></a> +<span class="sourceLineNo">506</span> if (fileName == null) {<a name="line.506"></a> +<span class="sourceLineNo">507</span> return Optional.empty();<a name="line.507"></a> +<span class="sourceLineNo">508</span> }<a name="line.508"></a> +<span class="sourceLineNo">509</span> String filenameStr = fileName.toString();<a name="line.509"></a> +<span class="sourceLineNo">510</span> int last = filenameStr.lastIndexOf(".");<a name="line.510"></a> +<span class="sourceLineNo">511</span> if (last > -1) {<a name="line.511"></a> +<span class="sourceLineNo">512</span> return Optional.of(filenameStr.substring(last));<a name="line.512"></a> +<span class="sourceLineNo">513</span> }<a name="line.513"></a> +<span class="sourceLineNo">514</span> return Optional.empty();<a name="line.514"></a> +<span class="sourceLineNo">515</span> }<a name="line.515"></a> +<span class="sourceLineNo">516</span><a name="line.516"></a> +<span class="sourceLineNo">517</span> /**<a name="line.517"></a> +<span class="sourceLineNo">518</span> * Create a new {@link RDF} for a parse session.<a name="line.518"></a> +<span class="sourceLineNo">519</span> * <p><a name="line.519"></a> +<span class="sourceLineNo">520</span> * This is called by {@link #parse()} to set {@link #rdfTermFactory(RDF)} if<a name="line.520"></a> +<span class="sourceLineNo">521</span> * it is {@link Optional#empty()}.<a name="line.521"></a> +<span class="sourceLineNo">522</span> * <p><a name="line.522"></a> +<span class="sourceLineNo">523</span> * As parsed blank nodes might be made with<a name="line.523"></a> +<span class="sourceLineNo">524</span> * {@link RDF#createBlankNode(String)}, each call to this method SHOULD<a name="line.524"></a> +<span class="sourceLineNo">525</span> * return a new RDF instance.<a name="line.525"></a> +<span class="sourceLineNo">526</span> * <a name="line.526"></a> +<span class="sourceLineNo">527</span> * @return A new {@link RDF}<a name="line.527"></a> +<span class="sourceLineNo">528</span> */<a name="line.528"></a> +<span class="sourceLineNo">529</span> protected RDF createRDFTermFactory() {<a name="line.529"></a> +<span class="sourceLineNo">530</span> return new SimpleRDF();<a name="line.530"></a> +<span class="sourceLineNo">531</span> }<a name="line.531"></a> +<span class="sourceLineNo">532</span><a name="line.532"></a> +<span class="sourceLineNo">533</span> @Override<a name="line.533"></a> +<span class="sourceLineNo">534</span> public Future<ParseResult> parse() throws IOException, IllegalStateException {<a name="line.534"></a> +<span class="sourceLineNo">535</span> final AbstractRDFParser<T> c = prepareForParsing();<a name="line.535"></a> +<span class="sourceLineNo">536</span> return threadpool.submit(() -> {<a name="line.536"></a> +<span class="sourceLineNo">537</span> c.parseSynchronusly();<a name="line.537"></a> +<span class="sourceLineNo">538</span> return null;<a name="line.538"></a> +<span class="sourceLineNo">539</span> });<a name="line.539"></a> +<span class="sourceLineNo">540</span> }<a name="line.540"></a> +<span class="sourceLineNo">541</span><a name="line.541"></a> +<span class="sourceLineNo">542</span> @Override<a name="line.542"></a> +<span class="sourceLineNo">543</span> public T target(Consumer<Quad> consumer) {<a name="line.543"></a> +<span class="sourceLineNo">544</span> AbstractRDFParser<T> c = clone();<a name="line.544"></a> +<span class="sourceLineNo">545</span> c.resetTarget();<a name="line.545"></a> +<span class="sourceLineNo">546</span> c.target = consumer;<a name="line.546"></a> +<span class="sourceLineNo">547</span> return c.asT();<a name="line.547"></a> +<span class="sourceLineNo">548</span> }<a name="line.548"></a> +<span class="sourceLineNo">549</span><a name="line.549"></a> +<span class="sourceLineNo">550</span> @Override<a name="line.550"></a> +<span class="sourceLineNo">551</span> public T target(Dataset dataset) {<a name="line.551"></a> +<span class="sourceLineNo">552</span> @SuppressWarnings({ "rawtypes", "unchecked" })<a name="line.552"></a> +<span class="sourceLineNo">553</span> AbstractRDFParser<T> c = (AbstractRDFParser) RDFParser.super.target(dataset);<a name="line.553"></a> +<span class="sourceLineNo">554</span> c.resetTarget();<a name="line.554"></a> +<span class="sourceLineNo">555</span> c.targetDataset = Optional.of(dataset);<a name="line.555"></a> +<span class="sourceLineNo">556</span> return c.asT();<a name="line.556"></a> +<span class="sourceLineNo">557</span> }<a name="line.557"></a> +<span class="sourceLineNo">558</span><a name="line.558"></a> +<span class="sourceLineNo">559</span> @Override<a name="line.559"></a> +<span class="sourceLineNo">560</span> public T target(Graph graph) {<a name="line.560"></a> +<span class="sourceLineNo">561</span> @SuppressWarnings({ "rawtypes", "unchecked" }) // super calls our<a name="line.561"></a> +<span class="sourceLineNo">562</span> // .clone()<a name="line.562"></a> +<span class="sourceLineNo">563</span> AbstractRDFParser<T> c = (AbstractRDFParser) RDFParser.super.target(graph);<a name="line.563"></a> +<span class="sourceLineNo">564</span> c.resetTarget();<a name="line.564"></a> +<span class="sourceLineNo">565</span> c.targetGraph = Optional.of(graph);<a name="line.565"></a> +<span class="sourceLineNo">566</span> return c.asT();<a name="line.566"></a> +<span class="sourceLineNo">567</span> }<a name="line.567"></a> +<span class="sourceLineNo">568</span><a name="line.568"></a> +<span class="sourceLineNo">569</span>}<a name="line.569"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file
Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/simple/experimental/RDFParseException.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/simple/experimental/RDFParseException.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/simple/experimental/RDFParseException.html Wed Nov 16 10:57:28 2016 @@ -0,0 +1,122 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> +<html lang="en"> +<head> +<title>Source code</title> +<link rel="stylesheet" type="text/css" href="../../../../../../../stylesheet.css" title="Style"> +</head> +<body> +<div class="sourceContainer"> +<pre><span class="sourceLineNo">001</span>/**<a name="line.1"></a> +<span class="sourceLineNo">002</span> * Licensed to the Apache Software Foundation (ASF) under one<a name="line.2"></a> +<span class="sourceLineNo">003</span> * or more contributor license agreements. See the NOTICE file<a name="line.3"></a> +<span class="sourceLineNo">004</span> * distributed with this work for additional information<a name="line.4"></a> +<span class="sourceLineNo">005</span> * regarding copyright ownership. The ASF licenses this file<a name="line.5"></a> +<span class="sourceLineNo">006</span> * to you under the Apache License, Version 2.0 (the<a name="line.6"></a> +<span class="sourceLineNo">007</span> * "License"); you may not use this file except in compliance<a name="line.7"></a> +<span class="sourceLineNo">008</span> * with the License. You may obtain a copy of the License at<a name="line.8"></a> +<span class="sourceLineNo">009</span> *<a name="line.9"></a> +<span class="sourceLineNo">010</span> * http://www.apache.org/licenses/LICENSE-2.0<a name="line.10"></a> +<span class="sourceLineNo">011</span> *<a name="line.11"></a> +<span class="sourceLineNo">012</span> * Unless required by applicable law or agreed to in writing, software<a name="line.12"></a> +<span class="sourceLineNo">013</span> * distributed under the License is distributed on an "AS IS" BASIS,<a name="line.13"></a> +<span class="sourceLineNo">014</span> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<a name="line.14"></a> +<span class="sourceLineNo">015</span> * See the License for the specific language governing permissions and<a name="line.15"></a> +<span class="sourceLineNo">016</span> * limitations under the License.<a name="line.16"></a> +<span class="sourceLineNo">017</span> */<a name="line.17"></a> +<span class="sourceLineNo">018</span><a name="line.18"></a> +<span class="sourceLineNo">019</span>package org.apache.commons.rdf.simple.experimental;<a name="line.19"></a> +<span class="sourceLineNo">020</span><a name="line.20"></a> +<span class="sourceLineNo">021</span>import org.apache.commons.rdf.experimental.RDFParser;<a name="line.21"></a> +<span class="sourceLineNo">022</span><a name="line.22"></a> +<span class="sourceLineNo">023</span>public class RDFParseException extends Exception {<a name="line.23"></a> +<span class="sourceLineNo">024</span> private static final long serialVersionUID = 5427752643780702976L;<a name="line.24"></a> +<span class="sourceLineNo">025</span> private RDFParser builder;<a name="line.25"></a> +<span class="sourceLineNo">026</span><a name="line.26"></a> +<span class="sourceLineNo">027</span> public RDFParseException(RDFParser builder) {<a name="line.27"></a> +<span class="sourceLineNo">028</span> super();<a name="line.28"></a> +<span class="sourceLineNo">029</span> this.builder = builder;<a name="line.29"></a> +<span class="sourceLineNo">030</span> }<a name="line.30"></a> +<span class="sourceLineNo">031</span><a name="line.31"></a> +<span class="sourceLineNo">032</span> public RDFParseException(RDFParser builder, String message, Throwable cause) {<a name="line.32"></a> +<span class="sourceLineNo">033</span> super(message, cause);<a name="line.33"></a> +<span class="sourceLineNo">034</span> this.builder = builder;<a name="line.34"></a> +<span class="sourceLineNo">035</span> }<a name="line.35"></a> +<span class="sourceLineNo">036</span><a name="line.36"></a> +<span class="sourceLineNo">037</span> public RDFParseException(RDFParser builder, String message) {<a name="line.37"></a> +<span class="sourceLineNo">038</span> super(message);<a name="line.38"></a> +<span class="sourceLineNo">039</span> this.builder = builder;<a name="line.39"></a> +<span class="sourceLineNo">040</span> }<a name="line.40"></a> +<span class="sourceLineNo">041</span><a name="line.41"></a> +<span class="sourceLineNo">042</span> public RDFParseException(RDFParser builder, Throwable cause) {<a name="line.42"></a> +<span class="sourceLineNo">043</span> super(cause);<a name="line.43"></a> +<span class="sourceLineNo">044</span> this.builder = builder;<a name="line.44"></a> +<span class="sourceLineNo">045</span> }<a name="line.45"></a> +<span class="sourceLineNo">046</span><a name="line.46"></a> +<span class="sourceLineNo">047</span> public RDFParser getRDFParserBuilder() {<a name="line.47"></a> +<span class="sourceLineNo">048</span> return builder;<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> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file Modified: websites/production/commonsrdf/content/dependencies.html ============================================================================== --- websites/production/commonsrdf/content/dependencies.html (original) +++ websites/production/commonsrdf/content/dependencies.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – Project Dependencies</title> + <title>Commons RDF impl: Simple – Project Dependencies</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> @@ -226,7 +226,23 @@ <td class="content"> <a name="Project_Dependencies"></a> <div class="section"> -<h2><a name="Project_Dependencies"></a>Project Dependencies</h2><a name="Project_Dependencies_test"></a> +<h2><a name="Project_Dependencies"></a>Project Dependencies</h2><a name="Project_Dependencies_compile"></a> +<div class="section"> +<h3><a name="compile"></a>compile</h3> +<p>The following is a list of compile dependencies for this project. These dependencies are required to compile and run the application:</p> +<table border="0" class="bodyTable"> +<tr class="a"> +<th>GroupId</th> +<th>ArtifactId</th> +<th>Version</th> +<th>Type</th> +<th>Licenses</th></tr> +<tr class="b"> +<td>org.apache.commons</td> +<td><a class="externalLink" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">commons-rdf-api</a></td> +<td>0.3.0-incubating</td> +<td>jar</td> +<td><a class="externalLink" href="https://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a></td></tr></table></div><a name="Project_Dependencies_test"></a> <div class="section"> <h3><a name="test"></a>test</h3> <p>The following is a list of test dependencies for this project. These dependencies are only required to compile and run unit tests for the application:</p> @@ -235,18 +251,28 @@ <th>GroupId</th> <th>ArtifactId</th> <th>Version</th> +<th>Classifier</th> <th>Type</th> <th>Licenses</th></tr> <tr class="b"> <td>junit</td> <td><a class="externalLink" href="http://junit.org">junit</a></td> <td>4.12</td> +<td>-</td> <td>jar</td> <td><a class="externalLink" href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License 1.0</a></td></tr> <tr class="a"> +<td>org.apache.commons</td> +<td><a class="externalLink" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">commons-rdf-api</a></td> +<td>0.3.0-incubating</td> +<td>tests</td> +<td>jar</td> +<td><a class="externalLink" href="https://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a></td></tr> +<tr class="b"> <td>org.slf4j</td> <td><a class="externalLink" href="http://www.slf4j.org">slf4j-simple</a></td> <td>1.7.20</td> +<td>-</td> <td>jar</td> <td><a class="externalLink" href="http://www.opensource.org/licenses/mit-license.php">MIT License</a></td></tr></table></div></div><a name="Project_Transitive_Dependencies"></a> <div class="section"> @@ -299,7 +325,17 @@ <div class="section"> <h3><a name="Dependency_Tree"></a>Dependency Tree</h3> <ul> -<li>org.apache.commons:commons-rdf-api:jar:0.3.0-incubating <img id="_img1" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep0', '_img1' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep0" style="display:none"> +<li>org.apache.commons:commons-rdf-simple:jar:0.3.0-incubating <img id="_img1" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep0', '_img1' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep0" style="display:none"> +<table border="0" class="bodyTable"> +<tr class="a"> +<th>Commons RDF impl: Simple</th></tr> +<tr class="b"> +<td> +<p><b>Description: </b>Simple (if not naive) implementation of Commons RDF API</p> +<p><b>URL: </b><a class="externalLink" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">http://commonsrdf.incubator.apache.org/commons-rdf-simple/</a></p> +<p><b>Project Licenses: </b><a class="externalLink" href="https://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a></p></td></tr></table></div> +<ul> +<li>org.apache.commons:commons-rdf-api:jar:0.3.0-incubating (compile) <img id="_img3" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep2', '_img3' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep2" style="display:none"> <table border="0" class="bodyTable"> <tr class="a"> <th>Commons RDF API</th></tr> @@ -307,9 +343,17 @@ <td> <p><b>Description: </b>Commons Java API for RDF 1.1</p> <p><b>URL: </b><a class="externalLink" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">http://commonsrdf.incubator.apache.org/commons-rdf-api/</a></p> -<p><b>Project Licenses: </b><a class="externalLink" href="https://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a></p></td></tr></table></div> -<ul> -<li>junit:junit:jar:4.12 (test) <img id="_img3" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep2', '_img3' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep2" style="display:none"> +<p><b>Project Licenses: </b><a class="externalLink" href="https://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a></p></td></tr></table></div></li> +<li>org.apache.commons:commons-rdf-api:jar:tests:0.3.0-incubating (test) <img id="_img5" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep4', '_img5' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep4" style="display:none"> +<table border="0" class="bodyTable"> +<tr class="a"> +<th>Commons RDF API</th></tr> +<tr class="b"> +<td> +<p><b>Description: </b>Commons Java API for RDF 1.1</p> +<p><b>URL: </b><a class="externalLink" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">http://commonsrdf.incubator.apache.org/commons-rdf-api/</a></p> +<p><b>Project Licenses: </b><a class="externalLink" href="https://www.apache.org/licenses/LICENSE-2.0.txt">Apache License, Version 2.0</a></p></td></tr></table></div></li> +<li>junit:junit:jar:4.12 (test) <img id="_img7" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep6', '_img7' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep6" style="display:none"> <table border="0" class="bodyTable"> <tr class="a"> <th>JUnit</th></tr> @@ -319,7 +363,7 @@ <p><b>URL: </b><a class="externalLink" href="http://junit.org">http://junit.org</a></p> <p><b>Project Licenses: </b><a class="externalLink" href="http://www.eclipse.org/legal/epl-v10.html">Eclipse Public License 1.0</a></p></td></tr></table></div> <ul> -<li>org.hamcrest:hamcrest-core:jar:1.3 (test) <img id="_img5" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep4', '_img5' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep4" style="display:none"> +<li>org.hamcrest:hamcrest-core:jar:1.3 (test) <img id="_img9" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep8', '_img9' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep8" style="display:none"> <table border="0" class="bodyTable"> <tr class="a"> <th>Hamcrest Core</th></tr> @@ -328,7 +372,7 @@ <p><b>Description: </b>This is the core API of hamcrest matcher framework to be used by third-party framework providers. This includes the a foundation set of matcher implementations for common operations.</p> <p><b>URL: </b><a class="externalLink" href="https://github.com/hamcrest/JavaHamcrest/hamcrest-core">https://github.com/hamcrest/JavaHamcrest/hamcrest-core</a></p> <p><b>Project Licenses: </b><a class="externalLink" href="http://www.opensource.org/licenses/bsd-license.php">New BSD License</a></p></td></tr></table></div></li></ul></li> -<li>org.slf4j:slf4j-simple:jar:1.7.20 (test) <img id="_img7" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep6', '_img7' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep6" style="display:none"> +<li>org.slf4j:slf4j-simple:jar:1.7.20 (test) <img id="_img11" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep10', '_img11' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep10" style="display:none"> <table border="0" class="bodyTable"> <tr class="a"> <th>SLF4J Simple Binding</th></tr> @@ -338,7 +382,7 @@ <p><b>URL: </b><a class="externalLink" href="http://www.slf4j.org">http://www.slf4j.org</a></p> <p><b>Project Licenses: </b><a class="externalLink" href="http://www.opensource.org/licenses/mit-license.php">MIT License</a></p></td></tr></table></div> <ul> -<li>org.slf4j:slf4j-api:jar:1.7.20 (test) <img id="_img9" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep8', '_img9' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep8" style="display:none"> +<li>org.slf4j:slf4j-api:jar:1.7.20 (test) <img id="_img13" src="./images/icon_info_sml.gif" alt="[Information]" onclick="toggleDependencyDetails( '_dep12', '_img13' );" style="cursor: pointer; vertical-align: text-bottom;"></img><div id="_dep12" style="display:none"> <table border="0" class="bodyTable"> <tr class="a"> <th>SLF4J API Module</th></tr> @@ -351,7 +395,7 @@ <h2><a name="Licenses"></a>Licenses</h2> <p><b>Eclipse Public License 1.0: </b>JUnit</p> <p><b>MIT License: </b>SLF4J API Module, SLF4J Simple Binding</p> -<p><b>Apache License, Version 2.0: </b>Commons RDF API</p> +<p><b>Apache License, Version 2.0: </b>Commons RDF API, Commons RDF impl: Simple</p> <p><b>New BSD License: </b>Hamcrest Core</p></div><a name="Dependency_File_Details"></a> <div class="section"> <h2><a name="Dependency_File_Details"></a>Dependency File Details</h2> @@ -373,6 +417,22 @@ <td>1.5</td> <td>Yes</td></tr> <tr class="a"> +<td>commons-rdf-api-0.3.0-incubating.jar</td> +<td>19.1 kB</td> +<td>28</td> +<td>18</td> +<td>2</td> +<td>1.8</td> +<td>Yes</td></tr> +<tr class="b"> +<td>commons-rdf-api-0.3.0-incubating-tests.jar</td> +<td>49.9 kB</td> +<td>40</td> +<td>26</td> +<td>1</td> +<td>1.8</td> +<td>Yes</td></tr> +<tr class="a"> <td>hamcrest-core-1.3.jar</td> <td>45 kB</td> <td>52</td> @@ -405,21 +465,29 @@ <th>Java Version</th> <th>Debug Information</th></tr> <tr class="a"> -<td>4</td> -<td>411.6 kB</td> -<td>437</td> -<td>371</td> -<td>38</td> -<td>1.5</td> -<td>4</td></tr> -<tr class="b"> -<td>test: 4</td> -<td>test: 411.6 kB</td> -<td>test: 437</td> -<td>test: 371</td> -<td>test: 38</td> +<td>6</td> +<td>480.6 kB</td> +<td>505</td> +<td>415</td> +<td>41</td> +<td>1.8</td> +<td>6</td></tr> +<tr class="b"> +<td>compile: 1</td> +<td>compile: 19.1 kB</td> +<td>compile: 28</td> +<td>compile: 18</td> +<td>compile: 2</td> +<td>-</td> +<td>compile: 1</td></tr> +<tr class="a"> +<td>test: 5</td> +<td>test: 461.5 kB</td> +<td>test: 477</td> +<td>test: 397</td> +<td>test: 39</td> <td>-</td> -<td>test: 4</td></tr></table></div><a name="Dependency_Repository_Locations"></a> +<td>test: 5</td></tr></table></div><a name="Dependency_Repository_Locations"></a> <div class="section"> <h2><a name="Dependency_Repository_Locations"></a>Dependency Repository Locations</h2> <table border="0" class="bodyTable"> @@ -450,6 +518,12 @@ <td>junit:junit:jar:4.12</td> <td><a class="externalLink" href="https://repo.maven.apache.org/maven2/junit/junit/4.12/junit-4.12.jar"><img alt="Found at https://repo.maven.apache.org/maven2" src="images/icon_success_sml.gif" /></a></td></tr> <tr class="a"> +<td>org.apache.commons:commons-rdf-api:jar:0.3.0-incubating</td> +<td><a class="externalLink" href="https://repo.maven.apache.org/maven2/org/apache/commons/commons-rdf-api/0.3.0-incubating/commons-rdf-api-0.3.0-incubating.jar"><img alt="Found at https://repo.maven.apache.org/maven2" src="images/icon_success_sml.gif" /></a></td></tr> +<tr class="b"> +<td>org.apache.commons:commons-rdf-api:jar:tests:0.3.0-incubating</td> +<td><a class="externalLink" href="https://repo.maven.apache.org/maven2/org/apache/commons/commons-rdf-api/0.3.0-incubating/commons-rdf-api-0.3.0-incubating-tests.jar"><img alt="Found at https://repo.maven.apache.org/maven2" src="images/icon_success_sml.gif" /></a></td></tr> +<tr class="a"> <td>org.hamcrest:hamcrest-core:jar:1.3</td> <td><a class="externalLink" href="https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar"><img alt="Found at https://repo.maven.apache.org/maven2" src="images/icon_success_sml.gif" /></a></td></tr> <tr class="b"> @@ -462,8 +536,8 @@ <th>Total</th> <th>central</th></tr> <tr class="a"> -<td>4 (test: 4)</td> -<td>4</td></tr></table></div> +<td>6 (compile: 1, test: 5)</td> +<td>6</td></tr></table></div> </td> </tr> </table> Modified: websites/production/commonsrdf/content/dependency-convergence.html ============================================================================== --- websites/production/commonsrdf/content/dependency-convergence.html (original) +++ websites/production/commonsrdf/content/dependency-convergence.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – Reactor Dependency Convergence</title> + <title>Commons RDF impl: Simple – Reactor Dependency Convergence</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> Modified: websites/production/commonsrdf/content/dependency-info.html ============================================================================== --- websites/production/commonsrdf/content/dependency-info.html (original) +++ websites/production/commonsrdf/content/dependency-info.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – Dependency Information</title> + <title>Commons RDF impl: Simple – Dependency Information</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> @@ -231,37 +231,37 @@ <div class="source"> <pre><dependency> <groupId>org.apache.commons</groupId> - <artifactId>commons-rdf-api</artifactId> + <artifactId>commons-rdf-simple</artifactId> <version>0.3.0-incubating</version> </dependency></pre></div></div> <div class="section"> <h3><a name="Apache_Buildr"></a>Apache Buildr</h3><a name="Apache_Buildr"></a> <div class="source"> -<pre>'org.apache.commons:commons-rdf-api:jar:0.3.0-incubating'</pre></div></div> +<pre>'org.apache.commons:commons-rdf-simple:jar:0.3.0-incubating'</pre></div></div> <div class="section"> <h3><a name="Apache_Ivy"></a>Apache Ivy</h3><a name="Apache_Ivy"></a> <div class="source"> -<pre><dependency org="org.apache.commons" name="commons-rdf-api" rev="0.3.0-incubating"> - <artifact name="commons-rdf-api" type="jar" /> +<pre><dependency org="org.apache.commons" name="commons-rdf-simple" rev="0.3.0-incubating"> + <artifact name="commons-rdf-simple" type="jar" /> </dependency></pre></div></div> <div class="section"> <h3><a name="Groovy_Grape"></a>Groovy Grape</h3><a name="Groovy_Grape"></a> <div class="source"> <pre>@Grapes( -@Grab(group='org.apache.commons', module='commons-rdf-api', version='0.3.0-incubating') +@Grab(group='org.apache.commons', module='commons-rdf-simple', version='0.3.0-incubating') )</pre></div></div> <div class="section"> <h3><a name="GradleGrails"></a>Gradle/Grails</h3><a name="GradleGrails"></a> <div class="source"> -<pre>compile 'org.apache.commons:commons-rdf-api:0.3.0-incubating'</pre></div></div> +<pre>compile 'org.apache.commons:commons-rdf-simple:0.3.0-incubating'</pre></div></div> <div class="section"> <h3><a name="Scala_SBT"></a>Scala SBT</h3><a name="Scala_SBT"></a> <div class="source"> -<pre>libraryDependencies += "org.apache.commons" % "commons-rdf-api" % "0.3.0-incubating"</pre></div></div> +<pre>libraryDependencies += "org.apache.commons" % "commons-rdf-simple" % "0.3.0-incubating"</pre></div></div> <div class="section"> <h3><a name="Leiningen"></a>Leiningen</h3><a name="Leiningen"></a> <div class="source"> -<pre>[org.apache.commons/commons-rdf-api "0.3.0-incubating"]</pre></div></div></div> +<pre>[org.apache.commons/commons-rdf-simple "0.3.0-incubating"]</pre></div></div></div> </td> </tr> </table> Modified: websites/production/commonsrdf/content/distribution-management.html ============================================================================== --- websites/production/commonsrdf/content/distribution-management.html (original) +++ websites/production/commonsrdf/content/distribution-management.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – Project Distribution Management</title> + <title>Commons RDF impl: Simple – Project Distribution Management</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> Modified: websites/production/commonsrdf/content/findbugs.html ============================================================================== --- websites/production/commonsrdf/content/findbugs.html (original) +++ websites/production/commonsrdf/content/findbugs.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – FindBugs Bug Detector Report</title> + <title>Commons RDF impl: Simple – FindBugs Bug Detector Report</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> @@ -243,8 +243,8 @@ <th>Errors</th> <th>Missing Classes</th></tr> <tr class="b"> -<td>18</td> -<td>0</td> +<td>14</td> +<td>1</td> <td>0</td> <td>0</td></tr></table></div> <div class="section"> @@ -252,7 +252,25 @@ <table border="0" class="bodyTable"> <tr class="a"> <th>Class</th> -<th>Bugs</th></tr></table></div> +<th>Bugs</th></tr> +<tr class="b"> +<td><a href="#org.apache.commons.rdf.simple.DatasetGraphView">org.apache.commons.rdf.simple.DatasetGraphView</a></td> +<td>1</td></tr></table></div><a name="org.apache.commons.rdf.simple.DatasetGraphView"></a> +<div class="section"> +<h3><a name="org.apache.commons.rdf.simple.DatasetGraphView"></a>org.apache.commons.rdf.simple.DatasetGraphView</h3> +<table border="0" class="bodyTable"> +<tr class="a"> +<th>Bug</th> +<th>Category</th> +<th>Details</th> +<th>Line</th> +<th>Priority</th></tr> +<tr class="b"> +<td>org.apache.commons.rdf.simple.DatasetGraphView.unionOrNamedGraph() has Optional return type and returns explicit null</td> +<td>CORRECTNESS</td> +<td><a class="externalLink" href="http://findbugs.sourceforge.net/bugDescriptions.html#NP_OPTIONAL_RETURN_NULL">NP_OPTIONAL_RETURN_NULL</a></td> +<td><a href="./xref/org/apache/commons/rdf/simple/DatasetGraphView.html#L94">94</a></td> +<td>High</td></tr></table></div> </td> </tr> </table> Modified: websites/production/commonsrdf/content/index.html ============================================================================== --- websites/production/commonsrdf/content/index.html (original) +++ websites/production/commonsrdf/content/index.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – About</title> + <title>Commons RDF impl: Simple – About</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> @@ -225,8 +225,8 @@ </td> <td class="content"> <div class="section"> -<h2><a name="About_Commons_RDF_API"></a>About Commons RDF API</h2><a name="About_Commons_RDF_API"></a> -<p>Commons Java API for RDF 1.1</p></div> +<h2><a name="About_Commons_RDF_impl:_Simple"></a>About Commons RDF impl: Simple</h2><a name="About_Commons_RDF_impl:_Simple"></a> +<p>Simple (if not naive) implementation of Commons RDF API</p></div> </td> </tr> </table> Modified: websites/production/commonsrdf/content/integration.html ============================================================================== --- websites/production/commonsrdf/content/integration.html (original) +++ websites/production/commonsrdf/content/integration.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – CI Management</title> + <title>Commons RDF impl: Simple – CI Management</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li> Modified: websites/production/commonsrdf/content/issue-tracking.html ============================================================================== --- websites/production/commonsrdf/content/issue-tracking.html (original) +++ websites/production/commonsrdf/content/issue-tracking.html Wed Nov 16 10:57:28 2016 @@ -9,7 +9,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="Date-Revision-yyyymmdd" content="20161116" /> <meta http-equiv="Content-Language" content="en" /> - <title>Commons RDF API – Issue Management</title> + <title>Commons RDF impl: Simple – Issue Management</title> <link rel="stylesheet" href="./css/bootstrap.min.css" type="text/css" /> <link rel="stylesheet" href="./css/site.css" type="text/css" /> @@ -37,7 +37,7 @@ <div class="navbar"> <div class="navbar-inner"> <div class="container-fluid"> - <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-api/">Commons RDF API ™</a> + <a class="brand" href="http://commonsrdf.incubator.apache.org/commons-rdf-simple/">Commons RDF impl: Simple ™</a> <ul class="nav"> <li id="publishDate">Last Published: 16 November 2016</li>