Search code examples
xhtmlquotessemantic-markupweb-standardsrdfa

Marking up citations in HTML


Is there a somewhat standardized way to semantically mark up citations in HTML? I know that when I'm citing from a website i can do:

<q title="Article by John" cite="http://example.com/article">quoted text...</q>

But I was rather thinking something a bit more precise, maybe using RDFa and Dublin Core. Along the lines of:

<q cite="http://example.com/article">quoted text...</q>
<span xmlns:dc="http://purl.org/dc/elements/1.1/" about="#berkman">
    <cite property="dc:title">Find It Fast: How to Uncover Expert Information on Any Subject</cite>
    <span property="dc:creator">Berkman, R. I.</span>
    <span property="dc:date">1994</span>
    <span property="dc:publisher">New York: HarperPerennial</span>
    <span property="dc:type">book</span>
</span>

Then I could run some Javascript or XSLT over it to display the citation as a hover-text or footnote or something (HTML5 recommendation on footnotes). But this way seems to be rather loose on semantics. Isn't there a smart way to associate the quoted text (in the q tag) with an RDF triple? Like:

"quoted text..." voc:isQuotedFrom _b1.
_b1 dc:title "Find it Fast";
    dc:creator "Berkman, R. I.".

I've stubled over BibTeXML and a proposed Citation microformat but they (as well as all usages of Dublin Core I've seen) always seem to focus on the metadata of a specific book (as it might appear in a bibliography) and not on how to mark up a citation and reference it to a book.

Any thoughts or tips appreciated, thanks.


Solution

  • Use the BIBO Ontology - it has all the terms you want:

    http://bibotools.googlecode.com/svn/bibo-ontology/trunk/doc/index.html

    In particular:

    bibo:citedBy
    bibo:cites
    bibo:Quote
    

    RDF doesn't support literals as subjects.

    So in the example above I would recommend the following, based on the new RDFa-Core Specification:

    <div vocab="http://purl.org/ontology/bibo/" typeof="Quote">
        <span rel="cites" resource="http://mybookstore.com/books#berkman"></span>
        <q cite="http://example.com/article" property="shortDescription">quoted text...</q>
    </div>
    
    <span about="http://mybookstore.com/books#berkman" typeof="Book" prefix="dc: http://purl.org/dc/elements/1.1/" vocab="http://purl.org/ontology/bibo/">
        <cite property="dc:title">Find It Fast: How to Uncover Expert Information on Any Subject</cite>
        <span property="dc:creator">Berkman, R. I.</span>
        <span property="dc:date">1994</span>
        <span property="dc:publisher">New York: HarperPerennial</span>
    </span>
    

    This would resolve to the following rdf:

    @prefix dc: <http://purl.org/dc/elements/1.1/> .
    @prefix bibo: <http://purl.org/ontology/bibo/> .
    @prefix mybooks: <http://mybookstore.com/books#> .
    @prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
    
    _:b1 rdf:type bibo:Quote;
         bibo:cites mybooks:berkman;
         bibo:shortDescription "quoted text...".
    
    mybooks:berkman rdf:type bibo:Book;
            dc:title "Find It Fast: How to Uncover Expert Information on Any Subject";
            dc:creator "Berkman, R. I.";
            dc:date "1994";
            dc:publisher "New York: HarperPerennial".