From: Iván P. <iva...@gm...> - 2014-12-01 12:02:59
|
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 |