首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何使用依赖关系创建RDF?

如何使用依赖关系创建RDF?
EN

Stack Overflow用户
提问于 2016-01-30 19:53:44
回答 1查看 65关注 0票数 1

我正在为我正在创建的相机本体而挣扎。生成单个三元组非常容易,但我想知道如何创建层次结构。基本上,我想了解我是如何创建RDF图形的,在这里,主题变成了对象。我只是从这个开始,所以如果不匹配的话,可以随意调整/重写我的术语。

例如:

我有一个叫做光学的类,我想提供一个摄像机范围内的最大孔径,但是这个值取决于几个参数,即lensPosition (Wide或Tele)和传感器格式(FullFrame或APS-C)。

这是潜在的结果:

照相机A:

光学- withPosition -> Wide - withFormat -> FullFrame - hasMaxAperture -> 1.8

光学- withPosition -> Tele - withFormat -> FullFrame - hasMaxAperture -> 4.0

光学- withPosition -> Wide - withFormat -> APS-C - hasMaxAperture -> 3.2

光学-- withPosition -> Tele -- withFormat --> APS-C -- hasMaxAperture -> 6.0

照相机B:

光学- withPosition -> Wide - withFormat -> FullFrame - hasMaxAperture -> 4.0

光学- withPosition -> Tele - withFormat -> FullFrame - hasMaxAperture -> 8.0

等等..。

如何最好地使用RDF/XML对其进行编码?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-01-31 08:28:37

除非您希望将这些关系建模为某种通用规则,否则使用Turtle (或N3或NTriples,它们是类似的)比RDF/XML更容易。

我认为你的例子不是你所描述的那样

主体成为客体

而是多个参数之间的关系。使用RDF,您可以通过将参数分组到空白节点中来进行建模。

这里有一些用于照相机1的海龟(假定为空前缀)。

代码语言:javascript
运行
复制
:optics :hasMaxAptertureDefinition [
  :withPosition :Wide ; 
  :withFormat :FullFrame;
  :hasMaxAperture 1.8
]

这对你有用吗?

等价的RDF/XML应该类似于

代码语言:javascript
运行
复制
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF 
   xmlns:ns1="http://example/"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>
   <rdf:Description rdf:nodeID="ub428bL0C36">
      <ns1:withFormat rdf:resource="http://example/#FullFrame"/>
      <ns1:withPosition rdf:resource="http://example/#Wide"/>
      <ns1:hasMaxAperture rdf:datatype="http://www.w3.org/2001/XMLSchema#decimal">1.8</ns1:hasMaxAperture>
   </rdf:Description>
   <rdf:Description rdf:about="http://example/#optics">
      <ns1:hasMaxAptertureDefinition rdf:nodeID="ub428bL0C36"/>
   </rdf:Description>
</rdf:RDF>
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/35106372

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档