我不清楚为什么该变量(?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
...中?