Interim blog setup, rough notes being dumped here at the moment - I'll tidy once I get to a milestone. And sorry about the layout, that'll probably take even longer to get around to... #TODO

Turtle Markdown Extensions

Published on 1970-01-01 by @danja

A bit of forward-planning for blog engine stuff. This went on my todo list the other day, since then I've had a think, thought I'd better get it down before I forget.

The implementation for makesite.py should be straightforward, but I've other things to do. But I can start using these extensions in posts today, no matter that they won't do anything yet. When I've got a demo implementation and tried it out a bit I'll give it a repo on GitHub.

How to express RDF statements in Markdown?

Uses Cases

  1. make statements about the md doc
  2. extract a block of arbitrary Turtle from md doc

General Requirements

  1. simple to use, simple to implement
  2. independent of, but compatible with existing markdown tools
  3. extensible, reasonably modular
  4. block identifier & delimiters
  5. useful defaults, easily overriden

Note re. (2) : the markup syntax used will be interpreted as a processing instruction, so while Turtle creation/extraction is the immediate goal, it makes sense for extensibility to consider other possible uses.

0. General Syntax

` :term fur`

``` :term fur```

TODO express in BNF TODO provide regexes

1. Statements about Current Markdown Document

` :tag fur`

TODO result

In this example fur is one word, a simple string delimited by spaces. Alternatives will include quoting of literals "as in Turtle" for the object as well as the use of URIs using standard Turtle syntax.

TODO longer example

Useful Terms

TODO fill out as needed, find standard vocab equivalents

2. Arbitrary Turtle in Markdown Document

Where a block of Turtle should be extracted, the term mx:x should be used, e.g.

```:x @base http://example.org/ . @prefix foaf: http://xmlns.com/foaf/0.1/ . @prefix rel: http://www.perceive.net/schemas/relationship/ .

<#green-goblin> rel:enemyOf <#spiderman> ; a foaf:Person ; # in the context of the Marvel universe foaf:name "Green Goblin" . ```

3. Interpretation Rules

TODO

for eg. mx:tags - provide a simple list syntax

Terms MAY be interpreted as those in the mx namespace and/or well-known equivalents

How to say what should be passed to standard markdown processor, what should be cut?

Implementation Notes

eg. :

contents = mx(markdown_with_extensions)

markdown = contents['markdown']
turtle = contents['turtle']

html = to_html(markdown)
store.add(turtle)