I have a question for you.
I have a triplestore "Jena TDB" and I have read that I can set up a SPARQL endpoint for locally stored RDF data. In particular, I saw that in the literature together with Jena TDB is used Fuseki. I loaded my files rdf in Jena TDB in this way:
public void store(){
String directory = "C:\\tdb";
String source = "C:\\file1.rdf";
String source1 = "C:\\file2.rdf";
Dataset dataset = openTDB(directory);
Model tdb = loadModel(source, dataset);
dataset.addNamedModel("File1", tdb);
Model tdb1 = loadModel(source1, dataset);
dataset.addNamedModel("File2", tdb1);
tdb.close();
tdb1.close();
dataset.close();
}
public Dataset openTDB(String directory){
// open TDB dataset
Dataset dataset = TDBFactory.createDataset(directory);
return dataset;
}
public Model loadModel(String source, Dataset dataset){
Model tdb = ModelFactory.createDefaultModel();
FileManager.get().readModel( tdb, source, "RDF/XML" );
return tdb;
}
I am reading the Fuseki documentation on Apache site and this post Desktop SPARQL client for Jena (TDB)?, but I have the problem.
In particular, I have downloaded Fuseki distribution and unzipped it. Then, I opened the command prompt and I went to the folder where I unzipped fuseki. Then, I launched this command:
fuseki-server --update --mem /C://TDB
and I opened the browser on localhost:3030 address. On the browser, I can choose the dataset (in the case C://TDB) and I can launch my query, for example:
select * {graph ; { ?s ?p ?o }}
The query result is:
Error 404: Not Found
Why? What am I doing wrong?
On Desktop SPARQL client for Jena (TDB)? post, I have read that I have to run the command:
java -jar fuseki-0.1.0-server.jar --update --loc data /dataset
but I don't understand who are data and dataset. In my case, how I can know this values? Is this my error?
You are right in that you haven't understood the intent of each argument. With your command what you've done is create an empty in-memory dataset and assign it the dataset path
/C://TDB
which is almost certainly not what you intended.The
--loc
argument is used to pass in the path to a directory containing a TDB database while the/dataset
path is the dataset path you want to use to access it via FusekiSo for example you might do the following:
Note That I've used
VER
as a placeholder for the Fuseki version here since that value will depend on which version of Fuseki you have downloaded. For reference at time of writing this answer the latest version is1.0.2
This command launches Fuseki against the TDB database located in
/path/to/database
with the dataset path of/ds
. Therefore you can point your chosen SPARQL client athttp://localhost:3030/ds/query
to make queries orhttp://localhost:3030/ds/update
to make updates.If you are running on Windows (which appears to be the case from your question) then you would do the following:
Which launches Fuseki against the TDB database located in
C:\TDB
with the dataset path of/ds
so the same URLs as the previous example would apply.then type
at last open a browser and type
remember you must first declear the enviorment verible(located in system poperties then advance tab) and edit variable name call "Path" in the "System verible" to