<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Turtle on MoskitoHero</title><link>https://moskitohero.com/tags/turtle/</link><description>Recent content in Turtle on MoskitoHero</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 19 May 2025 00:00:00 +0000</lastBuildDate><atom:link href="https://moskitohero.com/tags/turtle/index.xml" rel="self" type="application/rss+xml"/><item><title>Zed Turtle Extension</title><link>https://moskitohero.com/post/2025-05-19-zed-turtle-extension/</link><pubDate>Mon, 19 May 2025 00:00:00 +0000</pubDate><guid>https://moskitohero.com/post/2025-05-19-zed-turtle-extension/</guid><description>I have just released the first version of a Zed extension for the Turtle format.</description><content:encoded><![CDATA[<div class="paragraph">
<p>I have just released the first version of <a href="https://github.com/MoskitoHero/zed-turtle">a Zed extension for the Turtle format</a>.</p>
</div>
<div class="sect1">
<h2 id="zed"><a class="anchor" href="#zed"></a>Zed?</h2>
<div class="sectionbody">
<div class="paragraph">
<p><a href="https://zed.dev">Zed</a> is a very cool text editor / IDE by the creators of Atom and Tree-Sitter. It is written in Rust and it caught my interest because it is very very lean, it has Vim, JetBrains, VSCode, Helix and Emacs keybindings and a growing extension system. It has multiple advantages (at least in my opinion) over the competition, and I feel it builds upon other IDEs’ strengths while being very pleasant to use. It has pair-programming and remote development baked-in from day one.
Most importantly, it is not owned by a multi-billionnaire-led, fascist-supporting company that will eventually sunset or paywall the product once the whole world is addicted to it. And yes, it features AI, MCP and agentic editing if that’s your thing, but that’s something you can turn off, which I did.
Zed is currently driving me away from Emacs (and that means <em>something</em> if you ask me). You really should give it a try. <a href="https://zed.dev/download">Stop reading and download it</a>.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="turtle"><a class="anchor" href="#turtle"></a>Turtle?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>That’s the RDF file format I use extensively at work. It renders RDF graph triplets in a readable format, making it easier to manage than plain RDF/XML or JSON-LD other semantic web file formats.
This is an sample Turtle file:</p>
</div>
<div class="listingblock">
<div class="content">
<pre class="rouge highlight"><code data-lang="turtle"><span class="kd">@prefix</span><span class="w"> </span><span class="nn">rdf:</span><span class="w"> </span><span class="nl">&lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt;</span><span class="w"> </span><span class="p">.</span><span class="w">
</span><span class="kd">@prefix</span><span class="w"> </span><span class="nn">dc:</span><span class="w"> </span><span class="nl">&lt;http://purl.org/dc/elements/1.1/&gt;</span><span class="w"> </span><span class="p">.</span><span class="w">
</span><span class="kd">@prefix</span><span class="w"> </span><span class="nn">ex:</span><span class="w"> </span><span class="nl">&lt;http://example.org/stuff/1.0/&gt;</span><span class="w"> </span><span class="p">.</span><span class="w">

</span><span class="s">&#39;&#39;</span><span class="n">&#39;

</span><span class="nl">&lt;http://www.w3.org/TR/rdf-syntax-grammar&gt;</span><span class="w">
  </span><span class="nn">dc:</span><span class="n">title</span><span class="w"> </span><span class="s">&#34;RDF/XML Syntax Specification (Revised)&#34;</span><span class="w"> </span><span class="p">;</span><span class="w">
  </span><span class="nn">ex:</span><span class="n">editor</span><span class="w"> </span><span class="p">[</span><span class="w">
    </span><span class="nn">ex:</span><span class="n">fullname</span><span class="w"> </span><span class="s">&#34;Dave Beckett&#34;</span><span class="p">;</span><span class="w">
    </span><span class="nn">ex:</span><span class="n">homePage</span><span class="w"> </span><span class="nl">&lt;http://purl.org/net/dajobe/&gt;</span><span class="w">
  </span><span class="p">]</span><span class="w"> </span><span class="p">.</span></code></pre>
</div>
</div>
</div>
</div>
<div class="sect1">
<h2 id="extension"><a class="anchor" href="#extension"></a>Extension?</h2>
<div class="sectionbody">
<div class="paragraph">
<p>So why a RDF extension?
As I was editing .ttl files for work in Zed, I started looking for an extension to highlight my code and navigate through it, but didn’t find one. So I decided to create my own!
I looked at the Zed developer documentation, took a little inspiration from existing extensions and started writing my very first Rust lines of code — which was another motivation for starting that endeavor.
All I had to do is gather resources scattered here and there on the internet:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>A <a href="https://github.com/GordianDziwis/tree-sitter-turtle">ready-made tree-sitter project</a> for Turtle</p>
</li>
<li>
<p>A language server available <a href="https://github.com/stardog-union/stardog-language-servers">here</a></p>
</li>
</ul>
</div>
<div class="paragraph">
<p>…​and write a few lines of code to turn those into usable Zed features.</p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="the-features"><a class="anchor" href="#the-features"></a>The features</h2>
<div class="sectionbody">
<div class="paragraph">
<p>Here is what the extension does for now:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Code highlighting</p>
</li>
<li>
<p>Symbol navigation</p>
</li>
<li>
<p>LSP — the server is automatically downloaded when you edit your first Turtle document.</p>
</li>
</ul>
</div>
<div class="paragraph">
<p>What I plan on adding in a near future is:</p>
</div>
<div class="ulist">
<ul>
<li>
<p>Formatting</p>
</li>
<li>
<p>SHACL validation</p>
</li>
<li>
<p>A better LSP with go to definition / implementation (and maybe formatting as part of the LSP)</p>
</li>
</ul>
</div>
<div class="paragraph">
<p><span class="image"><img src="/assets/img/zed-turtle.png" alt="The Zed Turtle extension featuring the symbol navigation"/></span>
<em>The Zed Turtle extension featuring the symbol navigation</em></p>
</div>
</div>
</div>
<div class="sect1">
<h2 id="what-you-can-do"><a class="anchor" href="#what-you-can-do"></a>What you can do</h2>
<div class="sectionbody">
<div class="paragraph">
<p>I hope the plugin serves both the Zed and the Semantic Web communities.
If you are interested in this extension, do not hesitate to <a href="https://zed.dev/extensions?query=turtle">give it a try</a>, <a href="https://github.com/MoskitoHero/zed-turtle/issues">report issues or add feature requests</a>, or even <a href="https://github.com/MoskitoHero/zed-turtle/pulls">give me a hand</a> to improve it!</p>
</div>
</div>
</div>
]]></content:encoded></item></channel></rss>