There's nothing like sending a puzzled email to start the back of the
mind solving a problem.

The following seems to be what the doctor ordered.


SELECT ?sub ?pred ?obj ( COUNT(distinct ?s) as ?count)
WHERE {
  GRAPH <urn:jug:global> {
   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement> .
   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?sub .
   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> ?pred .
   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
}
}
GROUP BY ?sub ?pred ?obj
ORDER BY DESC(?count)



On Sun, Jan 30, 2011 at 10:54 AM, Benson Margulies
<[email protected]> wrote:
> I've got other ways to do this, but it is nagging at me that I can't
> figure out how to express this in sparq.
>
> I've got a graph with many reified statements.
>
> So, consider this where clause fragment, selects all the statements
> that make up all the reifications. What I want is to end up with:
>
>   ?sub ?pred ?obj ?count-of-this-triple
>
> in the select list.
>
>  GRAPH <urn:jug:global> {
>   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
> <http://www.w3.org/1999/02/22-rdf-syntax-ns#Statement> .
>   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?sub .
>   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#predicate> ?pred .
>   ?s  <http://www.w3.org/1999/02/22-rdf-syntax-ns#object> ?obj .
> }
>

Reply via email to