SPARQL:绑定变量在联合中不起作用

时间:2018-10-31 18:26:00

标签: sparql wikidata

我不清楚为什么该变量(?entity)在一个UNION中起作用而在另一个变量中不起作用(期望的结果是{{1}的Q8740列中的val }}):

wikidata-id

除非我“手动”指定相关实体,否则SELECT ?propLabel ?val WHERE { BIND(wd:Q8740 as ?entity) { BIND(?entity AS ?valUrl) BIND("n/a" AS ?propUrl) BIND("name"@en AS ?propLabel) ?entity rdfs:label ?val. FILTER((LANG(?val)) = "en") # wikidata-id } UNION { # BIND(?entity as ?val) **this doesn't work** BIND(wd:Q8740 AS ?val) BIND("wikidata-id" AS ?propLabel) } # description } UNION { BIND(?entity AS ?valUrl) - **but here, ?entity works fine!** BIND("description"@en AS ?propLabel) OPTIONAL { ?entity schema:description ?val. } FILTER((LANG(?val)) = "en") } } 的{​​{1}}列中什么也不会出现,但仅在其中一个val ...中?

0 个答案:

没有答案