我在Protégé中对相同数据运行以下查询
SELECT (COUNT(?VM) AS ?count_VM)
WHERE {
?VM a cocoon:VM .
}
正确地给了我57
SELECT (COUNT(?storage) AS ?count_storage)
WHERE {
?storage a cocoon:Storage .
}
正确地给我8
但是
SELECT (COUNT(?VM) AS ?count_VM) (COUNT(?storage) AS ?count_storage)
WHERE {
?VM a cocoon:VM .
?storage a cocoon:Storage .
}
给我
"456"^^<http://www.w3.org/2001/XMLSchema#integer>
对于?count_VM
和?count_storage
怎么了?
答案 0 :(得分:1)
通过Stanislav Kralin更好地回答:
url
{{3}}的旧答案:
select ?cls (count(?s) AS ?count)
{VALUES ?cls {cocoon:Storage cocoon:VM} ?s a ?cls}
group by ?cls