Mantas
2014-01-02 13:52:40 UTC
Is it possible to add semantic annotations in reStructuredText
documents?
For example, using RDFa, one could annotate things in HTML like this::
<div xmlns:dc="http://purl.org/dc/elements/1.1/"
about="http://www.example.com/books/wikinomics">
<span property="dc:title">Wikinomics</span>
<span property="dc:creator">Don Tapscott</span>
<span property="dc:date">2006-10-01</span>
</div>
This can be converted to Turtle format::
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://www.example.com/books/wikinomics>
dc:title "Wikinomics" ;
dc:creator "Don Tapscott" ;
dc:date "2006-10-01" .
As I understand, only way to achieve this in reST, is using rules, some
thing like this::
.. rdf:: turtle
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://www.example.com/books/wikinomics>
dc:title {wikinomics-title} ;
dc:creator {wikinomics-creator} ;
dc:date {wikinomics-date} .
.. role:: wikinomics-title
.. role:: wikinomics-creator
.. role:: wikinomics-date
`Wikinomics`:wikinomics-title: `Don Tapscott`:wikinomics-creator:
`2006-10-01`:wikinomics-date:.
Where, ``{...}`` would be used as template variables with values taken
from roles interpreted texts.
The problem is, that roles, must be defined, before use, which in this
case is redundant.
Also, interpreted text can't be nested, while in semantic annotation,
there can be cases, where you need to specify nested annotations. For
example RDFa annotation for "Alice in Wonderland"::
<div
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:place="http://purl.org/ontology/places#"
about="http://en.wikipedia.org/wiki/Alice_in_Wonderland">
<span property="dc:title">
<span property="foaf:givenName">Alice</span> in
<span property="place:Country">Wonderland</span>
</span>
</div>
I think, for this it would be better to have more flexible interpreted
text form, for example:
.. rdf:: turtle
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix place: <http://purl.org/ontology/places#> .
<http://en.wikipedia.org/wiki/Alice_in_Wonderland>
dc:title {alice-in-wonderland} ;
foaf:givenName {alice} ;
place:Country {wonderland} .
{{Alice|alice} in {Wonderland|wonderland}|alice-in-wonderland}.
What do you think?
--
Mantas aka sirex
__o /\
_ \<,_ -- launchpad.net/~sirex -- /\/ \
___(_)/_(_)_____________________________/_/ \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
documents?
For example, using RDFa, one could annotate things in HTML like this::
<div xmlns:dc="http://purl.org/dc/elements/1.1/"
about="http://www.example.com/books/wikinomics">
<span property="dc:title">Wikinomics</span>
<span property="dc:creator">Don Tapscott</span>
<span property="dc:date">2006-10-01</span>
</div>
This can be converted to Turtle format::
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://www.example.com/books/wikinomics>
dc:title "Wikinomics" ;
dc:creator "Don Tapscott" ;
dc:date "2006-10-01" .
As I understand, only way to achieve this in reST, is using rules, some
thing like this::
.. rdf:: turtle
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<http://www.example.com/books/wikinomics>
dc:title {wikinomics-title} ;
dc:creator {wikinomics-creator} ;
dc:date {wikinomics-date} .
.. role:: wikinomics-title
.. role:: wikinomics-creator
.. role:: wikinomics-date
`Wikinomics`:wikinomics-title: `Don Tapscott`:wikinomics-creator:
`2006-10-01`:wikinomics-date:.
Where, ``{...}`` would be used as template variables with values taken
from roles interpreted texts.
The problem is, that roles, must be defined, before use, which in this
case is redundant.
Also, interpreted text can't be nested, while in semantic annotation,
there can be cases, where you need to specify nested annotations. For
example RDFa annotation for "Alice in Wonderland"::
<div
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:place="http://purl.org/ontology/places#"
about="http://en.wikipedia.org/wiki/Alice_in_Wonderland">
<span property="dc:title">
<span property="foaf:givenName">Alice</span> in
<span property="place:Country">Wonderland</span>
</span>
</div>
I think, for this it would be better to have more flexible interpreted
text form, for example:
.. rdf:: turtle
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix place: <http://purl.org/ontology/places#> .
<http://en.wikipedia.org/wiki/Alice_in_Wonderland>
dc:title {alice-in-wonderland} ;
foaf:givenName {alice} ;
place:Country {wonderland} .
{{Alice|alice} in {Wonderland|wonderland}|alice-in-wonderland}.
What do you think?
--
Mantas aka sirex
__o /\
_ \<,_ -- launchpad.net/~sirex -- /\/ \
___(_)/_(_)_____________________________/_/ \
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^