From: Rob V. <rv...@do...> - 2010-06-16 11:56:34
|
Hi Bob The issue is partly poor behaviour on the part of the script and partly a bug in dotNetRDF. The script you are using isn't sending any accept header which means the array received by the MimeTypesHelper.GetSparqlWriter(String[] ctypes, String, &contentType) function is null and therefore you get your null reference exception. This has now been fixed so that when no accept header is specified SPARQL Handlers default to returning SPARQL XML Results Format. Hopefully your example should now work as desired, let me know if it doesn't. Regards, Rob Vesse ---------------------------------------- From: "Bob DuCharme" <bo...@sn...> Sent: Wednesday, June 16, 2010 12:23 AM To: dot...@li... Subject: [Dotnetrdf-support] "Object reference not set to an instance of an object." When I paste the following URL (which issues a SPARQL query against some RDFa to find the URL of the FOAF file listed there) into a browser, it works great: http://www.dotnetrdf.org/demos/leviathan/?query=PREFIX+foaf%3A+%3Chttp%3A%2F %2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0D%0ASELECT+%3Fpage+WHERE+{%0D%0A++%3Fs+foaf %3Ahomepage+%3Chttp%3A%2F%2Fwww.snee.com%2Fbob%3E+%3B%0D%0A+++++foaf%3Apage+ %3Fpage+.}%0D%0A%0D%0A&default-graph-uri=http%3A%2F%2Fwww.w3.org%2F2007%2F08 %2FpyRdfa%2Fextract%3Furi%3Dhttp%253A%252F%252Fwww.snee.com%252Fbob%26format %3Dpretty-xml%26warnings%3Dfalse%26parser%3Dlax%26space-preserve%3Dtrue%0A&t imeout=10000 Using the LWP::Simple perl library, though, the get() command in my perl script gets the following: Error ----- 1: PREFIX foaf: 2: SELECT ?page WHERE { 3: ?s foaf:homepage ; 4: foaf:page ?page .} 5: Object reference not set to an instance of an object. at VDS.RDF.MimeTypesHelper.GetSparqlWriter(String[] ctypes, String& contentType) at VDS.RDF.Web.BaseSparqlHandler.ProcessResults(HttpContext context, Object result) at VDS.RDF.Web.FileSparqlHandler.ProcessQuery(HttpContext context, String query, List`1 userDefaultGraphs, List`1 userNamedGraphs, Int64 timeout, Boolean partialResults) I get the same if I specify the URL for the file with the RDFa in a FROM clause instead of in the &default-graph-uri parameter. This get() function has successfully retrieved query results from similar services. Does the error message above look familiar to anyone? thanks, Bob ---------------------------------------------------------------------------- -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo _______________________________________________ Dotnetrdf-support mailing list Dot...@li... https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support |