From: Frank S. <fs...@in...> - 2014-12-01 13:54:36
|
Hey Rob, > Do you have a complete stack trace from the case where it fails? sure: System.UriFormatException: Ungültiger URI: Das URI-Format konnte nicht bestimmt werden. bei System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind) bei System.Uri..ctor(String uriString) bei VDS.RDF.UriFactory.Create(String uri) bei VDS.RDF.Parsing.SparqlJsonParser.ParseBoundVariable(SparqlJsonParserContext context, String var, SparqlResult r, Boolean headSeen) bei VDS.RDF.Parsing.SparqlJsonParser.ParseBinding(SparqlJsonParserContext context, Boolean headSeen) bei VDS.RDF.Parsing.SparqlJsonParser.ParseBindings(SparqlJsonParserContext context, Boolean headSeen) bei VDS.RDF.Parsing.SparqlJsonParser.ParseResults(SparqlJsonParserContext context, Boolean headSeen) bei VDS.RDF.Parsing.SparqlJsonParser.ParseBody(SparqlJsonParserContext context) bei VDS.RDF.Parsing.SparqlJsonParser.ParseResultSetObject(SparqlJsonParserContext context) bei VDS.RDF.Parsing.SparqlJsonParser.Parse(TextReader input, ISparqlResultsHandler handler) bei VDS.RDF.Parsing.SparqlJsonParser.Load(ISparqlResultsHandler handler, TextReader input) bei VDS.RDF.Parsing.SparqlJsonParser.Load(ISparqlResultsHandler handler, StreamReader input) bei VDS.RDF.Query.SparqlRemoteEndpoint.QueryWithResultSet(ISparqlResultsHandler handler, String sparqlQuery) bei VDS.RDF.Query.SparqlRemoteEndpoint.QueryWithResultSet(String sparqlQuery) > UriFormatException implies there is some invalid data somewhere, the fact > that you are using SparqlRemoteEndpoint suggests that the remote server > may be returning some bad data that we can't process though this should > probably not manifest as a UriFormatException directly but as a > RdfParseException if this is the case. From the results I get through the html-interface, I can't see any stange data. Here is a request that fails and doesn't try to get all data: PREFIX mbo: <http://creativeartefact.org/ontology/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT * WHERE {?uri a mbo:Artist. ?uri rdfs:label ?label. OPTIONAL {?uri mbo:disambiguation ?dis}. OPTIONAL {?uri mbo:annotation ?ann}. } You might also test it via http://creativeartefact.org/sparql > As for why POST versus non-POST would make a difference I do not know, I > will try and take a proper look later today. That would be great :) > Note that SparqlRemoteEndpoint will automatically change to POST when a > query is above a certain length regardless of the explicit setting, the > explicit setting is mostly useful just to force a POST in all cases. Hm, really? A while ago, I got an error, when a Sparql-Query was too long and I solved it by manually setting the http-mode. But maybe this was due to another reason than the length of the statement? If there is more information I can provide to pinpoint the problem, just let me know! Thanks, Frank > Rob > > On 01/12/2014 12:14, "Frank Schumacher" <fs...@in...> > wrote: > >> Hello again, >> >> I narrowed it down a bit more, the error seems to happen, when the >> endpoint is set to POST: >> >> SparqlRemoteEndpoint endpoint = new SparqlRemoteEndpoint(new >> Uri("http://creativeartefact.org/sparql"), >> "http://creativeartefact.org/"); >> endpoint.HttpMode = "POST"; >> >> SparqlResultSet sparqlResults = endpoint.QueryWithResultSet("PREFIX mbo: >> <http://creativeartefact.org/ontology/> PREFIX rdfs: >> <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT * WHERE {?uri a >> mbo:Organiser. ?uri rdfs:label ?label. OPTIONAL {?uri mbo:city ?city}. >> OPTIONAL {?uri mbo:street ?street}. OPTIONAL {?uri mbo:postalcode >> ?postalcode}. }"); >> >> SparqlResultSet sparqlResults = endpoint.QueryWithResultSet("SELECT * >> WHERE {?uri ?label ?city.}"); >> >> The first statement executes, but the second throws the error. When >> commenting out the line endpoint.HttpMode = "POST"; - also the second >> one executes. >> >> As my statements can get rather long, I need post to make sure the >> SPARQL request doesn't exceed the allowed length for GET. Any idea, how >> to solve this problem? >> >> Thanks in advance, >> Frank >> >> #Am 28.11.2014 18:03, schrieb Frank Schumacher: >>> I made some more tests and it is getting even stranger. I tried more >>> test queries and even the simplest ones fail. For testing, I made two >>> call. The first one works, the second raises the error. When I try to >>> step into it with F11, it tells me: >>> >>> Aufruflistenort (callstackposition?): >>> >>> VDS.Common.dll!VDS.Common.Tries.AbstractTrie<string,char,System.Uri>.Move >>> ToNode(string >>> key) Zeile 211 >>> >>> Here is the line that works: >>> SparqlResultSet sparqlResults = args.Endpoint.QueryWithResultSet("PREFIX >>> mbo: <http://creativeartefact.org/ontology/> PREFIX rdfs: >>> <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT * WHERE {?uri a >>> mbo:Organiser. ?uri rdfs:label ?label. OPTIONAL {?uri mbo:city ?city}. >>> OPTIONAL {?uri mbo:street ?street}. OPTIONAL {?uri mbo:postalcode >>> ?postalcode}. }"); >>> >>> and here the one that raises the error: >>> SparqlResultSet sparqlResults = args.Endpoint.QueryWithResultSet("SELECT >>> * WHERE {?uri ?label ?city}"); >>> >>> I'm really puzzled ... >>> >>> Ciao, >>> Frank >>> >>> Am 28.11.2014 17:08, schrieb Frank Schumacher: >>>> Hello Rob, >>>> >>>> I get a really strange UriFormatException (Ungültiger URI: Das >>>> URI-Format konnte nicht bestimmt werden.) when calling >>>> SparqlRemoteEndpoint.QueryWithResultSet with the following query: >>>> >>>> PREFIX mbo: <http://creativeartefact.org/ontology/> PREFIX rdfs: >>>> <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT ?uri ?label >>>> ?dis >>>> ?ann WHERE {?uri a mbo:Artist. ?uri rdfs:label ?label. OPTIONAL {?uri >>>> mbo:disambiguation ?dis}. OPTIONAL {?uri mbo:annotation ?ann}. } >>>> >>>> With a similar query, I don't get any error: >>>> >>>> PREFIX mbo: <http://creativeartefact.org/ontology/> PREFIX rdfs: >>>> <http://www.w3.org/2000/01/rdf-schema#> SELECT DISTINCT * WHERE {?uri a >>>> mbo:Organiser. ?uri rdfs:label ?label. OPTIONAL {?uri mbo:city ?city}. >>>> OPTIONAL {?uri mbo:street ?street}. OPTIONAL {?uri mbo:postalcode >>>> ?postalcode}. } >>>> >>>> When running the problematic query in the browser-frontend of my >>>> sparql-endpoint, I get the results as expected. Any idea, where the >>>> problem might be? >>>> >>>> Ciao, >>>> Frank >>>> >>> >>> >> >> >> -- >> ************************************************ >> * Universität Leipzig, Institut für Informatik * >> * Abteilung Betriebliche Informationssysteme * >> * http://bis.informatik.uni-leipzig.de * >> * Tel.: 0341 / 97 32 256 * >> * * >> * ========== Opera Metal: molllust =========== * >> * http://www.molllust.com * >> * M'era Luna Newcomer 2013! * >> ************************************************ >> >> -------------------------------------------------------------------------- >> ---- >> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server >>from Actuate! Instantly Supercharge Your Business Reports and Dashboards >> with Interactivity, Sharing, Native Excel Exports, App Integration & more >> Get technology previously reserved for billion-dollar corporations, FREE >> http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clkt >> rk >> _______________________________________________ >> dotNetRDF-Support mailing list >> dot...@li... >> https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support > > > > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk > _______________________________________________ > dotNetRDF-Support mailing list > dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-support > -- ************************************************ * Universität Leipzig, Institut für Informatik * * Abteilung Betriebliche Informationssysteme * * http://bis.informatik.uni-leipzig.de * * Tel.: 0341 / 97 32 256 * * * * ========== Opera Metal: molllust =========== * * http://www.molllust.com * * M'era Luna Newcomer 2013! * ************************************************ |