Skip to content

Markdown YAML-LD Frontmatter

Author: Michael Vorburger.ch
Status: In public review, feedback welcome!

Abstract

We propose that RDF loaders, in addition to processing formats such as *.ttl Turtle 🐢 etc. also load *.md Markdown files, and simply consider any YAML in their Frontmatter as YAML-LD.

Description

For example:

---
"@context": https://enola.dev/spec.jsonld
$id: https://example.org/spec1
$type: enola:Spec

author: https://www.vorburger.ch
status: Review
---

# Heading...

becomes the following RDF, if written as TTL:

@prefix enola:   <https://enola.dev/>.
@prefix schema:  <https://schema.org/>.
@prefix example: <https://example.org/>.

example:spec1 a enola:Spec;
  schema:author <https://www.vorburger.ch>;
  <https://enola.dev/Spec/status> enola:Review.

If there is no explicit "@id" in the YAML of the MD, then the RDF IRI of the Thing is the MD resource URL.

Fallback

One could write separate thing.md for documentation and thing.yamlld for RDF, but it seems nice to be able to keep this together in 1 single file.

Implementations

Enola.dev’s Loader is likely going to implement this.

References

While a number of tools support YAML front matter, we are not aware of any directly supporting RDF.