Skip to content

Commit

Permalink
Deployed 221ffc2 to dev with MkDocs 1.6.1 and mike 2.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
ci-bot committed Oct 26, 2024
1 parent 861c1ad commit cb403c9
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 41 deletions.
4 changes: 2 additions & 2 deletions dev/getting-started-devs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ <h1 id="jelly-jvm-getting-started-for-developers">Jelly-JVM – getting started
<p>This guide explains a few of the basic functionalities of Jelly-JVM and how to use them in your code. Jelly-JVM is written in Scala, but it can be used from Java as well. However, in this guide, we will focus on <strong>Scala 3</strong>.</p>
<h2 id="quick-start-plain-old-files">Quick start – plain old files</h2>
<p>Depending on your RDF library of choice (Apache Jena or RDF4J), you should import one of two dependencies: <code>jelly-jena</code> or <code>jelly-rdf4j</code><sup id="fnref:1"><a class="footnote-ref" href="#fn:1">1</a></sup>. In our examples we will use Jena, so let's add this to your <code>build.sbt</code> file (this would be the same for other build tools like Maven or Gradle):</p>
<div class="language-scala highlight"><span class="filename">build.sbt</span><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="k">lazy</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">jellyVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;2.1.0&quot;</span>
<div class="language-scala highlight"><span class="filename">build.sbt</span><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a><span class="k">lazy</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">jellyVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;2.2.0&quot;</span>
</span><span id="__span-0-2"><a id="__codelineno-0-2" name="__codelineno-0-2" href="#__codelineno-0-2"></a>
</span><span id="__span-0-3"><a id="__codelineno-0-3" name="__codelineno-0-3" href="#__codelineno-0-3"></a><span class="n">libraryDependencies</span><span class="w"> </span><span class="o">++=</span><span class="w"> </span><span class="nc">Seq</span><span class="p">(</span>
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a><span class="w"> </span><span class="s">&quot;eu.ostrzyciel.jelly&quot;</span><span class="w"> </span><span class="o">%%</span><span class="w"> </span><span class="s">&quot;jelly-jena&quot;</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="n">jellyVersion</span><span class="p">,</span>
Expand Down Expand Up @@ -922,7 +922,7 @@ <h2 id="quick-start-plain-old-files">Quick start – plain old files</h2>
<p><a href="../user/rdf4j/"><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.22 19.03a.75.75 0 0 1 0-1.06L18.19 13H3.75a.75.75 0 0 1 0-1.5h14.44l-4.97-4.97a.749.749 0 0 1 .326-1.275.75.75 0 0 1 .734.215l6.25 6.25a.75.75 0 0 1 0 1.06l-6.25 6.25a.75.75 0 0 1-1.06 0"/></svg></span> Read more about using Jelly-JVM with RDF4J</a></p>
<h2 id="rdf-streams">RDF streams</h2>
<p>Now, the real power of Jelly lies in its streaming capabilities. Not only can it stream individual RDF triples/quads (this is called <a href="https://w3id.org/stax/dev/taxonomy/#flat-rdf-stream"><em>flat streaming</em></a>), but it can also very effectively handle streams of RDF graphs or datasets. To work with streams, you need to use the <code>jelly-stream</code> module, which is based on the <a href="https://pekko.apache.org/docs/pekko/current/stream/index.html">Apache Pekko Streams</a> library. So, let's update our dependencies:</p>
<div class="language-scala highlight"><span class="filename">build.sbt</span><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="k">lazy</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">jellyVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;2.1.0&quot;</span>
<div class="language-scala highlight"><span class="filename">build.sbt</span><pre><span></span><code><span id="__span-3-1"><a id="__codelineno-3-1" name="__codelineno-3-1" href="#__codelineno-3-1"></a><span class="k">lazy</span><span class="w"> </span><span class="kd">val</span><span class="w"> </span><span class="n">jellyVersion</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="s">&quot;2.2.0&quot;</span>
</span><span id="__span-3-2"><a id="__codelineno-3-2" name="__codelineno-3-2" href="#__codelineno-3-2"></a>
</span><span id="__span-3-3"><a id="__codelineno-3-3" name="__codelineno-3-3" href="#__codelineno-3-3"></a><span class="n">libraryDependencies</span><span class="w"> </span><span class="o">++=</span><span class="w"> </span><span class="nc">Seq</span><span class="p">(</span>
</span><span id="__span-3-4"><a id="__codelineno-3-4" name="__codelineno-3-4" href="#__codelineno-3-4"></a><span class="w"> </span><span class="s">&quot;eu.ostrzyciel.jelly&quot;</span><span class="w"> </span><span class="o">%%</span><span class="w"> </span><span class="s">&quot;jelly-jena&quot;</span><span class="w"> </span><span class="o">%</span><span class="w"> </span><span class="n">jellyVersion</span><span class="p">,</span>
Expand Down
2 changes: 1 addition & 1 deletion dev/search/search_index.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dev/user/jena/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,8 @@ <h1>Apache Jena integration</h1>
<p>This guide explains the functionalities of the <code>jelly-jena</code> module, which provides Jelly support for <a href="https://jena.apache.org/">Apache Jena</a>.</p>
<p>If you just want to add Jelly format support to Apache Jena / Apache Jena Fuseki, you can use the Jelly-JVM plugin JAR. See the <strong><a href="../../getting-started-plugins/#apache-jena-apache-jena-fuseki">dedicated guide</a></strong> for more information.</p>
<h2 id="base-facilities">Base facilities</h2>
<p><code>jelly-jena</code> implements the <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.1.0/eu/ostrzyciel/jelly/core/ConverterFactory.html"><code>eu.ostrzyciel.jelly.core.ConverterFactory</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> trait in <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-jena_3/2.1.0/eu/ostrzyciel/jelly/convert/jena/JenaConverterFactory$.html"><code>eu.ostrzyciel.jelly.convert.jena.JenaConverterFactory</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a>. This factory allows you to build encoders and decoders that convert between Jelly's <code>RdfStreamFrame</code>s and Apache Jena's <code>Triple</code> and <code>Quad</code> objects. The <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.1.0/eu/ostrzyciel/jelly/core/proto/v1/RdfStreamFrame.html"><code>eu.ostrzyciel.jelly.core.proto.v1.RdfStreamFrame</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> class is an object representation of Jelly's binary format.</p>
<p>The module also implements the <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.1.0/eu/ostrzyciel/jelly/core/IterableAdapter.html"><code>eu.ostrzyciel.jelly.core.IterableAdapter</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> trait in <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-jena_3/2.1.0/eu/ostrzyciel/jelly/convert/jena/JenaIterableAdapter$.html"><code>eu.ostrzyciel.jelly.convert.jena.JenaIterableAdapter</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a>. This adapter provides extension methods for Apache Jena's <code>Model</code>, <code>Dataset</code>, <code>Graph</code>, and <code>DatasetGraph</code> classes to convert them into an iterable of triples (<code>.asTriples</code>), quads (<code>.asQuads</code>), or named graphs (<code>.asGraphs</code>). This is useful when working with Jelly <a href="../low-level/">on a lower level</a> or when <a href="../reactive/">using the <code>jelly-stream</code> module</a>.</p>
<p><code>jelly-jena</code> implements the <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.2.0/eu/ostrzyciel/jelly/core/ConverterFactory.html"><code>eu.ostrzyciel.jelly.core.ConverterFactory</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> trait in <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-jena_3/2.2.0/eu/ostrzyciel/jelly/convert/jena/JenaConverterFactory$.html"><code>eu.ostrzyciel.jelly.convert.jena.JenaConverterFactory</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a>. This factory allows you to build encoders and decoders that convert between Jelly's <code>RdfStreamFrame</code>s and Apache Jena's <code>Triple</code> and <code>Quad</code> objects. The <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.2.0/eu/ostrzyciel/jelly/core/proto/v1/RdfStreamFrame.html"><code>eu.ostrzyciel.jelly.core.proto.v1.RdfStreamFrame</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> class is an object representation of Jelly's binary format.</p>
<p>The module also implements the <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.2.0/eu/ostrzyciel/jelly/core/IterableAdapter.html"><code>eu.ostrzyciel.jelly.core.IterableAdapter</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> trait in <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-jena_3/2.2.0/eu/ostrzyciel/jelly/convert/jena/JenaIterableAdapter$.html"><code>eu.ostrzyciel.jelly.convert.jena.JenaIterableAdapter</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a>. This adapter provides extension methods for Apache Jena's <code>Model</code>, <code>Dataset</code>, <code>Graph</code>, and <code>DatasetGraph</code> classes to convert them into an iterable of triples (<code>.asTriples</code>), quads (<code>.asQuads</code>), or named graphs (<code>.asGraphs</code>). This is useful when working with Jelly <a href="../low-level/">on a lower level</a> or when <a href="../reactive/">using the <code>jelly-stream</code> module</a>.</p>
<h2 id="serialization-and-deserialization-with-riot">Serialization and deserialization with RIOT</h2>
<p><code>jelly-jena</code> implements an RDF writer and reader for <a href="https://jena.apache.org/documentation/io/">Apache Jena's RIOT library</a>. This means you can use Jelly just like, for example, Turtle or RDF/XML. See the example below:</p>
<details class="example">
Expand Down Expand Up @@ -1086,10 +1086,10 @@ <h2 id="serialization-and-deserialization-with-riot">Serialization and deseriali
</details>
<p>Usage notes:</p>
<ul>
<li><a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.1.0/eu/ostrzyciel/jelly/core/JellyOptions$.html"><code>eu.ostrzyciel.jelly.core.JellyOptions</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> provides a few common presets for Jelly serialization options construct a <code>JellyFormatVariant</code>, as shown in the example above. You can also further customize the serialization options (e.g., dictionary size).</li>
<li><a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-core_3/2.2.0/eu/ostrzyciel/jelly/core/JellyOptions$.html"><code>eu.ostrzyciel.jelly.core.JellyOptions</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> provides a few common presets for Jelly serialization options construct a <code>JellyFormatVariant</code>, as shown in the example above. You can also further customize the serialization options (e.g., dictionary size).</li>
<li>The RIOT writer (serializer) integration implements only the <a href="https://w3id.org/jelly/dev/user-guide#delimited-vs-non-delimited-jelly">delimited variant of Jelly</a>. It is used for writing Jelly to files on disk or sockets. Because of this, you cannot use RIOT to write non-delimited Jelly data (e.g., a single message to a Kafka stream). For this, you should use the <code>jelly-stream</code> module or the more low-level API: <a href="../low-level/">Low-level usage</a>.</li>
<li>However, the RIOT parser (deserializer) integration will automatically detect if the parsed Jelly data is delimited or not. If it's non-delimited, the parser will assume that there is only one <code>RdfStreamFrame</code> in the file.</li>
<li>Jelly's parsers and writers are registered in the <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-jena_3/2.1.0/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage$.html"><code>eu.ostrzyciel.jelly.convert.jena.riot.JellyLanguage</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> object (<a href="https://github.com/Jelly-RDF/jelly-jvm/blob/main/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage.scala">source code</a>). This registration should happen automatically when you include the <code>jelly-jena</code> module in your project, using Jena's <a href="https://jena.apache.org/documentation/notes/system-initialization.html">component initialization mechanism</a>.</li>
<li>Jelly's parsers and writers are registered in the <a href="https://javadoc.io/static/eu.ostrzyciel.jelly/jelly-jena_3/2.2.0/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage$.html"><code>eu.ostrzyciel.jelly.convert.jena.riot.JellyLanguage</code> <span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 7H5a2 2 0 0 0-2 2v8h2v-4h2v4h2V9a2 2 0 0 0-2-2m0 4H5V9h2m7-2h-4v10h2v-4h2a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2m0 4h-2V9h2m6 0v6h1v2h-4v-2h1V9h-1V7h4v2Z"/></svg></span></a> object (<a href="https://github.com/Jelly-RDF/jelly-jvm/blob/main/jena/src/main/scala/eu/ostrzyciel/jelly/convert/jena/riot/JellyLanguage.scala">source code</a>). This registration should happen automatically when you include the <code>jelly-jena</code> module in your project, using Jena's <a href="https://jena.apache.org/documentation/notes/system-initialization.html">component initialization mechanism</a>.</li>
</ul>
<h2 id="streaming-serialization-with-riot">Streaming serialization with RIOT</h2>
<p><code>jelly-jena</code> also implements a streaming writer (<a href="https://jena.apache.org/documentation/io/streaming-io.html"><code>StreamRDF</code> API in Jena</a>). Using it is similar to the regular RIOT writer, with a slightly different setup:</p>
Expand Down
Loading

0 comments on commit cb403c9

Please sign in to comment.