Samah K
Samah K

Reputation: 23

Why doesn't the 'HAVING' function work in RdfLib SPARQL queries?

I'm trying to use the HAVING funtion in a SPARQL query. While the query works fine in Protege, it does not return any result when I use it in a query in the rdflib package(it does not raise an error either). Is it not supported in this package? or is there any other problem?

This is what I tried:

SELECT ?sub ?p (COUNT(?obj) AS ?numobj)

WHERE {

?sub      ?p    ?obj

}
GROUP BY ?sub ?p
HAVING (?numobj >= 2)

Essentially, what I'm trying to do is return all subjects that have a relationship with 2 or more objects (so, excluding subjects that only have relationship with only one object).

Upvotes: 1

Views: 80

Answers (0)

Related Questions