Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential problem with GROUP BY in RDF::Query when using RDF::Trine::Store::Memory #151

Open
minusdavid opened this issue Jun 16, 2017 · 3 comments
Assignees

Comments

@minusdavid
Copy link
Contributor

Using RDF::Query, I have a SPARQL query that has a GROUP BY, but it doesn't seem to be working with RDF::Trine::Store::Memory.

Still need to investigate more...

@minusdavid
Copy link
Contributor Author

In my logs I see:

SELECT ?subject
WHERE {
?subject ?predicate ?object .
FILTER NOT EXISTS { ?os ?op ?subject }
}
GROUP BY ?subject

Become:

using query plan: (project (subject) (filter (! (sparql:exists (BGP
(triple ?os ?op ?subject)

@kasei
Copy link
Owner

kasei commented Jun 17, 2017

You're on a roll finding issues. Really sorry about that! This does seem like a big, but I'll mention that this is a strange query that might be more naturally expressed as "select distinct ?subject" without any grouping. That said, using grouping without any aggregate functions like SUM should still work and I'll try to get a fix for that.

@minusdavid
Copy link
Contributor Author

I'm nearly finished with my RDF code, so I probably won't be finding many more soon!

Great suggestion. I changed it to use 'select distinct' instead and that works a treat. Sounds good about getting a fix out though. I always use 'GROUP BY' with SQL rather than 'DISTINCT', so I hadn't even thought to use it here with SPARQL.

@kasei kasei self-assigned this Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants