<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sparna Blog &#187; markdown</title>
	<atom:link href="https://blog.sparna.fr/tag/markdown/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sparna.fr</link>
	<description>Web de données &#124; Architecture de l&#039;information &#124; Accès aux connaissances</description>
	<lastBuildDate>Tue, 03 Jun 2025 10:30:27 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>Semantic Markdown Specifications</title>
		<link>https://blog.sparna.fr/2020/02/20/semantic-markdown/</link>
		<comments>https://blog.sparna.fr/2020/02/20/semantic-markdown/#comments</comments>
		<pubDate>Thu, 20 Feb 2020 14:46:34 +0000</pubDate>
		<dc:creator><![CDATA[Thomas Francart]]></dc:creator>
				<category><![CDATA[RDF]]></category>
		<category><![CDATA[Schema.org]]></category>
		<category><![CDATA[json-ld]]></category>
		<category><![CDATA[markdown]]></category>
		<category><![CDATA[rdfa]]></category>
		<category><![CDATA[schema.org]]></category>

		<guid isPermaLink="false">http://blog.sparna.fr/?p=1267</guid>
		<description><![CDATA[<p>Markdown (MD) has become the de facto standard syntax for writing on the web, pushed by Github and StackOverflow. It is heavily used everytime one need to enter a comment, or write a simple (document-style) HTML page. What if we could embed semantic annotations in a markdown document ? We would get Semantic Markdown !&#8230;</p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2020/02/20/semantic-markdown/">Semantic Markdown Specifications</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Markdown (MD) has become the de facto standard syntax for writing on the web, pushed by <a href="http://github.com">Github</a> and <a href="http://stackoverflow.com">StackOverflow</a>. It is heavily used everytime one need to enter a comment, or write a simple (document-style) HTML page. What if we could embed semantic annotations in a markdown document ? We would get <strong>Semantic Markdown</strong> ! imagine the best of both worlds between <em>human readable/writable documents and machine-readable/writable (RDF) structured data</em>. We could feed an RDF knowledge graph that is coupled with our set of MD documents, and we would have an <em>easy way to put structure in content</em>.</p>
<p>I see a lot of potential in this, and already see some use-cases. Unfortunately I don&rsquo;t have the bandwith, nor the full skills to make this happens. So I am just writing this in the hope that the idea is implemented by someone, or that someone tells me it is totally nonsense&#8230;</p>
<p>Here are the semantic annotations use-cases I see with such a Semantic Markdown :</p>
<ol>
<li>Annotate a span or title that corresponds to an entity ;</li>
<li>Annotate a piece of text with an existing URI for an entity;</li>
<li>Create some statements on an entity;</li>
</ol>
<p>Note that I am not necessarily looking for a way to produce RDFa annotations on the generated HTML, although that would be nice for a schema.org use-case. Any conversion route from the original semantically annotated markdown to a set of triples would be fine.</p>
<p>My source of inspiration is essentially <a href="https://kramdown.gettalong.org/syntax.html#span-ials">Span Inline Attribute Lists&nbsp;&raquo; from the Kramdown syntax</a>.</p>
<h2>Annotate a span that corresponds to an entity</h2>
<p>This piece of Semantic Markdown :</p>
<pre>Tomorrow I am travelling to _Berlin_ {.schema:Place}</pre>
<p>When interprered by a Semantic Markdown parser would produce this set of triples :</p>
<pre>_:1 a &lt;http://schema.org/Place&gt; .
_:1 rdfs:label “Berlin” .</pre>
<p>The span immediately preceding the &laquo;&nbsp;{.xxxx}&nbsp;&raquo; annotation is taken as the label of the entity. The use of rdfs:label to store the label of the entity could be subject to a parser configuration option.</p>
<p>One could imagine that a semantic markdown parser relies on the same <a href="https://www.w3.org/2011/rdfa-context/rdfa-1.1">RDFa Initial Context</a> to interpret the &laquo;&nbsp;schema:&nbsp;&raquo; prefix without further declaration. But what about other ontologies ? we would need some kind of prefixes / vocab declaration somewhere in the document, just like in RDFa.</p>
<p>Note also that Markdown parser supporting the &laquo;&nbsp;{.xxxxx}&nbsp;&raquo; syntax will also insert this value as a CSS class on the corresponding span, so we win both on the CSS level and the semantic level.</p>
<h2>Annotate a title</h2>
<p>Similarly, we could annotate a title</p>
<pre>### European Semantic Web Conference {.schema:Event}
Lorem ipsum...</pre>
<p>In that case, the full content of the title is interpreted as the label of the entity :</p>
<pre>_:1 a &lt;http://schema.org/Event&gt; .
_:1 rdfs:label “European Semantic Web Conference” .</pre>
<h2>Annotate with a known URI</h2>
<pre>Tomorrow I am travelling to [Berlin](https://www.wikidata.org/wiki/Q64) {.schema:Place}</pre>
<p>Would yield</p>
<pre>&lt;https://www.wikidata.org/wiki/Q64&gt; a &lt;http://schema.org/Place&gt; .
&lt;https://www.wikidata.org/wiki/Q64&gt; rdfs:label “Berlin” .</pre>
<h2>Describe an entity</h2>
<p>If a list follows an annotated entity, then it should be interpreted as a set of predicates with this entity as subject :</p>
<pre>### Specifications Meeting {.schema:Event}

* Date : _11/10_{.schema:startDate}
* Place {.schema:location} : Our office, Street name, 75014 Paris
* Meeting participants : 
  {.schema:attendee}
  * Thomas Francart{.schema:Person}
  * [Someone else](https://www.wikidata.org/wiki/Q80)
  * Tim Foo
* Description : Some information not annotated

### titre suivant
Lorem ipsum...
</pre>
<p>Should yield :</p>
<pre>_:1 a &lt;http://schema.org/Event&gt; .
_:1 rdfs:label “Specifications Meeting” .
_:1 &lt;http://schema.org/startDate&gt; "11/10" .
_:1 &lt;http://schema.org/location&gt; "Our office, Street name, 75014 Paris" .
_:1 &lt;http://schema.org/attendee&gt; _:2 , &lt;https://www.wikidata.org/wiki/Q80&gt;, _:3 .

# attendee that is annotated : we know a type and a name
_:2 a &lt;http://schema.org/Person&gt;
_:2 rdfs:label “Thomas Francart” .

# attendee that is annotated with a URI : we keep the URI and add a label to it (?)
&lt;https://www.wikidata.org/wiki/Q80&gt; rdfs:label "Someone else" .

# attendee that is not annotated - but we know he was an attendee
_:3 rdfs:label "Tim Foo" .
</pre>
<ol>
<li>If a list follows a title or a paragraph that contains an annotated entity&#8230;</li>
<li>Then items in this list correspond to a property of this entity&#8230;</li>
<li>And can be annotated with a property</li>
<li>The property annotation can be placed on an inline text, or right before or after a `:` or `=` character</li>
<li>If the property annotation immediatly precedes a list, then all items in this list would be considered values for that property, and in that case could be either : entities annotated with a type, or entities identified by a URI, or entites not annotated (and in that case we would consider them as blank nodes with only a label</li>
</ol>
<h2>Related works</h2>
<p><a href="https://blogs.pjjk.net/phil/metadata-for-markdown-mkdocs/">Metadata for Markdown</a>, a Python extension to generated JSON-LD from YAML section in a Markdown document.</p>
<p><strong>EDIT</strong> : PanDoc divs and spans : <a href="https://pandoc.org/MANUAL.html#divs-and-spans">https://pandoc.org/MANUAL.html#divs-and-spans</a></p>
<p>I like the &lt;span&gt; syntax :</p>
<p><code>[This is *some text*]{.class key="val"}</code></p>
<p>This is close ! but still would not produce triples, unless one writes explicitely RDFa :</p>
<p><code>My name is [Thomas Francart]{typeof="schema:Person"}</code></p>
<p>Cet article <a rel="nofollow" href="https://blog.sparna.fr/2020/02/20/semantic-markdown/">Semantic Markdown Specifications</a> est apparu en premier sur <a rel="nofollow" href="https://blog.sparna.fr">Sparna Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sparna.fr/2020/02/20/semantic-markdown/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>
