如何查询 RDF 个体的数据属性?
我有一个本体,其中 arc_cfp
是类 Arc
的个体。我想知道,鉴于我有个人的 URI,如何才能获取个人的所有数据属性?
基本上,我正在这样做:
SELECT ?idRef ?name ?src ?dst ?perf
WHERE
{
?x rdf:type http://www.semanticweb.org/ontologies/2012/1/graph.owl#arc_cfp .
?x graph:idRef_arc ?idRef .
?x graph:name_arc ?name .
?x graph:hasSource ?src .
?x graph:hasDestination ?dst .
?x graph:hasPerformatif ?perf .
}
我很确定,使用 rdf:type 是问题所在。但是,我不知道我需要使用什么。
谢谢。
〜科德拉
I have an ontology where arc_cfp
is an individual of class Arc
. I would like to know how could I get all the data properties of the individual, given that I have the individual's URI?
Basically, I am doing this:
SELECT ?idRef ?name ?src ?dst ?perf
WHERE
{
?x rdf:type http://www.semanticweb.org/ontologies/2012/1/graph.owl#arc_cfp .
?x graph:idRef_arc ?idRef .
?x graph:name_arc ?name .
?x graph:hasSource ?src .
?x graph:hasDestination ?dst .
?x graph:hasPerformatif ?perf .
}
I am pretty sure, using rdf:type
is the problem. But, I have no idea what I need to use.
Thanks.
~Codera
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您想要一个纯粹的探索性查询,其形式为“给我有关主题的所有三元组”,它应该如下所示:
这将为您提供与您传入的常量 URI 关联的所有谓词对象对。如果您对传入 as 感兴趣以及传出属性,您可以执行以下操作:
Assuming you want a purely exploratory query of the form "give me all the triples about a subject" it should look the following:
This will give you all predicate object pairs associated with the constant URI you pass in. If you are interesting in incoming as well as outgoing properties you could do the following instead:
您还可以使用 DESCRIBE 查询来获取有关的所有 RDF 数据一个资源。
PS 不要忘记在查询中添加前缀。
You can also use a DESCRIBE query to grab all the RDF data about a Resource.
P.S. Don't forget to put prefixes in your queries.