Mixing Linked Data and Text?

There are no existing standards that I am aware of for RDF in Markdown, but plenty of possible solutions, including Cristian’s

RDFa works by annotating links and containing elements. It can therefore be implemented in different ways in different markdown dialects.

Link attributes/link types/link flavors are probably the most basic way of handling this, in which the rendered html will include an RDFa edge from the page url to the link.

Here’s a range of syntaxes that I’ve come across

I find that the cleanest approach is using shortcut reference links with the multimarkdown syntax, so I can write:

This note refers to [alice] who is a person in my knowledge base

[alice]: http://example.com/people.ttl#Alice rel="http://example.com/ontology#mentions"

And this would generate the triple:

<> <http://example.com/ontology#mentions> <http://example.com/people.ttl#Alice>.

For this approach to be manageable I would still want editor support to autocomplete both predicates and subjects, and to create reference links.

The pandoc notation appears to have a bit more support among renderers and in principle can also be used with reference links

[alice]: http://example.com/people.ttl#Alice {rel="http://example.com/ontology#mentions"}

It also has the advantage that it can be used on other container elements, as in the examples in GitHub - javalent/markdown-attributes: Add attributes to elements in Obsidian

This then allows something like (untested):

Bob {about="http://example.com/people.ttl#Bob"}
- knows [Alice] 

[Alice]: http://example.com/people.ttl#Alice {rel="foaf:knows"}

to generate

<http://example.com/people.ttl#Bob> foaf:knows <http://example.com/people.ttl#Alice>.

Markdown is really not designed to include non-human readable content, so all these solutions are still a little awkward.

For a more complete solution, it really does make sense to use HTML editing software that allows adding RDFa and/or web annotations, e.g. https://dokie.li/

Personally, I’ve been using Semantic Mediawiki for several years but I’m still experimenting with alternative solutions https://www.semantic-mediawiki.org

Needless to say, SolidOS does not yet provide support for anything like this, though it eventually it could by switching to a different markdown renderer/enabling a plugin.

P.S. apologies if the formatting of this post still doesn’t work after multiple edits.

6 Likes