From: Rob V. <rv...@do...> - 2014-12-01 12:32:27
|
Ivan Please note this is a subscription based list, I have moderated your email through and explicitly CC'd you on this reply this time but please subscribe at https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop if you would like to send further emails You have not done anything obviously wrong. The error you get implies that the store in question is not responding with a valid content type for the query. You can enable the HTTP debugging feature - https://bitbucket.org/dotnetrdf/dotnetrdf/wiki/HowTo/Debug%20HTTP%20Communic ation.wiki#!debugging-http-communication - to see the HTTP headers being received (they are printed to the Debug console) which would be helpful to see what content type Brightstar is responding with. Rob From: Iván Palomares <iva...@gm...> Reply-To: dotNetRDF Developer Discussion and Feature Request <dot...@li...> Date: Monday, 1 December 2014 12:02 To: <dot...@li...> Subject: [dotNetRDF-Develop] connecting to a BrighstarDB store from dotnetRDF > Hi, > I'm currently trying to make a first connection from a .NET project with > dotnetRDF, to a BrightstarDB remote endpoint in which I have a triplestore. > The code I use is quite simple, just try to connect and execute a "trival" > SPARQL query, as follows (<IP>, <PORT> and <STORE_NAME> stand for the existing > address > and triplestore name I want to access): > > namespace ConsoleApplication3 > { > class ReadFromBrightstarDB > { > static void Main(string[] args) > { > //Create a connection to BrightstarDB SPARQL Query endpoint > SparqlConnector connect = new SparqlConnector(new > Uri("http://<IP>:<PORT>/brightstar/<STORE_NAME>")); > PersistentTripleStore store = new PersistentTripleStore(connect); > > Object results = store.ExecuteQuery("SELECT * WHERE {?s ?p ?o}"); > if(results is SparqlResultSet) > { > //Print out the results > SparqlResultSet rset = (SparqlResultSet)results; > foreach (SparqlResult result in rset) > { > Console.WriteLine(result.ToString()); > } > } > > } > } > } > When executing, I obtain an exception entitled "RDFParseException was > unhandled", with the following description: > > An unhandled exception of type 'VDS.RDF.Parsing.RdfParseException' occurred in > dotNetRDF.dll > Additional information: Unable to Parse a SPARQL Result Set from the provided > XML since the Document Element is not a <sparql> element! > > Any help would be appreciate, I'm quite new to .NET in general and > BrightStarDB as well as to SparQL, so maybe there is a very silly issue here > but I couldn't find it yet. > Thanks! > Iván > ------------------------------------------------------------------------------ > 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-develop mailing list > dot...@li... > https://lists.sourceforge.net/lists/listinfo/dotnetrdf-develop |