2

是否有某种标准化的方法可以在 HTML 中对引文进行语义标记?我知道当我从网站引用时,我可以:

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

但我宁愿想一些更精确的东西,也许使用RDFaDublin Core。沿着:

<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>

然后我可以在它上面运行一些 Javascript 或 XSLT 以将引文显示为悬停文本或脚注或其他内容(HTML5 建议脚注)。但是这种方式在语义上似乎相当松散。难道没有一种聪明的方法可以将引用的文本(在 q 标签中)与 RDF 三元组相关联吗?像:

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

我对BibTeXML提议的 Citation 微格式感到困惑,但它们(以及我见过的 Dublin Core 的所有用法)似乎总是关注特定书籍的元数据(因为它可能出现在参考书目中)而不是如何标记引文并将其引用到一本书。

任何想法或提示表示赞赏,谢谢。

4

2 回答 2

0

其中一些存储在标头的元标记中。

<meta name="author" content="Hege Refsnes" />

<meta name="revised" content="Hege Refsnes, 23/10/2011" />

两者都是从 w3cschools 页面上的元标记复制/粘贴 还有其他常用的不在 w3c 规范中。我不确定是否有任何地方的清单。

此外,如果您决定使用 html5,那么还有新的标签和属性。一些标签是address , cite , details , summary

您可以在 xhtml 中使用的 html5 的另一个功能(尽管它不会在 xhtml 中验证)是使用自定义属性。在 html5 中,您应该以 data-yourAttributName 开头,以防在更高版本的 html 中使用 yourAttributeName。

例如<p data-date='13MAR2012'></p>

于 2012-03-13T10:05:39.023 回答
0

使用 BIBO Ontology - 它包含您想要的所有术语:

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

尤其:

bibo:citedBy
bibo:cites
bibo:Quote

RDF 不支持将文字作为主题。

因此,在上面的示例中,我将根据新的 RDFa-Core 规范推荐以下内容:

<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>

这将解析为以下 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".
于 2012-03-17T20:24:41.453 回答