duanchigeng4313 2012-03-12 13:34
浏览 78
已采纳

如何使用PHP或Java从HTML中提取RDFa?

I am a newbie, trying to learn about RDF, RDFa and stuffs related to it since few days..

My question is, consider following HTML + RDFa code .. is it possible to extract the RDF part separately? if so could you please demonstrate simple code snippet (PHP or Java)..

i have heard Jena could be used, but couldn't find a tutorial which explains this. So if it is possible with Jena could anyone post some code snippet please..

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
version="XHTML+RDFa 1.0" xml:lang="en">
  <head>
    <title>John's Home Page</title>
    <base href="http://example.org/john-d/" />
    <meta property="dc:creator" content="Jonathan Doe" />
    <link rel="foaf:primaryTopic" href="http://example.org/john-d/#me" />
  </head>
  <body about="http://example.org/john-d/#me">
    <h1>John's Home Page</h1>
    <p>My name is <span property="foaf:nick">John D</span> and I like
      <a href="http://www.neubauten.org/" rel="foaf:interest"
        xml:lang="de">Einstürzende Neubauten</a>.
    </p>
    <p>
      My <span rel="foaf:interest" resource="urn:ISBN:0752820907">favorite
      book is the inspiring <span about="urn:ISBN:0752820907"><cite
      property="dc:title">Weaving the Web</cite> by
      <span property="dc:creator">Tim Berners-Lee</span></span>
     </span>
    </p>
  </body>
</html>
  • 写回答

4条回答 默认 最新

  • dongqiao3214 2012-03-12 15:34
    关注

    Yes, you can extract the RDF from the pages containing RDFa markup, and once extracted, you can put it into a local RDF triplestore if you want to do some stuff w/ that data alone, or you could insert it into a global triplestore and be able to query it alongside existing RDF data.

    Here is a relevant discussion on Java RDFa parsers.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器