如何使所有变量不同?
How to make all variables distinct?
我有这样的查询:
SELECT DISTINCT ?a ?b
WHERE {
...
} ORDER BY DESC(?area)
但这会产生:
a b
"result1" "item1"
"result2" "item2"
"result3" "item3"
"result4" "item4"
"result4" "item5"
所以我想知道,因为这是我的大学,如果他们不想 result4 两次,这是因为 result4 是item4 和 item5 的组成部分。
那么我怎么知道我希望每个变量都是不同的,而不仅仅是 a 和 b 对?
这个:
SELECT DISTINCT ?l_name DISTINCT ?region_name
会产生错误:
Encountered " "distinct" "DISTINCT "" at line 10, column 25. Was expecting one of: "(" ... "{" ... "from" ... "where" ... ... ...
如果您不关心 b 列,就不要 select 它.. 只在您的查询中输入 a:
SELECT DISTINCT ?a WHERE ....
我有这样的查询:
SELECT DISTINCT ?a ?b
WHERE {
...
} ORDER BY DESC(?area)
但这会产生:
a b
"result1" "item1"
"result2" "item2"
"result3" "item3"
"result4" "item4"
"result4" "item5"
所以我想知道,因为这是我的大学,如果他们不想 result4 两次,这是因为 result4 是item4 和 item5 的组成部分。
那么我怎么知道我希望每个变量都是不同的,而不仅仅是 a 和 b 对?
这个:
SELECT DISTINCT ?l_name DISTINCT ?region_name
会产生错误:
Encountered " "distinct" "DISTINCT "" at line 10, column 25. Was expecting one of: "(" ... "{" ... "from" ... "where" ... ... ...
如果您不关心 b 列,就不要 select 它.. 只在您的查询中输入 a:
SELECT DISTINCT ?a WHERE ....