Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/QuadLike.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/QuadLike.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/QuadLike.html Wed Sep 7 02:26:20 2016 @@ -0,0 +1,141 @@ +<!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.api;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>import java.util.Optional;<a name="line.20"></a> +<span class="sourceLineNo">021</span><a name="line.21"></a> +<span class="sourceLineNo">022</span>/**<a name="line.22"></a> +<span class="sourceLineNo">023</span> * A generalised "quad-like" interface, extended by {@link Quad}.<a name="line.23"></a> +<span class="sourceLineNo">024</span> * <p><a name="line.24"></a> +<span class="sourceLineNo">025</span> * A QuadLike statement has at least a {@link #getSubject()},<a name="line.25"></a> +<span class="sourceLineNo">026</span> * {@link #getPredicate()}, {@link #getObject()} and {@link #getGraphName()},<a name="line.26"></a> +<span class="sourceLineNo">027</span> * but unlike a {@link Quad} does not have a formalised<a name="line.27"></a> +<span class="sourceLineNo">028</span> * {@link Quad#equals(Object)} <a name="line.28"></a> +<span class="sourceLineNo">029</span> * or {@link Quad#hashCode()} <a name="line.29"></a> +<span class="sourceLineNo">030</span> * semantics. This interface can also be used for <em>generalised quads</em><a name="line.30"></a> +<span class="sourceLineNo">031</span> * (e.g. a {@link BlankNode} as predicate).<a name="line.31"></a> +<span class="sourceLineNo">032</span> * <p><a name="line.32"></a> +<span class="sourceLineNo">033</span> * Implementations should specialise which specific {@link RDFTerm} types they<a name="line.33"></a> +<span class="sourceLineNo">034</span> * return for {@link #getSubject()}, {@link #getPredicate()},<a name="line.34"></a> +<span class="sourceLineNo">035</span> * {@link #getObject()} and {@link #getGraphName()}.<a name="line.35"></a> +<span class="sourceLineNo">036</span> *<a name="line.36"></a> +<span class="sourceLineNo">037</span> * @param <S><a name="line.37"></a> +<span class="sourceLineNo">038</span> * The type of subjects in the statements, typically<a name="line.38"></a> +<span class="sourceLineNo">039</span> * {@link BlankNodeOrIRI}<a name="line.39"></a> +<span class="sourceLineNo">040</span> * @param <P><a name="line.40"></a> +<span class="sourceLineNo">041</span> * The type of predicates in the statements, typically {@link IRI}<a name="line.41"></a> +<span class="sourceLineNo">042</span> * @param <O><a name="line.42"></a> +<span class="sourceLineNo">043</span> * The type of objects in the statements, typically {@link RDFTerm}<a name="line.43"></a> +<span class="sourceLineNo">044</span> * @param <G><a name="line.44"></a> +<span class="sourceLineNo">045</span> * The type of graph names in the statements, typically<a name="line.45"></a> +<span class="sourceLineNo">046</span> * {@link BlankNodeOrIRI}<a name="line.46"></a> +<span class="sourceLineNo">047</span> * <a name="line.47"></a> +<span class="sourceLineNo">048</span> * @since 0.3.0-incubating<a name="line.48"></a> +<span class="sourceLineNo">049</span> * @see Quad<a name="line.49"></a> +<span class="sourceLineNo">050</span> */<a name="line.50"></a> +<span class="sourceLineNo">051</span>public interface QuadLike<S extends RDFTerm, P extends RDFTerm, O extends RDFTerm, G extends RDFTerm><a name="line.51"></a> +<span class="sourceLineNo">052</span> extends TripleLike<S, P, O> {<a name="line.52"></a> +<span class="sourceLineNo">053</span><a name="line.53"></a> +<span class="sourceLineNo">054</span> /**<a name="line.54"></a> +<span class="sourceLineNo">055</span> * The graph name (graph label) of this statement, if present.<a name="line.55"></a> +<span class="sourceLineNo">056</span> * <p><a name="line.56"></a> +<span class="sourceLineNo">057</span> * If {@link Optional#isPresent()}, then the {@link Optional#get()} indicate<a name="line.57"></a> +<span class="sourceLineNo">058</span> * the graph name of this statement. If the graph name is not present,e.g.<a name="line.58"></a> +<span class="sourceLineNo">059</span> * the value is {@link Optional#empty()}, it indicates that this Quad is in<a name="line.59"></a> +<span class="sourceLineNo">060</span> * the default graph.<a name="line.60"></a> +<span class="sourceLineNo">061</span> *<a name="line.61"></a> +<span class="sourceLineNo">062</span> * @return If {@link Optional#isPresent()}, the graph name of this quad,<a name="line.62"></a> +<span class="sourceLineNo">063</span> * otherwise {@link Optional#empty()}, indicating the default<a name="line.63"></a> +<span class="sourceLineNo">064</span> * graph. The graph name is typically an {@link IRI} or<a name="line.64"></a> +<span class="sourceLineNo">065</span> * {@link BlankNode}.<a name="line.65"></a> +<span class="sourceLineNo">066</span> */<a name="line.66"></a> +<span class="sourceLineNo">067</span> Optional<G> getGraphName();<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> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file
Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFSyntax.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFSyntax.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFSyntax.html Wed Sep 7 02:26:20 2016 @@ -0,0 +1,255 @@ +<!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.api;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>import java.util.Arrays;<a name="line.20"></a> +<span class="sourceLineNo">021</span>import java.util.Locale;<a name="line.21"></a> +<span class="sourceLineNo">022</span>import java.util.Optional;<a name="line.22"></a> +<span class="sourceLineNo">023</span><a name="line.23"></a> +<span class="sourceLineNo">024</span>/** <a name="line.24"></a> +<span class="sourceLineNo">025</span> * Enumeration of the RDF 1.1 serialization syntaxes.<a name="line.25"></a> +<span class="sourceLineNo">026</span> * <p><a name="line.26"></a> +<span class="sourceLineNo">027</span> * This enumeration lists the W3C standardized <a name="line.27"></a> +<span class="sourceLineNo">028</span> * RDF 1.1 syntaxes like {@link #TURTLE} and {@link #JSONLD}. <a name="line.28"></a> +<span class="sourceLineNo">029</span> * Note the existence of other RDF syntaxes that are not included here, <a name="line.29"></a> +<span class="sourceLineNo">030</span> * e.g. <a href="http://www.w3.org/TeamSubmission/n3/">N3</a> <a name="line.30"></a> +<span class="sourceLineNo">031</span> * and <a href="https://en.wikipedia.org/wiki/TriX_%28syntax%29">TriX</a>.<a name="line.31"></a> +<span class="sourceLineNo">032</span> * <a name="line.32"></a> +<span class="sourceLineNo">033</span> * @see <a href="https://www.w3.org/TR/rdf11-primer/#section-graph-syntax">RDF 1.1 Primer</a><a name="line.33"></a> +<span class="sourceLineNo">034</span> *<a name="line.34"></a> +<span class="sourceLineNo">035</span> */<a name="line.35"></a> +<span class="sourceLineNo">036</span>public enum RDFSyntax {<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> * JSON-LD 1.0<a name="line.39"></a> +<span class="sourceLineNo">040</span> * <a name="line.40"></a> +<span class="sourceLineNo">041</span> * @see <a href="https://www.w3.org/TR/json-ld/">https://www.w3.org/TR/json-ld/</a><a name="line.41"></a> +<span class="sourceLineNo">042</span> * <a name="line.42"></a> +<span class="sourceLineNo">043</span> */<a name="line.43"></a> +<span class="sourceLineNo">044</span> JSONLD("JSON-LD 1.0", "application/ld+json", ".jsonld", true),<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> * RDF 1.1 Turtle<a name="line.47"></a> +<span class="sourceLineNo">048</span> * <a name="line.48"></a> +<span class="sourceLineNo">049</span> * @see <a href="https://www.w3.org/TR/turtle/">https://www.w3.org/TR/turtle/</a><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> +<span class="sourceLineNo">052</span> TURTLE("RDF 1.1 Turtle", "text/turtle", ".ttl", false), <a name="line.52"></a> +<span class="sourceLineNo">053</span><a name="line.53"></a> +<span class="sourceLineNo">054</span> /**<a name="line.54"></a> +<span class="sourceLineNo">055</span> * RDF 1.1 N-Quads<a name="line.55"></a> +<span class="sourceLineNo">056</span> * <a name="line.56"></a> +<span class="sourceLineNo">057</span> * @see <a href="https://www.w3.org/TR/n-quads/">https://www.w3.org/TR/n-quads/</a><a name="line.57"></a> +<span class="sourceLineNo">058</span> */<a name="line.58"></a> +<span class="sourceLineNo">059</span> NQUADS("RDF 1.1 N-Quads", "application/n-quads", ".nq", true),<a name="line.59"></a> +<span class="sourceLineNo">060</span><a name="line.60"></a> +<span class="sourceLineNo">061</span> /**<a name="line.61"></a> +<span class="sourceLineNo">062</span> * RDF 1.1 N-Triples<a name="line.62"></a> +<span class="sourceLineNo">063</span> * <a name="line.63"></a> +<span class="sourceLineNo">064</span> * @see <a href="https://www.w3.org/TR/n-triples/">https://www.w3.org/TR/n-triples/</a><a name="line.64"></a> +<span class="sourceLineNo">065</span> */<a name="line.65"></a> +<span class="sourceLineNo">066</span> NTRIPLES("RDF 1.1 N-Triples", "application/n-triples", ".nt", false),<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> +<span class="sourceLineNo">069</span> * HTML+RDFa 1.1<a name="line.69"></a> +<span class="sourceLineNo">070</span> * <a name="line.70"></a> +<span class="sourceLineNo">071</span> * @see <a href="https://www.w3.org/TR/html-rdfa/">https://www.w3.org/TR/html-rdfa/</a><a name="line.71"></a> +<span class="sourceLineNo">072</span> */<a name="line.72"></a> +<span class="sourceLineNo">073</span> RDFA_HTML("HTML+RDFa 1.1", "text/html", ".html", false),<a name="line.73"></a> +<span class="sourceLineNo">074</span> <a name="line.74"></a> +<span class="sourceLineNo">075</span> /**<a name="line.75"></a> +<span class="sourceLineNo">076</span> * XHTML+RDFa 1.1 <a name="line.76"></a> +<span class="sourceLineNo">077</span> * <a name="line.77"></a> +<span class="sourceLineNo">078</span> * @see <a href="https://www.w3.org/TR/xhtml-rdfa/">https://www.w3.org/TR/xhtml-rdfa/</a> <a name="line.78"></a> +<span class="sourceLineNo">079</span> */<a name="line.79"></a> +<span class="sourceLineNo">080</span> RDFA_XHTML("XHTML+RDFa 1.1", "application/xhtml+xml", ".xhtml", false),<a name="line.80"></a> +<span class="sourceLineNo">081</span> <a name="line.81"></a> +<span class="sourceLineNo">082</span> /**<a name="line.82"></a> +<span class="sourceLineNo">083</span> * RDF 1.1 XML Syntax<a name="line.83"></a> +<span class="sourceLineNo">084</span> * <a name="line.84"></a> +<span class="sourceLineNo">085</span> * @see <a href="https://www.w3.org/TR/rdf-syntax-grammar/">https://www.w3.org/TR/rdf-syntax-grammar/</a><a name="line.85"></a> +<span class="sourceLineNo">086</span> */<a name="line.86"></a> +<span class="sourceLineNo">087</span> RDFXML("RDF 1.1 XML Syntax", "application/rdf+xml", ".rdf", false),<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> * RDF 1.1 TriG<a name="line.90"></a> +<span class="sourceLineNo">091</span> * <a name="line.91"></a> +<span class="sourceLineNo">092</span> * @see <a href="https://www.w3.org/TR/trig/">https://www.w3.org/TR/trig/</a><a name="line.92"></a> +<span class="sourceLineNo">093</span> */<a name="line.93"></a> +<span class="sourceLineNo">094</span> TRIG("RDF 1.1 TriG", "application/trig", ".trig", true);<a name="line.94"></a> +<span class="sourceLineNo">095</span><a name="line.95"></a> +<span class="sourceLineNo">096</span> /** <a name="line.96"></a> +<span class="sourceLineNo">097</span> * The <a href="https://tools.ietf.org/html/rfc2046">IANA media type</a> for the RDF syntax.<a name="line.97"></a> +<span class="sourceLineNo">098</span> * <p> <a name="line.98"></a> +<span class="sourceLineNo">099</span> * The media type can be used as part of <a name="line.99"></a> +<span class="sourceLineNo">100</span> * <code>Content-Type</code> <a name="line.100"></a> +<span class="sourceLineNo">101</span> * and <code>Accept</code> for <em>content negotiation</em> in the <a name="line.101"></a> +<span class="sourceLineNo">102</span> * <a href="https://tools.ietf.org/html/rfc7231#section-3.1.1.1">HTTP protocol</a>. <a name="line.102"></a> +<span class="sourceLineNo">103</span> */<a name="line.103"></a> +<span class="sourceLineNo">104</span> public final String mediaType;<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> +<span class="sourceLineNo">107</span> * The <a href="https://tools.ietf.org/html/rfc2046">IANA-registered</a> file extension.<a name="line.107"></a> +<span class="sourceLineNo">108</span> * <p><a name="line.108"></a> +<span class="sourceLineNo">109</span> * The file extension includes the leading period, e.g. <code>.jsonld</code><a name="line.109"></a> +<span class="sourceLineNo">110</span> */<a name="line.110"></a> +<span class="sourceLineNo">111</span> public final String fileExtension;<a name="line.111"></a> +<span class="sourceLineNo">112</span> <a name="line.112"></a> +<span class="sourceLineNo">113</span> /**<a name="line.113"></a> +<span class="sourceLineNo">114</span> * Indicate if this RDF syntax supports <a href="https://www.w3.org/TR/rdf11-concepts/#section-dataset">RDF Datasets</a>. <a name="line.114"></a> +<span class="sourceLineNo">115</span> */<a name="line.115"></a> +<span class="sourceLineNo">116</span> public final boolean supportsDataset;<a name="line.116"></a> +<span class="sourceLineNo">117</span> <a name="line.117"></a> +<span class="sourceLineNo">118</span> private final String name;<a name="line.118"></a> +<span class="sourceLineNo">119</span> <a name="line.119"></a> +<span class="sourceLineNo">120</span> /** <a name="line.120"></a> +<span class="sourceLineNo">121</span> * A human-readable name for the RDF syntax.<a name="line.121"></a> +<span class="sourceLineNo">122</span> * <p><a name="line.122"></a> +<span class="sourceLineNo">123</span> * The name is equivalent to the the title of the corresponding W3C Specification.<a name="line.123"></a> +<span class="sourceLineNo">124</span> */<a name="line.124"></a> +<span class="sourceLineNo">125</span> @Override<a name="line.125"></a> +<span class="sourceLineNo">126</span> public String toString() {<a name="line.126"></a> +<span class="sourceLineNo">127</span> return name;<a name="line.127"></a> +<span class="sourceLineNo">128</span> }<a name="line.128"></a> +<span class="sourceLineNo">129</span> <a name="line.129"></a> +<span class="sourceLineNo">130</span> private RDFSyntax(String name, String mediaType, String fileExtension, boolean supportsDataset) {<a name="line.130"></a> +<span class="sourceLineNo">131</span> this.name = name;<a name="line.131"></a> +<span class="sourceLineNo">132</span> this.mediaType = mediaType;<a name="line.132"></a> +<span class="sourceLineNo">133</span> this.fileExtension = fileExtension;<a name="line.133"></a> +<span class="sourceLineNo">134</span> this.supportsDataset = supportsDataset;<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> * Return the RDFSyntax with the specified media type.<a name="line.138"></a> +<span class="sourceLineNo">139</span> * <p><a name="line.139"></a> +<span class="sourceLineNo">140</span> * The <code>mediaType</code> is compared in lower case, therefore it might<a name="line.140"></a> +<span class="sourceLineNo">141</span> * not be equal to the {@link RDFSyntax#mediaType} of the returned<a name="line.141"></a> +<span class="sourceLineNo">142</span> * RDFSyntax.<a name="line.142"></a> +<span class="sourceLineNo">143</span> * <p><a name="line.143"></a> +<span class="sourceLineNo">144</span> * For convenience matching of media types used in a<a name="line.144"></a> +<span class="sourceLineNo">145</span> * <code>Content-Type</code> header, if the <code>mediaType</code> contains<a name="line.145"></a> +<span class="sourceLineNo">146</span> * the characters <code>;</code>, <code>,</code> or white space, only the<a name="line.146"></a> +<span class="sourceLineNo">147</span> * part of the string to the left of those characters are considered.<a name="line.147"></a> +<span class="sourceLineNo">148</span> * <a name="line.148"></a> +<span class="sourceLineNo">149</span> * @param mediaType<a name="line.149"></a> +<span class="sourceLineNo">150</span> * The media type to match<a name="line.150"></a> +<span class="sourceLineNo">151</span> * @return If {@link Optional#isPresent()}, the {@link RDFSyntax} which has<a name="line.151"></a> +<span class="sourceLineNo">152</span> * a matching {@link RDFSyntax#mediaType}, otherwise<a name="line.152"></a> +<span class="sourceLineNo">153</span> * {@link Optional#empty()} indicating that <a name="line.153"></a> +<span class="sourceLineNo">154</span> * no matching syntax was found.<a name="line.154"></a> +<span class="sourceLineNo">155</span> */<a name="line.155"></a> +<span class="sourceLineNo">156</span> public static Optional<RDFSyntax> byMediaType(String mediaType) {<a name="line.156"></a> +<span class="sourceLineNo">157</span> final String type = mediaType.toLowerCase(Locale.ENGLISH).<a name="line.157"></a> +<span class="sourceLineNo">158</span> split("\\s*[;,]", 2)[0];<a name="line.158"></a> +<span class="sourceLineNo">159</span> return Arrays.stream(RDFSyntax.values()).filter(<a name="line.159"></a> +<span class="sourceLineNo">160</span> t -> t.mediaType.equals(type)).findAny(); <a name="line.160"></a> +<span class="sourceLineNo">161</span> }<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> +<span class="sourceLineNo">164</span> * Return the RDFSyntax with the specified file extension.<a name="line.164"></a> +<span class="sourceLineNo">165</span> * <p><a name="line.165"></a> +<span class="sourceLineNo">166</span> * The <code>fileExtension</code> is compared in lower case, therefore it<a name="line.166"></a> +<span class="sourceLineNo">167</span> * might not be equal to the {@link RDFSyntax#fileExtension} of the returned<a name="line.167"></a> +<span class="sourceLineNo">168</span> * RDFSyntax.<a name="line.168"></a> +<span class="sourceLineNo">169</span> * <a name="line.169"></a> +<span class="sourceLineNo">170</span> * @param fileExtension<a name="line.170"></a> +<span class="sourceLineNo">171</span> * The fileExtension to match, starting with <code>.</code><a name="line.171"></a> +<span class="sourceLineNo">172</span> * @return If {@link Optional#isPresent()}, the {@link RDFSyntax} which has<a name="line.172"></a> +<span class="sourceLineNo">173</span> * a matching {@link RDFSyntax#fileExtension}, otherwise<a name="line.173"></a> +<span class="sourceLineNo">174</span> * {@link Optional#empty()} indicating that no matching file<a name="line.174"></a> +<span class="sourceLineNo">175</span> * extension was found.<a name="line.175"></a> +<span class="sourceLineNo">176</span> */<a name="line.176"></a> +<span class="sourceLineNo">177</span> public static Optional<RDFSyntax> byFileExtension(String fileExtension) { <a name="line.177"></a> +<span class="sourceLineNo">178</span> final String ext = fileExtension.toLowerCase(Locale.ENGLISH);<a name="line.178"></a> +<span class="sourceLineNo">179</span> return Arrays.stream(RDFSyntax.values()).filter(<a name="line.179"></a> +<span class="sourceLineNo">180</span> t -> t.fileExtension.equals(ext)).findAny(); <a name="line.180"></a> +<span class="sourceLineNo">181</span> }<a name="line.181"></a> +<span class="sourceLineNo">182</span><a name="line.182"></a> +<span class="sourceLineNo">183</span>}<a name="line.183"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFTerm.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFTerm.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFTerm.html Wed Sep 7 02:26:20 2016 @@ -0,0 +1,112 @@ +<!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.api;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>/**<a name="line.20"></a> +<span class="sourceLineNo">021</span> * An <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term" >RDF-1.1<a name="line.21"></a> +<span class="sourceLineNo">022</span> * Term</a>, as defined by <a href= "http://www.w3.org/TR/rdf11-concepts/"<a name="line.22"></a> +<span class="sourceLineNo">023</span> * >RDF-1.1 Concepts and Abstract Syntax</a>, a W3C Recommendation published on<a name="line.23"></a> +<span class="sourceLineNo">024</span> * 25 February 2014.<br><a name="line.24"></a> +<span class="sourceLineNo">025</span> *<a name="line.25"></a> +<span class="sourceLineNo">026</span> * @see <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term" >RDF-1.1<a name="line.26"></a> +<span class="sourceLineNo">027</span> * Term</a><a name="line.27"></a> +<span class="sourceLineNo">028</span> */<a name="line.28"></a> +<span class="sourceLineNo">029</span>public interface RDFTerm {<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> * Return the term serialised as specified by the RDF-1.1 N-Triples Canonical form.<a name="line.32"></a> +<span class="sourceLineNo">033</span> *<a name="line.33"></a> +<span class="sourceLineNo">034</span> * @return The term serialised as RDF-1.1 N-Triples.<a name="line.34"></a> +<span class="sourceLineNo">035</span> * @see <a href="http://www.w3.org/TR/n-triples/#canonical-ntriples"><a name="line.35"></a> +<span class="sourceLineNo">036</span> * RDF-1.1 N-Triples Canonical form</a><a name="line.36"></a> +<span class="sourceLineNo">037</span> */<a name="line.37"></a> +<span class="sourceLineNo">038</span> String ntriplesString();<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> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFTermFactory.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFTermFactory.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/RDFTermFactory.html Wed Sep 7 02:26:20 2016 @@ -0,0 +1,350 @@ +<!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.api;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>import java.io.Serializable;<a name="line.20"></a> +<span class="sourceLineNo">021</span>import java.util.Locale;<a name="line.21"></a> +<span class="sourceLineNo">022</span><a name="line.22"></a> +<span class="sourceLineNo">023</span>/**<a name="line.23"></a> +<span class="sourceLineNo">024</span> * Factory for creating RDFTerm and Graph instances.<a name="line.24"></a> +<span class="sourceLineNo">025</span> * <p><a name="line.25"></a> +<span class="sourceLineNo">026</span> * It is not specified how an implementation should provide a RDFTermFactory.<a name="line.26"></a> +<span class="sourceLineNo">027</span> * <p><a name="line.27"></a> +<span class="sourceLineNo">028</span> * If an implementation does not support a particular method (e.g. it requires<a name="line.28"></a> +<span class="sourceLineNo">029</span> * additional parameters or can't create graphs), then it MAY throw<a name="line.29"></a> +<span class="sourceLineNo">030</span> * {@link UnsupportedOperationException}, as provided by the <code>default</code><a name="line.30"></a> +<span class="sourceLineNo">031</span> * implementations in this interface.<a name="line.31"></a> +<span class="sourceLineNo">032</span> * <p><a name="line.32"></a> +<span class="sourceLineNo">033</span> * If a factory method does not allow or support a provided parameter, e.g.<a name="line.33"></a> +<span class="sourceLineNo">034</span> * because an IRI is considered invalid, then it SHOULD throw<a name="line.34"></a> +<span class="sourceLineNo">035</span> * {@link IllegalArgumentException}.<a name="line.35"></a> +<span class="sourceLineNo">036</span> *<a name="line.36"></a> +<span class="sourceLineNo">037</span> * @see RDFTerm<a name="line.37"></a> +<span class="sourceLineNo">038</span> * @see Graph<a name="line.38"></a> +<span class="sourceLineNo">039</span> * @see Quad<a name="line.39"></a> +<span class="sourceLineNo">040</span> */<a name="line.40"></a> +<span class="sourceLineNo">041</span>public interface RDFTermFactory {<a name="line.41"></a> +<span class="sourceLineNo">042</span><a name="line.42"></a> +<span class="sourceLineNo">043</span> /**<a name="line.43"></a> +<span class="sourceLineNo">044</span> * Create a new blank node.<a name="line.44"></a> +<span class="sourceLineNo">045</span> * <p><a name="line.45"></a> +<span class="sourceLineNo">046</span> * The returned blank node MUST NOT be equal to any existing<a name="line.46"></a> +<span class="sourceLineNo">047</span> * {@link BlankNode} instances according to {@link BlankNode#equals(Object)}.<a name="line.47"></a> +<span class="sourceLineNo">048</span> *<a name="line.48"></a> +<span class="sourceLineNo">049</span> * @return A new, unique {@link BlankNode}<a name="line.49"></a> +<span class="sourceLineNo">050</span> * @throws UnsupportedOperationException<a name="line.50"></a> +<span class="sourceLineNo">051</span> * If the operation is not supported.<a name="line.51"></a> +<span class="sourceLineNo">052</span> */<a name="line.52"></a> +<span class="sourceLineNo">053</span> default BlankNode createBlankNode() throws UnsupportedOperationException {<a name="line.53"></a> +<span class="sourceLineNo">054</span> throw new UnsupportedOperationException(<a name="line.54"></a> +<span class="sourceLineNo">055</span> "createBlankNode() not supported");<a name="line.55"></a> +<span class="sourceLineNo">056</span> }<a name="line.56"></a> +<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> * Create a blank node based on the given name.<a name="line.59"></a> +<span class="sourceLineNo">060</span> * <p><a name="line.60"></a> +<span class="sourceLineNo">061</span> * All {@link BlankNode}s created with the given <code>name</code><a name="line.61"></a> +<span class="sourceLineNo">062</span> * <em>on a particular instance</em> of <code>RDFTermFactory</code> MUST be<a name="line.62"></a> +<span class="sourceLineNo">063</span> * equivalent according to {@link BlankNode#equals(Object)},<a name="line.63"></a> +<span class="sourceLineNo">064</span> * <p><a name="line.64"></a> +<span class="sourceLineNo">065</span> * The returned BlankNode MUST NOT be equal to <code>BlankNode</code><a name="line.65"></a> +<span class="sourceLineNo">066</span> * instances returned for any other <code>name</code> or those returned from<a name="line.66"></a> +<span class="sourceLineNo">067</span> * {@link #createBlankNode()}.<a name="line.67"></a> +<span class="sourceLineNo">068</span> * <p><a name="line.68"></a> +<span class="sourceLineNo">069</span> * The returned BlankNode SHOULD NOT be equivalent to any BlankNodes created<a name="line.69"></a> +<span class="sourceLineNo">070</span> * on a <em>different</em> <code>RDFTermFactory</code> instance, e.g.<a name="line.70"></a> +<span class="sourceLineNo">071</span> * different instances of <code>RDFTermFactory</code> should produce<a name="line.71"></a> +<span class="sourceLineNo">072</span> * different blank nodes for the same <code>name</code> unless they<a name="line.72"></a> +<span class="sourceLineNo">073</span> * purposely are intending to create equivalent {@link BlankNode}<a name="line.73"></a> +<span class="sourceLineNo">074</span> * instances (e.g. a reinstated {@link Serializable} factory).<a name="line.74"></a> +<span class="sourceLineNo">075</span> *<a name="line.75"></a> +<span class="sourceLineNo">076</span> * @param name<a name="line.76"></a> +<span class="sourceLineNo">077</span> * A non-empty, non-null, String that is unique to this blank<a name="line.77"></a> +<span class="sourceLineNo">078</span> * node in the context of this {@link RDFTermFactory}.<a name="line.78"></a> +<span class="sourceLineNo">079</span> * @return A BlankNode for the given name<a name="line.79"></a> +<span class="sourceLineNo">080</span> * @throws UnsupportedOperationException<a name="line.80"></a> +<span class="sourceLineNo">081</span> * If the operation is not supported.<a name="line.81"></a> +<span class="sourceLineNo">082</span> */<a name="line.82"></a> +<span class="sourceLineNo">083</span> default BlankNode createBlankNode(String name)<a name="line.83"></a> +<span class="sourceLineNo">084</span> throws UnsupportedOperationException {<a name="line.84"></a> +<span class="sourceLineNo">085</span> throw new UnsupportedOperationException(<a name="line.85"></a> +<span class="sourceLineNo">086</span> "createBlankNode(String) not supported");<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> /**<a name="line.89"></a> +<span class="sourceLineNo">090</span> * Create a new graph.<a name="line.90"></a> +<span class="sourceLineNo">091</span> *<a name="line.91"></a> +<span class="sourceLineNo">092</span> * It is undefined if the graph will be persisted by any underlying storage<a name="line.92"></a> +<span class="sourceLineNo">093</span> * mechanism.<a name="line.93"></a> +<span class="sourceLineNo">094</span> *<a name="line.94"></a> +<span class="sourceLineNo">095</span> * @return A new Graph<a name="line.95"></a> +<span class="sourceLineNo">096</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.96"></a> +<span class="sourceLineNo">097</span> */<a name="line.97"></a> +<span class="sourceLineNo">098</span> default Graph createGraph() throws UnsupportedOperationException {<a name="line.98"></a> +<span class="sourceLineNo">099</span> throw new UnsupportedOperationException("createGraph() not supported");<a name="line.99"></a> +<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> /**<a name="line.102"></a> +<span class="sourceLineNo">103</span> * Create a new dataset.<a name="line.103"></a> +<span class="sourceLineNo">104</span> *<a name="line.104"></a> +<span class="sourceLineNo">105</span> * It is undefined if the dataset will be persisted by any underlying storage<a name="line.105"></a> +<span class="sourceLineNo">106</span> * mechanism.<a name="line.106"></a> +<span class="sourceLineNo">107</span> *<a name="line.107"></a> +<span class="sourceLineNo">108</span> * @return A new Dataset<a name="line.108"></a> +<span class="sourceLineNo">109</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.109"></a> +<span class="sourceLineNo">110</span> */<a name="line.110"></a> +<span class="sourceLineNo">111</span> default Dataset createDataset() throws UnsupportedOperationException {<a name="line.111"></a> +<span class="sourceLineNo">112</span> throw new UnsupportedOperationException("createDataset() not supported");<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> /**<a name="line.115"></a> +<span class="sourceLineNo">116</span> * Create an IRI from a (possibly escaped) String.<a name="line.116"></a> +<span class="sourceLineNo">117</span> *<a name="line.117"></a> +<span class="sourceLineNo">118</span> * The provided iri string MUST be valid according to the <a<a name="line.118"></a> +<span class="sourceLineNo">119</span> * href="http://www.w3.org/TR/rdf11-concepts/#dfn-iri">W3C RDF-1.1 IRI</a><a name="line.119"></a> +<span class="sourceLineNo">120</span> * definition.<a name="line.120"></a> +<span class="sourceLineNo">121</span> *<a name="line.121"></a> +<span class="sourceLineNo">122</span> * @param iri Internationalized Resource Identifier<a name="line.122"></a> +<span class="sourceLineNo">123</span> * @return A new IRI<a name="line.123"></a> +<span class="sourceLineNo">124</span> * @throws IllegalArgumentException If the provided string is not acceptable, e.g. does not<a name="line.124"></a> +<span class="sourceLineNo">125</span> * conform to the RFC3987 syntax.<a name="line.125"></a> +<span class="sourceLineNo">126</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.126"></a> +<span class="sourceLineNo">127</span> */<a name="line.127"></a> +<span class="sourceLineNo">128</span> default IRI createIRI(String iri) throws IllegalArgumentException,<a name="line.128"></a> +<span class="sourceLineNo">129</span> UnsupportedOperationException {<a name="line.129"></a> +<span class="sourceLineNo">130</span> throw new UnsupportedOperationException(<a name="line.130"></a> +<span class="sourceLineNo">131</span> "createIRI(String) not supported");<a name="line.131"></a> +<span class="sourceLineNo">132</span> }<a name="line.132"></a> +<span class="sourceLineNo">133</span><a name="line.133"></a> +<span class="sourceLineNo">134</span> /**<a name="line.134"></a> +<span class="sourceLineNo">135</span> * Create a simple literal.<a name="line.135"></a> +<span class="sourceLineNo">136</span> *<a name="line.136"></a> +<span class="sourceLineNo">137</span> * The provided lexical form should not be escaped in any sense, e.g. should<a name="line.137"></a> +<span class="sourceLineNo">138</span> * not include "quotes" unless those are part of the literal value.<a name="line.138"></a> +<span class="sourceLineNo">139</span> *<a name="line.139"></a> +<span class="sourceLineNo">140</span> * The returned Literal MUST have a {@link Literal#getLexicalForm()} that is<a name="line.140"></a> +<span class="sourceLineNo">141</span> * equal to the provided lexical form, MUST NOT have a<a name="line.141"></a> +<span class="sourceLineNo">142</span> * {@link Literal#getLanguageTag()} present, and SHOULD return a<a name="line.142"></a> +<span class="sourceLineNo">143</span> * {@link Literal#getDatatype()} that is equal to the IRI<a name="line.143"></a> +<span class="sourceLineNo">144</span> * <code>http://www.w3.org/2001/XMLSchema#string</code>.<a name="line.144"></a> +<span class="sourceLineNo">145</span> *<a name="line.145"></a> +<span class="sourceLineNo">146</span> * @param lexicalForm The literal value in plain text<a name="line.146"></a> +<span class="sourceLineNo">147</span> * @return The created Literal<a name="line.147"></a> +<span class="sourceLineNo">148</span> * @throws IllegalArgumentException If the provided lexicalForm is not acceptable, e.g. because<a name="line.148"></a> +<span class="sourceLineNo">149</span> * it is too large for an underlying storage.<a name="line.149"></a> +<span class="sourceLineNo">150</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.150"></a> +<span class="sourceLineNo">151</span> */<a name="line.151"></a> +<span class="sourceLineNo">152</span> default Literal createLiteral(String lexicalForm)<a name="line.152"></a> +<span class="sourceLineNo">153</span> throws IllegalArgumentException, UnsupportedOperationException {<a name="line.153"></a> +<span class="sourceLineNo">154</span> throw new UnsupportedOperationException(<a name="line.154"></a> +<span class="sourceLineNo">155</span> "createLiteral(String) not supported");<a name="line.155"></a> +<span class="sourceLineNo">156</span> }<a name="line.156"></a> +<span class="sourceLineNo">157</span><a name="line.157"></a> +<span class="sourceLineNo">158</span> /**<a name="line.158"></a> +<span class="sourceLineNo">159</span> * Create a literal with the specified data type.<a name="line.159"></a> +<span class="sourceLineNo">160</span> *<a name="line.160"></a> +<span class="sourceLineNo">161</span> * The provided lexical form should not be escaped in any sense, e.g. should<a name="line.161"></a> +<span class="sourceLineNo">162</span> * not include "quotes" unless those are part of the literal value.<a name="line.162"></a> +<span class="sourceLineNo">163</span> *<a name="line.163"></a> +<span class="sourceLineNo">164</span> * It is RECOMMENDED that the provided dataType is one of the <a<a name="line.164"></a> +<span class="sourceLineNo">165</span> * href="http://www.w3.org/TR/rdf11-concepts/#xsd-datatypes">RDF-compatible<a name="line.165"></a> +<span class="sourceLineNo">166</span> * XSD types</a>.<a name="line.166"></a> +<span class="sourceLineNo">167</span> *<a name="line.167"></a> +<span class="sourceLineNo">168</span> * The provided lexical form SHOULD be in the <a<a name="line.168"></a> +<span class="sourceLineNo">169</span> * href="http://www.w3.org/TR/rdf11-concepts/#dfn-lexical-space">lexical<a name="line.169"></a> +<span class="sourceLineNo">170</span> * space</a> of the provided dataType.<a name="line.170"></a> +<span class="sourceLineNo">171</span> *<a name="line.171"></a> +<span class="sourceLineNo">172</span> * The returned Literal SHOULD have a {@link Literal#getLexicalForm()} that<a name="line.172"></a> +<span class="sourceLineNo">173</span> * is equal to the provided lexicalForm, MUST NOT have a<a name="line.173"></a> +<span class="sourceLineNo">174</span> * {@link Literal#getLanguageTag()} present, and MUST return a<a name="line.174"></a> +<span class="sourceLineNo">175</span> * {@link Literal#getDatatype()} that is equivalent to the provided dataType<a name="line.175"></a> +<span class="sourceLineNo">176</span> * IRI.<a name="line.176"></a> +<span class="sourceLineNo">177</span> *<a name="line.177"></a> +<span class="sourceLineNo">178</span> * @param lexicalForm The literal value<a name="line.178"></a> +<span class="sourceLineNo">179</span> * @param dataType The data type IRI for the literal value, e.g.<a name="line.179"></a> +<span class="sourceLineNo">180</span> * <code>http://www.w3.org/2001/XMLSchema#integer</code><a name="line.180"></a> +<span class="sourceLineNo">181</span> * @return The created Literal<a name="line.181"></a> +<span class="sourceLineNo">182</span> * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g.<a name="line.182"></a> +<span class="sourceLineNo">183</span> * because the provided dataType is not permitted.<a name="line.183"></a> +<span class="sourceLineNo">184</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.184"></a> +<span class="sourceLineNo">185</span> */<a name="line.185"></a> +<span class="sourceLineNo">186</span> default Literal createLiteral(String lexicalForm, IRI dataType)<a name="line.186"></a> +<span class="sourceLineNo">187</span> throws IllegalArgumentException, UnsupportedOperationException {<a name="line.187"></a> +<span class="sourceLineNo">188</span> throw new UnsupportedOperationException(<a name="line.188"></a> +<span class="sourceLineNo">189</span> "createLiteral(String) not supported");<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> * Create a language-tagged literal.<a name="line.193"></a> +<span class="sourceLineNo">194</span> *<a name="line.194"></a> +<span class="sourceLineNo">195</span> * The provided lexical form should not be escaped in any sense, e.g. should<a name="line.195"></a> +<span class="sourceLineNo">196</span> * not include "quotes" unless those are part of the literal value.<a name="line.196"></a> +<span class="sourceLineNo">197</span> *<a name="line.197"></a> +<span class="sourceLineNo">198</span> * The provided language tag MUST be valid according to <a<a name="line.198"></a> +<span class="sourceLineNo">199</span> * href="http://tools.ietf.org/html/bcp47">BCP47</a>, e.g. <code>en</code>.<a name="line.199"></a> +<span class="sourceLineNo">200</span> *<a name="line.200"></a> +<span class="sourceLineNo">201</span> * The provided language tag <a<a name="line.201"></a> +<span class="sourceLineNo">202</span> * href="http://www.w3.org/TR/rdf11-concepts/#dfn-language-tagged-string"<a name="line.202"></a> +<span class="sourceLineNo">203</span> * >MAY be converted to lower case</a>.<a name="line.203"></a> +<span class="sourceLineNo">204</span> *<a name="line.204"></a> +<span class="sourceLineNo">205</span> * The returned Literal SHOULD have a {@link Literal#getLexicalForm()} which<a name="line.205"></a> +<span class="sourceLineNo">206</span> * is equal to the provided lexicalForm, MUST return a<a name="line.206"></a> +<span class="sourceLineNo">207</span> * {@link Literal#getDatatype()} that is equal to the IRI<a name="line.207"></a> +<span class="sourceLineNo">208</span> * <code>http://www.w3.org/1999/02/22-rdf-syntax-ns#langString</code>, and<a name="line.208"></a> +<span class="sourceLineNo">209</span> * MUST have a {@link Literal#getLanguageTag()} present which SHOULD be<a name="line.209"></a> +<span class="sourceLineNo">210</span> * equal to the provided language tag (compared as<a name="line.210"></a> +<span class="sourceLineNo">211</span> * {@link String#toLowerCase(Locale)} using {@link Locale#ENGLISH}).<a name="line.211"></a> +<span class="sourceLineNo">212</span> *<a name="line.212"></a> +<span class="sourceLineNo">213</span> * @param lexicalForm The literal value<a name="line.213"></a> +<span class="sourceLineNo">214</span> * @param languageTag The non-empty language tag as defined by <a<a name="line.214"></a> +<span class="sourceLineNo">215</span> * href="http://tools.ietf.org/html/bcp47">BCP47</a><a name="line.215"></a> +<span class="sourceLineNo">216</span> * @return The created Literal<a name="line.216"></a> +<span class="sourceLineNo">217</span> * @throws IllegalArgumentException If the provided values are not acceptable, e.g. because the<a name="line.217"></a> +<span class="sourceLineNo">218</span> * languageTag was syntactically invalid.<a name="line.218"></a> +<span class="sourceLineNo">219</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.219"></a> +<span class="sourceLineNo">220</span> */<a name="line.220"></a> +<span class="sourceLineNo">221</span> default Literal createLiteral(String lexicalForm, String languageTag)<a name="line.221"></a> +<span class="sourceLineNo">222</span> throws IllegalArgumentException, UnsupportedOperationException {<a name="line.222"></a> +<span class="sourceLineNo">223</span> throw new UnsupportedOperationException(<a name="line.223"></a> +<span class="sourceLineNo">224</span> "createLiteral(String,String) not supported");<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> /**<a name="line.227"></a> +<span class="sourceLineNo">228</span> * Create a triple.<a name="line.228"></a> +<span class="sourceLineNo">229</span> *<a name="line.229"></a> +<span class="sourceLineNo">230</span> * The returned Triple SHOULD have a {@link Triple#getSubject()} that is<a name="line.230"></a> +<span class="sourceLineNo">231</span> * equal to the provided subject, a {@link Triple#getPredicate()} that is<a name="line.231"></a> +<span class="sourceLineNo">232</span> * equal to the provided predicate, and a {@link Triple#getObject()} that is<a name="line.232"></a> +<span class="sourceLineNo">233</span> * equal to the provided object.<a name="line.233"></a> +<span class="sourceLineNo">234</span> *<a name="line.234"></a> +<span class="sourceLineNo">235</span> * @param subject The IRI or BlankNode that is the subject of the triple<a name="line.235"></a> +<span class="sourceLineNo">236</span> * @param predicate The IRI that is the predicate of the triple<a name="line.236"></a> +<span class="sourceLineNo">237</span> * @param object The IRI, BlankNode or Literal that is the object of the triple<a name="line.237"></a> +<span class="sourceLineNo">238</span> * @return The created Triple<a name="line.238"></a> +<span class="sourceLineNo">239</span> * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g.<a name="line.239"></a> +<span class="sourceLineNo">240</span> * because a Literal has a lexicalForm that is too large for an<a name="line.240"></a> +<span class="sourceLineNo">241</span> * underlying storage.<a name="line.241"></a> +<span class="sourceLineNo">242</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.242"></a> +<span class="sourceLineNo">243</span> */<a name="line.243"></a> +<span class="sourceLineNo">244</span> default Triple createTriple(BlankNodeOrIRI subject, IRI predicate,<a name="line.244"></a> +<span class="sourceLineNo">245</span> RDFTerm object) throws IllegalArgumentException,<a name="line.245"></a> +<span class="sourceLineNo">246</span> UnsupportedOperationException {<a name="line.246"></a> +<span class="sourceLineNo">247</span> throw new UnsupportedOperationException(<a name="line.247"></a> +<span class="sourceLineNo">248</span> "createTriple(BlankNodeOrIRI,IRI,RDFTerm) not supported");<a name="line.248"></a> +<span class="sourceLineNo">249</span> }<a name="line.249"></a> +<span class="sourceLineNo">250</span><a name="line.250"></a> +<span class="sourceLineNo">251</span> /**<a name="line.251"></a> +<span class="sourceLineNo">252</span> * Create a quad.<a name="line.252"></a> +<span class="sourceLineNo">253</span> * <p><a name="line.253"></a> +<span class="sourceLineNo">254</span> * The returned Quad SHOULD have a<a name="line.254"></a> +<span class="sourceLineNo">255</span> * {@link Quad#getGraphName()} that is equal to the provided graphName, a<a name="line.255"></a> +<span class="sourceLineNo">256</span> * {@link Quad#getSubject()} that is<a name="line.256"></a> +<span class="sourceLineNo">257</span> * equal to the provided subject, a {@link Quad#getPredicate()} that is<a name="line.257"></a> +<span class="sourceLineNo">258</span> * equal to the provided predicate, and a {@link Quad#getObject()} that is<a name="line.258"></a> +<span class="sourceLineNo">259</span> * equal to the provided object.<a name="line.259"></a> +<span class="sourceLineNo">260</span> *<a name="line.260"></a> +<span class="sourceLineNo">261</span> * @param graphName The IRI or BlankNode that this quad belongs to, or <code>null</code> for the default graph<a name="line.261"></a> +<span class="sourceLineNo">262</span> * @param subject The IRI or BlankNode that is the subject of the quad<a name="line.262"></a> +<span class="sourceLineNo">263</span> * @param predicate The IRI that is the predicate of the quad<a name="line.263"></a> +<span class="sourceLineNo">264</span> * @param object The IRI, BlankNode or Literal that is the object of the quad<a name="line.264"></a> +<span class="sourceLineNo">265</span> * @return The created Quad<a name="line.265"></a> +<span class="sourceLineNo">266</span> * @throws IllegalArgumentException If any of the provided arguments are not acceptable, e.g.<a name="line.266"></a> +<span class="sourceLineNo">267</span> * because a Literal has a lexicalForm that is too large for an<a name="line.267"></a> +<span class="sourceLineNo">268</span> * underlying storage.<a name="line.268"></a> +<span class="sourceLineNo">269</span> * @throws UnsupportedOperationException If the operation is not supported.<a name="line.269"></a> +<span class="sourceLineNo">270</span> */<a name="line.270"></a> +<span class="sourceLineNo">271</span> default Quad createQuad(BlankNodeOrIRI graphName, BlankNodeOrIRI subject, IRI predicate,<a name="line.271"></a> +<span class="sourceLineNo">272</span> RDFTerm object) throws IllegalArgumentException,<a name="line.272"></a> +<span class="sourceLineNo">273</span> UnsupportedOperationException {<a name="line.273"></a> +<span class="sourceLineNo">274</span> throw new UnsupportedOperationException(<a name="line.274"></a> +<span class="sourceLineNo">275</span> "createQuad(BlankNodeOrIRI,BlankNodeOrIRI,IRI,RDFTerm) not supported");<a name="line.275"></a> +<span class="sourceLineNo">276</span> }<a name="line.276"></a> +<span class="sourceLineNo">277</span><a name="line.277"></a> +<span class="sourceLineNo">278</span>}<a name="line.278"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/Triple.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/Triple.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/Triple.html Wed Sep 7 02:26:20 2016 @@ -0,0 +1,174 @@ +<!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.api;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>import java.util.Objects;<a name="line.20"></a> +<span class="sourceLineNo">021</span><a name="line.21"></a> +<span class="sourceLineNo">022</span>/**<a name="line.22"></a> +<span class="sourceLineNo">023</span> * An <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple" >RDF-1.1<a name="line.23"></a> +<span class="sourceLineNo">024</span> * Triple</a>, as defined by <a href= "http://www.w3.org/TR/rdf11-concepts/"<a name="line.24"></a> +<span class="sourceLineNo">025</span> * >RDF-1.1 Concepts and Abstract Syntax</a>, a W3C Recommendation published on<a name="line.25"></a> +<span class="sourceLineNo">026</span> * 25 February 2014.<br><a name="line.26"></a> +<span class="sourceLineNo">027</span> *<a name="line.27"></a> +<span class="sourceLineNo">028</span> * @see Quad <a name="line.28"></a> +<span class="sourceLineNo">029</span> * @see RDFTermFactory#createTriple(BlankNodeOrIRI,IRI,RDFTerm)<a name="line.29"></a> +<span class="sourceLineNo">030</span> * @see <a href= "http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-triple" >RDF-1.1<a name="line.30"></a> +<span class="sourceLineNo">031</span> * Triple</a><a name="line.31"></a> +<span class="sourceLineNo">032</span> */<a name="line.32"></a> +<span class="sourceLineNo">033</span>public interface Triple extends TripleLike<BlankNodeOrIRI, IRI, RDFTerm> {<a name="line.33"></a> +<span class="sourceLineNo">034</span><a name="line.34"></a> +<span class="sourceLineNo">035</span> /**<a name="line.35"></a> +<span class="sourceLineNo">036</span> * The subject of this triple, which may be either a {@link BlankNode} or an<a name="line.36"></a> +<span class="sourceLineNo">037</span> * {@link IRI}, which are represented in Commons RDF by the interface<a name="line.37"></a> +<span class="sourceLineNo">038</span> * {@link BlankNodeOrIRI}.<a name="line.38"></a> +<span class="sourceLineNo">039</span> *<a name="line.39"></a> +<span class="sourceLineNo">040</span> * @return The subject {@link BlankNodeOrIRI} of this triple.<a name="line.40"></a> +<span class="sourceLineNo">041</span> * @see <a href="http://www.w3.org/TR/rdf11-concepts/#dfn-subject">RDF-1.1<a name="line.41"></a> +<span class="sourceLineNo">042</span> * Triple subject</a><a name="line.42"></a> +<span class="sourceLineNo">043</span> */<a name="line.43"></a> +<span class="sourceLineNo">044</span> BlankNodeOrIRI getSubject();<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> * The predicate {@link IRI} of this triple.<a name="line.47"></a> +<span class="sourceLineNo">048</span> *<a name="line.48"></a> +<span class="sourceLineNo">049</span> * @return The predicate {@link IRI} of this triple.<a name="line.49"></a> +<span class="sourceLineNo">050</span> * @see <a href="http://www.w3.org/TR/rdf11-concepts/#dfn-predicate">RDF-1.1<a name="line.50"></a> +<span class="sourceLineNo">051</span> * Triple predicate</a><a name="line.51"></a> +<span class="sourceLineNo">052</span> */<a name="line.52"></a> +<span class="sourceLineNo">053</span> IRI getPredicate();<a name="line.53"></a> +<span class="sourceLineNo">054</span><a name="line.54"></a> +<span class="sourceLineNo">055</span> /**<a name="line.55"></a> +<span class="sourceLineNo">056</span> * The object of this triple, which may be either a {@link BlankNode}, an<a name="line.56"></a> +<span class="sourceLineNo">057</span> * {@link IRI}, or a {@link Literal}, which are represented in Commons RDF<a name="line.57"></a> +<span class="sourceLineNo">058</span> * by the interface {@link RDFTerm}.<a name="line.58"></a> +<span class="sourceLineNo">059</span> *<a name="line.59"></a> +<span class="sourceLineNo">060</span> * @return The object {@link RDFTerm} of this triple.<a name="line.60"></a> +<span class="sourceLineNo">061</span> * @see <a href="http://www.w3.org/TR/rdf11-concepts/#dfn-object">RDF-1.1<a name="line.61"></a> +<span class="sourceLineNo">062</span> * Triple object</a><a name="line.62"></a> +<span class="sourceLineNo">063</span> */<a name="line.63"></a> +<span class="sourceLineNo">064</span> RDFTerm getObject();<a name="line.64"></a> +<span class="sourceLineNo">065</span><a name="line.65"></a> +<span class="sourceLineNo">066</span> /**<a name="line.66"></a> +<span class="sourceLineNo">067</span> * Check it this Triple is equal to another Triple.<a name="line.67"></a> +<span class="sourceLineNo">068</span> * <p><a name="line.68"></a> +<span class="sourceLineNo">069</span> * Two Triples are equal if and only if their {@link #getSubject()},<a name="line.69"></a> +<span class="sourceLineNo">070</span> * {@link #getPredicate()} and {@link #getObject()} are equal.<a name="line.70"></a> +<span class="sourceLineNo">071</span> * </p><a name="line.71"></a> +<span class="sourceLineNo">072</span> * <p><a name="line.72"></a> +<span class="sourceLineNo">073</span> * Implementations MUST also override {@link #hashCode()} so that two equal<a name="line.73"></a> +<span class="sourceLineNo">074</span> * Triples produce the same hash code.<a name="line.74"></a> +<span class="sourceLineNo">075</span> * </p><a name="line.75"></a> +<span class="sourceLineNo">076</span> *<a name="line.76"></a> +<span class="sourceLineNo">077</span> * @param other Another object<a name="line.77"></a> +<span class="sourceLineNo">078</span> * @return true if other is a Triple and is equal to this<a name="line.78"></a> +<span class="sourceLineNo">079</span> * @see Object#equals(Object)<a name="line.79"></a> +<span class="sourceLineNo">080</span> */<a name="line.80"></a> +<span class="sourceLineNo">081</span> @Override<a name="line.81"></a> +<span class="sourceLineNo">082</span> public boolean equals(Object other);<a name="line.82"></a> +<span class="sourceLineNo">083</span><a name="line.83"></a> +<span class="sourceLineNo">084</span> /**<a name="line.84"></a> +<span class="sourceLineNo">085</span> * Calculate a hash code for this Triple.<a name="line.85"></a> +<span class="sourceLineNo">086</span> * <p><a name="line.86"></a> +<span class="sourceLineNo">087</span> * The returned hash code MUST be equal to the result<a name="line.87"></a> +<span class="sourceLineNo">088</span> * of {@link Objects#hash(Object...)} with<a name="line.88"></a> +<span class="sourceLineNo">089</span> * the arguments<a name="line.89"></a> +<span class="sourceLineNo">090</span> * {@link #getSubject()}, {@link #getPredicate()}, {@link #getObject()}.<a name="line.90"></a> +<span class="sourceLineNo">091</span> * <p><a name="line.91"></a> +<span class="sourceLineNo">092</span> * This method MUST be implemented in conjunction with {@link #equals(Object)}<a name="line.92"></a> +<span class="sourceLineNo">093</span> * so that two equal {@link Triple}s produce the same hash code.<a name="line.93"></a> +<span class="sourceLineNo">094</span> *<a name="line.94"></a> +<span class="sourceLineNo">095</span> * @return a hash code value for this Triple.<a name="line.95"></a> +<span class="sourceLineNo">096</span> * @see Object#hashCode()<a name="line.96"></a> +<span class="sourceLineNo">097</span> * @see Objects#hash(Object...)<a name="line.97"></a> +<span class="sourceLineNo">098</span> */<a name="line.98"></a> +<span class="sourceLineNo">099</span> @Override<a name="line.99"></a> +<span class="sourceLineNo">100</span> public int hashCode();<a name="line.100"></a> +<span class="sourceLineNo">101</span><a name="line.101"></a> +<span class="sourceLineNo">102</span>}<a name="line.102"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file Added: websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/TripleLike.html ============================================================================== --- websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/TripleLike.html (added) +++ websites/production/commonsrdf/content/apidocs/src-html/org/apache/commons/rdf/api/TripleLike.html Wed Sep 7 02:26:20 2016 @@ -0,0 +1,143 @@ +<!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.api;<a name="line.18"></a> +<span class="sourceLineNo">019</span><a name="line.19"></a> +<span class="sourceLineNo">020</span>/**<a name="line.20"></a> +<span class="sourceLineNo">021</span> * A generalised "triple-like" interface, extended by {@link Triple} and<a name="line.21"></a> +<span class="sourceLineNo">022</span> * {@link Quad}.<a name="line.22"></a> +<span class="sourceLineNo">023</span> * <p><a name="line.23"></a> +<span class="sourceLineNo">024</span> * A TripleLike statement has at least a {@link #getSubject()},<a name="line.24"></a> +<span class="sourceLineNo">025</span> * {@link #getPredicate()} and {@link #getObject()}, but unlike a {@link Triple}<a name="line.25"></a> +<span class="sourceLineNo">026</span> * does not have a formalised <a name="line.26"></a> +<span class="sourceLineNo">027</span> * {@link Triple#equals(Object)} or <a name="line.27"></a> +<span class="sourceLineNo">028</span> * {@link Triple#hashCode()} semantics. This interfaced can also be <a name="line.28"></a> +<span class="sourceLineNo">029</span> * used for <em>generalised triples</em> (e.g. a {@link BlankNode} as predicate).<a name="line.29"></a> +<span class="sourceLineNo">030</span> * <p><a name="line.30"></a> +<span class="sourceLineNo">031</span> * Implementations should specialise which specific {@link RDFTerm} types they<a name="line.31"></a> +<span class="sourceLineNo">032</span> * return for {@link #getSubject()}, {@link #getPredicate()} and<a name="line.32"></a> +<span class="sourceLineNo">033</span> * {@link #getObject()}.<a name="line.33"></a> +<span class="sourceLineNo">034</span> * <a name="line.34"></a> +<span class="sourceLineNo">035</span> * @param <S><a name="line.35"></a> +<span class="sourceLineNo">036</span> * The type of subjects in the statements, typically<a name="line.36"></a> +<span class="sourceLineNo">037</span> * {@link BlankNodeOrIRI}<a name="line.37"></a> +<span class="sourceLineNo">038</span> * @param <P><a name="line.38"></a> +<span class="sourceLineNo">039</span> * The type of predicates in the statements, typically {@link IRI}<a name="line.39"></a> +<span class="sourceLineNo">040</span> * @param <O><a name="line.40"></a> +<span class="sourceLineNo">041</span> * The type of objects in the statements, typically {@link RDFTerm}<a name="line.41"></a> +<span class="sourceLineNo">042</span> * <a name="line.42"></a> +<span class="sourceLineNo">043</span> * @since 0.3.0-incubating<a name="line.43"></a> +<span class="sourceLineNo">044</span> * @see Triple<a name="line.44"></a> +<span class="sourceLineNo">045</span> * @see Quad<a name="line.45"></a> +<span class="sourceLineNo">046</span> * @see QuadLike<a name="line.46"></a> +<span class="sourceLineNo">047</span> */<a name="line.47"></a> +<span class="sourceLineNo">048</span>public interface TripleLike<S extends RDFTerm, P extends RDFTerm, O extends RDFTerm> {<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> * The subject of this statement.<a name="line.51"></a> +<span class="sourceLineNo">052</span> *<a name="line.52"></a> +<span class="sourceLineNo">053</span> * @return The subject, typically an {@link IRI} or {@link BlankNode}.<a name="line.53"></a> +<span class="sourceLineNo">054</span> */<a name="line.54"></a> +<span class="sourceLineNo">055</span> S getSubject();<a name="line.55"></a> +<span class="sourceLineNo">056</span><a name="line.56"></a> +<span class="sourceLineNo">057</span> /**<a name="line.57"></a> +<span class="sourceLineNo">058</span> * The predicate of this statement.<a name="line.58"></a> +<span class="sourceLineNo">059</span> *<a name="line.59"></a> +<span class="sourceLineNo">060</span> * @return The predicate, typically an {@link IRI}.<a name="line.60"></a> +<span class="sourceLineNo">061</span> */<a name="line.61"></a> +<span class="sourceLineNo">062</span> P getPredicate();<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> * The object of this statement.<a name="line.65"></a> +<span class="sourceLineNo">066</span> *<a name="line.66"></a> +<span class="sourceLineNo">067</span> * @return The object, typically an {@link IRI}, {@link BlankNode} or<a name="line.67"></a> +<span class="sourceLineNo">068</span> * {@link Literal}.<a name="line.68"></a> +<span class="sourceLineNo">069</span> */<a name="line.69"></a> +<span class="sourceLineNo">070</span> O getObject();<a name="line.70"></a> +<span class="sourceLineNo">071</span>}<a name="line.71"></a> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +</pre> +</div> +</body> +</html> \ No newline at end of file