SPARQLクエリを使用して、グラフストア内で一意の値の組み合わせを検索しています。しかし、私は成功しません。SPARQL固有の値の組み合わせを計算する
基本的に私が何をしようとするものである:
a b c
e f g
e r t
a b c
k l m
e f g
a b c
result:
a b c | 3
e f g | 2
e r t | 1
k l m | 1
はdistincts、グループby`sとサブクエリで、いくつかの構造をしようとしましたが、私は成功いけません。
最終試してみてください。
SELECT (count (*) as ?n){
SELECT DISTINCT ?value1 ?value2 ?value3 WHERE {
?instance vocab:relate ?value1 .
?instance vocab:relate ?value2 .
?instance vocab:relate ?value3 .
}
}
RDF:
<http://test.example.com/instance1>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/c> , <http://test.example.com/b> , <http://test.example.com/a> .
<http://test.example.com/instance6>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/g> , <http://test.example.com/f> , <http://test.example.com/e> .
<http://test.example.com/instance4>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/c> , <http://test.example.com/b> , <http://test.example.com/a> .
<http://test.example.com/instance2>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/g> , <http://test.example.com/f> , <http://test.example.com/e> .
<http://test.example.com/instance7>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/c> , <http://test.example.com/b> , <http://test.example.com/a> .
<http://test.example.com/instance5>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/m> , <http://test.example.com/l> , <http://test.example.com/k> .
<http://test.example.com/instance3>
a <http://test.example.com#Instance> ;
<http://vocab.example.com/relate>
<http://test.example.com/t> , <http://test.example.com/r> , <http://test.example.com/e> .
私は、あなたは、単に 'FILTER(?をvalue1
AKSW
最初の投稿にRDFを追加しました – user3599600