I have the following data:
@prefix f: <http://example.org#> .
_:a f:trait "Rude"@en .
_:a f:name "John" .
_:a f:surname "Roy" .
_:b f:trait "Crude"@en .
_:b f:name "Mary" .
_:b f:surname "Lestern" .
However, if I execute the following query in Blazegraph:
PREFIX f: <http://example.org#>
SELECT ?s ?o
WHERE
{
?s f:trait ?o .
}
I get six results:
s o
t32 Crude
t37 Crude
t39 Crude
t31 Rude
t36 Rude
t38 Rude
If blank nodes _:a
and _:b
are distinct nodes, how should I write a SPARQL query to return only two distinct results? I have tried SELECT DISTINCT
, but it still returns six results. I have tried grouping by ?o
, but Blazegraph returns an error, saying it's a bad aggregate. Why does this kind of output of repeating tuples happen? And how to avoid it?