[英]BIND in CONSTRUCT query with sub-SELECT (SPARQL)
Related to another question (see: SPARQL functions in CONSTRUCT/WHERE ) where the answer leads to having a SPARQL CONSTRUCT query with a aggregate SELECT inside, I now would like to know how to use BIND in this construct. 与另一个问题(请参阅: CONSTRUCT / WHERE中的SPARQL函数 )有关,在那里答案导致具有内部SELECT的SPARQL CONSTRUCT查询,我现在想知道如何在此构造中使用BIND。
My current query looks like this (simplified): 我当前的查询如下所示(简化):
PREFIXES
CONSTRUCT { ?s rdfs:label ?var . }
WHERE {
SELECT ?s (AVG(?single) as ?agg) ...
WHERE {
...
}
GROUP BY ?s ...
}
The question is: Where to place a BIND statement which is used to bind values to variables, which are then used in the CONSTRUCT statement (eg ?var
)? 问题是:在哪里放置用于将值绑定到变量的BIND语句,然后将其用于CONSTRUCT语句(例如
?var
)?
I tried to do it similar as is shown in this message: http://mail-archives.apache.org/mod_mbox/jena-users/201111.mbox/%3C4ED66723.7030506@googlemail.com%3E . 我尝试执行此消息中所示的类似操作: http : //mail-archives.apache.org/mod_mbox/jena-users/201111.mbox/%3C4ED66723.7030506@googlemail.com%3E 。 But the difference is, that there is no nested SELECT in this example.
但是不同的是,此示例中没有嵌套的SELECT。
This query composition seems to work for me: 此查询组合似乎对我有用:
PREFIX
CONSTRUCT { ... }
WHERE {
BIND () {
SELECT ...
WHERE {
...
}
GROUP BY ...
}
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.