我正在为我正在创建的相机本体而挣扎。生成单个三元组非常容易,但我想知道如何创建层次结构。基本上,我想了解我是如何创建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对其进行编码?
发布于 2016-01-31 08:28:37
除非您希望将这些关系建模为某种通用规则,否则使用Turtle (或N3或NTriples,它们是类似的)比RDF/XML更容易。
我认为你的例子不是你所描述的那样
主体成为客体
而是多个参数之间的关系。使用RDF,您可以通过将参数分组到空白节点中来进行建模。
这里有一些用于照相机1的海龟(假定为空前缀)。
:optics :hasMaxAptertureDefinition [
:withPosition :Wide ;
:withFormat :FullFrame;
:hasMaxAperture 1.8
]
这对你有用吗?
等价的RDF/XML应该类似于
<?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>
https://stackoverflow.com/questions/35106372
复制相似问题