You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

SPARQL如何查询返回无命名空间前缀的startDate日期属性值

问题解决说明

你遇到的无显式前缀属性无法查询的问题,核心原因是startDate/endDate继承了RDF片段中声明的默认命名空间http://schema.org/,只需要在SPARQL中补充对应命名空间的前缀声明,再添加日期属性的匹配规则即可。

如果需要保留没有填写日期的实体记录,用OPTIONAL包裹日期匹配规则;如果只需要返回同时包含日期的实体,去掉OPTIONAL关键字即可。

修改后完整查询语句

PREFIX rdf:<http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX skos:<http://www.w3.org/2004/02/skos/core#>
PREFIX schema:<http://schema.org/>
SELECT ?s ?prefLabel ?scopeNote ?startDate ?endDate WHERE {
  ?s skos:inScheme <https://data.niod.nl/WO2_Thesaurus/events/4329> .
  ?s skos:prefLabel ?prefLabel .
  ?s skos:scopeNote ?scopeNote .
  FILTER (lang(?prefLabel)= "nl") .
  OPTIONAL {?s schema:startDate ?startDate .}
  OPTIONAL {?s schema:endDate ?endDate .}
}
LIMIT 50

内容的提问来源于stack exchange,提问作者Jan Willem Tulp

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.12 09:21:03