I currently work on a project that requires me to insert and query data to a graph hosted on a Apache Jena Fuseki triple store. I am however unable to connect to said store. So far i tried two different methods:
Method 1
store = new FusekiStore("triplestore.project.customer.de", "Datasetname", "User", "fusekiPassword");
_model = store.GetModel(new Uri("https://triplestore.project.customer.de/Datasetname/"));
when using this method the store
is created an when debugging shows store.IsReady = true
. _model
is also created, however upon inspection i see _model.IsEmpty
throws System.UriFormatException
. I do get the same exception when calling _model.CreateResource<T>(new Uri("https://triplestore.project.customer.de/Datasetname/" + id))
Method 2
var cred = new NetworkCredential("User", fusekiPassword);
store = StoreFactory.CreateSparqlEndpointStore(new Uri("https://triplestore.project.customer.de/Datasetname/data"), null, cred);
_model = store.GetModel(new Uri("https://triplestore.project.customer.de/Datasetname/"));
Once again the store
is created, however store.IsReady
throws a System.NotImplementedException
.
Ignoring that, i continue trying to create an resouce: _model.CreateResource<T>(new Uri("https://triplestore.project.customer.de/Datasetname/" + id))
. This time i get a
VDS.RDF.Query.RdfQueryException: "A HTTP Error occurred while trying to make the SPARQL Query, see inner exception for details
InnerException {"The remote server returned an error: (400) Bad Request."} System.Exception {System.Net.WebException}
Question
Which is the correct method, to connect to a Fuseki Store using Trinity RDF and how is it done?
Thanks a lot.