Retrieve the subjects that have at most two properties

Viewed 33

I wanted to retrive subjects which have less than three properties. I tried with following query.

SELECT ?s
WHERE {
 ?s ?p ?o .
}
group by ?s
having (count(?p) < 3)
limit 10

But it's taking quite long time. Do we have any other optimized way to do same thing.

0 Answers
Related