Needs review
Project:
SPARQL Views
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
24 Nov 2011 at 17:31 UTC
Updated:
6 Jan 2012 at 18:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
stuartraetaylor commentedI've updated
sparql_views_plugin_query_sparql.incto fix the original error, and also updatedsparql_views_handler_field.incto fix a bug rendering optional fields when using consolidate results.Comment #2
Anonymous (not verified) commentedThanks for posting the issue and the patch.
It looks like I never updated this bit of code for the new version. TBH, I hate having to do anything with it because it is so complex. When I tried the patch, it made it so all of the results had all of the values from the other subjects.
I managed to get it working for my use case. There were some errors as I went along. One of the errors comes from having a subject in the query but not having the subject URI chosen as a field. To prevent this error, at least one subject URI must be included in the selected fields.
Another problem is when you have multiple subjects in the query. If you want to consolidate all values on a single resource, this patch allows you to do that. You have to have the resource's subject URI field chosen but not the other subject URIs.
This will fail for more complex queries, but it's good enough for me for now. Better consolidation might have to wait until subqueries in SPARQL 1.1.
If you have the chance to test it with your use case, please post and let me know if it worked. FYI, I'll probably commit it if I don't hear back in a few days.