I just started working with Fuseki and Jena. I have an ontology and I want to allow HTTP clients to send SPARQL requests and get the result. Here is the code I have in order to achieve that:
// testing Fuseki
Dataset dataset = RDFDataMgr.loadDataset("src/main/resources/files/test.owl");
FusekiEmbeddedServer server = FusekiEmbeddedServer.create()
.setPort(3332)
.add("/ds", dataset, true)
.build() ;
server.start() ;
The Fuseki web server is working fine and I can send queries and get their results using a web browser.
The problem is whenever I try to use a prefix defined in the .owl file I get an error.
Basically here is a simple request I want to send: http://localhost:3332/ds?query=SELECT ?test WHERE {?test ssn:observes ?o}
At the moment I get this error:
Error 400: Parse error:
SELECT ?test WHERE {?test ssn:observes ?o}
Line 1, column 27: Unresolved prefixed name: ssn:observes
I know for sure the ssn
prefix does exist in the .owl
file.
Is there a way I can get this request to work, knowing that I don't have access to Fuseki configuration file as I'm only using it through Java?