使用 SPARQL 查询检查属性是否有效
我想检查一个属性是否功能正常。我尝试过:
ASK {
pz:isBase owl:isInverseFunctional .
}
但这是一个语法错误。如何检查房产是否功能正常?
I want to check whether a property is functional or not. I tried:
ASK {
pz:isBase owl:isInverseFunctional .
}
but it is a syntax error. How can I check whether a property is functional?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试:
解释一下:RDF 表示的模式以及 SPARQL 查询是
主题谓词对象
的三元组,或者换句话说是二元谓词。您正在考虑一个一元谓词isInverseFunctional()
,但 RDF 不执行一元谓词。相反,这种类型或排序信息被编码为具有特殊谓词rdf:type
的二元谓词,您可以将其视为isKindOf
或is member类的
。因此,要发现域模型中表示特定谓词的资源是否是反函数属性,您需要询问该资源是否属于所有反函数属性的类,即具有 rdf:type 类属性或 owl:InverseFunctionalProperty。
Try:
To explain: the patterns that RDF represents, and which SPARQL queries, are triples of
subject predicate object
, or in other words a binary predicate. You're thinking of a unary predicateisInverseFunctional()
, but RDF doesn't do unary predicates. Instead, that kind of type or sortal information is encoded as a binary predicate with a special predicaterdf:type
, which you can think of asisKindOf
oris member of the class
.So, to discover whether a resource denoting a particular predicate in your domain model is an inverse functional property, you ask whether that resource is in the class of, i.e. has
rdf:type
the class of all inverse functional properties orowl:InverseFunctionalProperty
.