简体   繁体   English

用Javascript创建rdfa

[英]Creating an rdfa in Javascript

I am getting data from dbpedia and need to create an rdfa to link back to the original sources. 我正在从dbpedia获取数据,需要创建一个rdfa才能链接回原始源。 I really dont understand how to do this. 我真的不明白该怎么做。 I need to show the subject, relationships etc. Could someone give me a clear example? 我需要显示主题,人际关系等。有人可以给我一个清晰的例子吗?

http://dbpedia.org/page/Tiger 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>

You could do this: 您可以这样做:

<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 this: 和/或此:

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

In <head> you would initalize vocabularies uses in <head> and <body> like this: <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"
>

and for vocabularies only used in <body> you would initialize like this: 对于仅用于<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"
>

For _term you would select your own term to identify what part of about="this: you are presenting. 对于_term您将选择自己的术语以标识about="this:内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM