Hello.

first of all: fantastic module. This is definately the future, and i have a feeling i will use this module quite a bit in months to come.
so, to my problem:

I tried browsing for others having the same problem, since i (as many before me) followed the ibm dev tutorial (http://www.ibm.com/developerworks/library/wa-datasets/).

It looks like its working almost as expected, but i can not get the DBPedia block to show correctly.

error message:
Notice: Undefined index: subject in sparql_views_handler_argument->query() (line 70 of /home/orkjernc/public_html/sites/all/modules/sparql_views/handlers/sparql_views_handler_argument.inc).
Notice: Undefined index: rdf_mapping in sparql_views_handler_argument->query() (line 75 of /home/orkjernc/public_html/sites/all/modules/sparql_views/handlers/sparql_views_handler_argument.inc).

i did a lot of troubleshooting and first found out that i can reach dbpedia just fine, as it displays info when omitting the filter.

then i found out that if i use some other field as contextual filter (as the case is for the "related projects" block) it seems to work. i used http://dbpedia.org/ontology/affiliation as mapping for a new field - just to test, and now got results back from both blocks.

i even tried to php code the field as argument ($node->field_123['und'][0]['safe_value']). same error message.

then i tried to use uri as contextual filter for the other block ("related projects") resulting in this view also failing.

i am not sure if this is a bug, or if i am doing something wrong. but i have tried this on a fresh install on 2 different setups now, all modules up to date. seems like views are failing when the uri is the contextual filter.

CommentFileSizeAuthor
#5 1250192-subject-uri.patch2.57 KBlinclark

Comments

Anonymous’s picture

Thanks for posting the issue. This looks like it could be related to #1249768: RDF type contextual filter not working.

eiriksm’s picture

Thanks for fast reply!
issue might be related. i tried to apply the patch in #1249768: RDF type contextual filter not working but no luck.
i realize that i have not set a rdf:type for the resource type, so that might be it. but i get dirty errors when i try to:

Warning: Illegal offset type in rdf_mapping_load() (line 136 of /home/orkjernc/public_html/modules/rdf/rdf.module).
Recoverable fatal error: Object of class SparqlViewsResourceType could not be converted to string in DatabaseStatementBase->execute() (line 2108 of /home/orkjernc/public_html/includes/database/database.inc).
The website encountered an unexpected error. Please try again later.

anyway. this step (adding a rdf type to the resource type) is not described in the tutorial, so as i said earlier, i am really surprised no one else that has followed this has had the same error. if i am doing everything right that is.

i have this test site online also. so if you want (and have the time and kindness), i would be glad to give you login details if you want to take a look.

Anonymous’s picture

Yeah, if you can send me the login through the contact form then I can take a look.

Anonymous’s picture

Ok, it looks like it is similar to the other issue, but not quite the same. I should be able to fix this in the next few hours. I'll be posting a patch then.

Anonymous’s picture

Title: URI as contextual filter fails? » subject URI contextual filter fails
Category: support » bug
Status: Active » Fixed
StatusFileSize
new2.57 KB

Thanks for posting this bug. There was a recent re-architecture to fix #1104074: Filters and arguments not working when field isn't selected, and that caused this to fail.

I have updated the git repo and attached a patch.

eiriksm’s picture

Thanks!
Tested and it works like a charm now.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

alexmc’s picture

Hi Lin, I just hit the same problem (with the same tutorial - but not DBPedia). Should I apply the patch in Post #5 or is there a later release I should install instead?

Thanks.

alexmc’s picture

And someone else has it live at

http://www.pinkham.com/8/node/2

Notice: Undefined index: subject in sparql_views_handler_argument->query() (line 70 of /var/www/html/8/sites/all/modules/sparql_views/handlers/sparql_views_handler_argument.inc).
Notice: Undefined index: rdf_mapping in sparql_views_handler_argument->query() (line 75 of /var/www/html/8/sites/all/modules/sparql_views/handlers/sparql_views_handler_argument.inc).
User error: Incomplete or invalid Group Graph pattern. Could not handle " ? in _sparql_request() (line 92 of /var/www/html/8/sites/all/modules/sparql/sparql.module).

(But that isn't my site, so I don't mind :-)

Anonymous’s picture

The dev version would have the fix for this included.

lkrier’s picture

I have been having the same error (using the same IBM tutorial), and applying the patch didn't fix the issue. I was wondering if there have been updates to this issue. Thanks!

AlfonsoAB’s picture

lkrier, try aplying this other patch too.

http://drupal.org/node/1249768#comment-4868102