|
From: Iván P. <iva...@gm...> - 2014-12-01 16:29:02
|
Hi,
Thanks to all who are trying to help with this question. In order to try to
find out the source of the problem, I replaced the code where the SparQL
query is executed and shown, by something simple in which I attempt to
obtain the graphs in the triplestore ans show its URIs.
* //Create a connection to BrightstarDB SPARQL Query endpoint*
* SparqlConnector connect = new SparqlConnector(new
Uri("http://<IP>:8090/brightstar/<STORE>"));*
* PersistentTripleStore store = new
PersistentTripleStore(connect);*
* IEnumerable<Uri> graphs = connect.ListGraphs();*
* foreach (Uri uri in graphs)*
* {*
* Console.WriteLine(uri.ToString());*
* }*
Now I obtain a new exception in the ListGraphs() line, a
RdfStorageException being unhandled:
An unhandled exception of type 'VDS.RDF.Storage.RdfStorageException'
occurred in dotNetRDF.dll
Additional information: An unexpected error occurred while listing Graphs
from the Store. See inner exception for further details
This makes me thing that perhaps the source of the problem is not in the
previous query itself, but rather somewhere before, in the connection
settings? Maybe the classes SaprqlConnector and the PersistentTripleStore
as a wrapper, are not the appropriate choice to connect to a BrightstarDB
triplestore?
Also, to give you more info, my triplestore has been directly imported into
BrightstarDB from a .owl file that was previously generated from an
ontology in Protegé. The importation process in BrightstarDB was done with
a management tool called Polaris it seemingly was all done correctly,
according to the output I received when I imported it.
Kind regards,
Iván
2014-12-01 12:02 GMT+00:00 Iván Palomares <iva...@gm...>:
> 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
>
|