|
From: <Tom...@bt...> - 2015-01-08 16:23:01
|
Hello,
I have a question regarding the usage of dotNetRDF to communicate with Sesame server.
I am receiving the following exception when trying to save a graph into a Sesame server's storage:
"A HTTP error (HTTP 415 Unsupported Media Type) occured while save a Graph to the Store.
Store returned the following error message: Unsupported MIME type: application/ntriples
See aforementioned status line or inner exception for further details"
This is the code which I am using:
SesameServer sesameServer = new SesameServer("http://localhost:8080/openrdf-sesame");
IStorageProvider storage_tsm1 = sesameServer.GetStore("tsm1");
IStorageProvider storage_tsm2 = sesameServer.GetStore("tsm2");
Graph loadedGraph = new Graph();
storage_tsm1.LoadGraph(loadedGraph, "file://archive.ttl");
storage_tsm2.SaveGraph(loadedGraph);
The exception occurs at the last statement.
I have also noticed, that by changing the line 542 in SesameHttpProtocolConnector class in this way:
From: request.ContentType = MimeTypesHelper.NTriples[0];
To: request.ContentType = MimeTypesHelper.NTriples[1];
The exception does not occur and the graph is being saved correctly.
Please tell me if there is a better solution for this exception?
Sesame version: 2.7.14
dotNetRDF version: 1.0.8.0
Best regards
Tomasz Firlej
Junior programmer
[cid:image001.gif@01D02B60.227EE260]
BTC Business Technology Consulting Sp. z o.o.
ul. Małe Garbary 9
61-756 Poznań
Tel. +48 (0) 61 85 60 936
Fax. +48 (0) 61 85 01 870
E-mail: tom...@bt...<mailto:tom...@bt...>
www.btc-ag.com
www.bonapart.pl<http://www.bonapart.pl/>
Sąd Rejonowy Poznań - Nowe Miasto i Wilda w Poznaniu
VIII Wydział Gospodarczy Krajowego Rejestru Sądowego: KRS 0000081161
NIP 778-13-34-313 Kapitał zakładowy: 200.000 PLN
|