使用 SPARQL 查询检查属性是否有效

发布于 2025-01-08 06:58:56 字数 131 浏览 3 评论 0原文

我想检查一个属性是否功能正常。我尝试过:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回忆追雨的时光 2025-01-15 06:58:56

尝试:

ASK {pz:isBase rdf:type owl:InverseFunctionalProperty}

解释一下:RDF 表示的模式以及 SPARQL 查询是主题谓词对象三元组,或者换句话说是二元谓词。您正在考虑一个一元谓词isInverseFunctional(),但 RDF 不执行一元谓词。相反,这种类型或排序信息被编码为具有特殊谓词 rdf:type 的二元谓词,您可以将其视为 isKindOfis member类的

因此,要发现域模型中表示特定谓词的资源是否是反函数属性,您需要询问该资源是否属于所有反函数属性的类,即具有 rdf:type 类属性或 owl:InverseFunctionalProperty。

Try:

ASK {pz:isBase rdf:type owl:InverseFunctionalProperty}

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 predicate isInverseFunctional(), but RDF doesn't do unary predicates. Instead, that kind of type or sortal information is encoded as a binary predicate with a special predicate rdf:type, which you can think of as isKindOf or is 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 or owl:InverseFunctionalProperty.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文