在 Javascript 中创建一个 rdfa

Creating an rdfa in Javascript

我正在从 dbpedia 获取数据,需要创建一个 rdfa 以 link 回到原始来源。我真的不明白该怎么做。我需要展示主题、关系等。有人能给我一个明确的例子吗?

http://dbpedia.org/page/Tiger

<div vocab="http://schema.org/" prefix=" dbr: http://dbpedia.org/resource/ dbo: http://dbpedia.org/ontology/" typeof="animal">

<span property="name"> Tiger </span>
<img property="dbr:image" src="cat_image_url" />
<span property="dbr:class" rel="dbr:class> Mammal </div> ?? or dbo?
<span property="dbr:age"> 24 </span>

你可以这样做:

<link rel="dc:subject schema:about ore:isDescribedBy" about="[dbr:Tiger]" title="Tiger" href="http://dbpedia.org/page/Tiger" datatype="xsd:string" content="Tiger">

and/or这个:

<dd><span about="schema:TechArticle" typeof="schema:discussionUrl dc:URI" property="foaf:primaryTopic" rel="cheminf:CHEMINF_000410" resource="http://dbpedia.org/page/Tiger"><span property="skos:prefLabel"><a href="https://en.wikipedia.org/wiki/Tiger" title="Tiger">Tiger</a>&nbsp;<img class="" alt="Exit disclaimer" src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Tigress_at_Jim_Corbett_National_Park.jpg/330px-Tigress_at_Jim_Corbett_National_Park.jpg" /></span></span></dd>

<head> 中,您可以像这样初始化 <head><body> 中使用的词汇:

<html
 prefix="
 this: http://example.com/public/organizations/ONTO/#
 bibo: http://purl.org/ontology/bibo/
 dbr: http://dbpedia.org/resources/
 dc: http://purl.org/dc/terms/
 foaf: http://xmlns.com/foaf/0.1/
 lcsh: http://id.loc.gov/authorities/subjects/
 og: http://ogp.me/ns#
 ore: http://www.openarchives.org/ore/terms/
 schema: http://schema.org/
"
 lang="en"
 xml:lang="en"
>

并且对于仅在 <body> 中使用的词汇表,您将像这样初始化:

<body
 prefix="
 cc: http://creativecommons.org/ns#
 cheminf: http://semantiscience.org/resource/
 usgov: http://www.oegov.us/democracy/us/core/owl/usgov#
"
 about="this:_term"
 typeof="cc:Work bibo:Document ore:Aggregation schema:TechArticle"
>

对于 _term,您将 select 您自己的术语来确定您正在展示 about="this: 的哪一部分。