是否可以在RML/SPARQL映射中使用前缀进行模板定义?
我正在尝试使用 rml映射。
我已经弄清楚了如何定义和使用前缀rr:常数
定义,如<< ----
箭头所示。我还弄清楚了如何使用rr:template
映射列值,如<<<<<<<<<
arrow中代码。
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://example.org/>.
[...]
:map_001 rr:predicateObjectMap [
rr:predicate rdf:type; # <<---
rr:objectMap [
rr:constant ex:MyClass; # <<---
rr:termType rr:IRI
]
];
rr:predicateObjectMap [
rr:predicate ex:myPredicate; # <<---
rr:objectMap [
rr:template "http://example.org/{some_column}" # <<<<<<
]
].
我的问题是:是否有可能在rr:template
定义中以某种方式使用前缀,以便不必明确编写完整的基础URI?例如,我想做类似下面显示的事情,尽管这显然不起作用:
:map_001 rr:predicateObjectMap [
rr:predicate ex:myPredicate;
rr:objectMap [
rr:template ex:"{some_column}" # <<--- DOESN'T WORK!
]
].
是否有任何语法,还是根本不可能?
I'm trying to map tabular data into RDF using RML mapping.
I've figured out how to define and use prefixes for rr:constant
definitions as indicated with the <<---
arrows in the code below. I've also figured out how to map column values using rr:template
, as indicated with the <<<<<<
arrow in the same code.
@prefix rr: <http://www.w3.org/ns/r2rml#>.
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix ex: <http://example.org/>.
[...]
:map_001 rr:predicateObjectMap [
rr:predicate rdf:type; # <<---
rr:objectMap [
rr:constant ex:MyClass; # <<---
rr:termType rr:IRI
]
];
rr:predicateObjectMap [
rr:predicate ex:myPredicate; # <<---
rr:objectMap [
rr:template "http://example.org/{some_column}" # <<<<<<
]
].
My question is: is it possible to somehow use prefixes in rr:template
definitions, in order to not have to explicitly write the complete base URI? For example, I'd like to do something like what is shown below, although this clearly doesn't work:
:map_001 rr:predicateObjectMap [
rr:predicate ex:myPredicate;
rr:objectMap [
rr:template ex:"{some_column}" # <<--- DOESN'T WORK!
]
].
Is there any syntax for this, or is it simply not possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论