On 18/06/12 07:16, Don S wrote:
Hi,
Thanks a lot and its working here is my script.
#!/bin/bash
echo "TDB Setting path"
export TDBROOT=/home/Rex/jena-tdb-0.9.0-incubating
export PATH=$PATH:$TDBROOT/bin
cd bin
./tdb_path
./tdb_init
cd ..
echo "Entering Fuseki Server"
cd fuseki-0.2.3/
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Executing the TDB for Upload"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
java -Xmx1200M -classpath "../lib/*;" tdb.tdbloader --loc ./TD
./pages/search.owl
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have a general doubt regarding my ontology file access. Previously my
fuseki server directory location was D:\Fuseki. From their I called the
start.bat file to run the server.
ie. " java -Xmx1200M -jar fuseki-server.jar --update
--loc=D:/fuseki-0.2.2/TD /ds2"
This time I put the Fuseki and TDB directory inside " D:\cygwin\home\Rex\."
And run the Fuseki server by entering start.bat (new location
D:/cygwin/home/Rex/jena-tdb-0.9.0-incubating/fuseki-0.2.3/start.bat)
ie. "java -Xmx1200M -jar fuseki-server.jar --update
--loc=D:/cygwin/home/Rex/jena-tdb-0.9.0-incubating/fuseki-0.2.3/TD /ds2"
Even though I am running the server from the new location, it is not taking
search.owl file from the new directory (
"D:\cygwin\home\Rex/jena-tdb-0.9.0-incubating\fuseki-0.2.3\pages\search.owl)
rather it is taking from the previous configuration directory ie,
D:\fuseki-0.2.2\pages\search.owl in my eclipse application. I gave refresh
option in the eclipise main menu. But still not taking the owl file from
the new location.If I stop the fuseki server and then run it will shows
"File: http://localhost:3030/TD not found".
It's called /ds2 to HTTP.
I am wondering why it is not
taking the file from the right location rather than going to the older
version of the owl file.
Fuseki looks in pages/ in the current directory fro where it's run.
Better to cd to the installation directory and then run Fuseki.
If you are using a browser, then maybe you old location shows because
it's cached by the browser.
Andy
Also If I execute the tbloader script continuesly for two or three times ,
will it affect the graph representation inside the TDB.
Thank you If some one can clarify my doubts.
Execution Code
static final String inputFileName1 = "http://localhost:3030/";
public static void main(String[] args) throws IOException{
Model model =ModelFactory.createOntologyModel();
// use the FileManager to find the input file
InputStream in = FileManager.get().open(inputFileName1);
if (in == null) {
throw new IllegalArgumentException( "File: " + inputFileName1 +
" not found");
}
model.read(inputFileName1+"search.owl");
String tt= "Paul";
String queryString ="PREFIX owl:<
http://localhost:3030/ds2/search.owl#>\r\n" +
"PREFIX xsd:<http://www.w3.org/2001/XMLSchema#>\r"+
"INSERT DATA" +
"{"+
"<http://localhost:3030/ds2/search.owl#name5>\n" +
"owl:hasFirstname \"" + tt + "\"^^ xsd:string;"
+
"}";
String queryString1 =
"PREFIX owl:<http://localhost:3030/ds2/search.owl#>" +
"SELECT * "+
"WHERE"+
"{"+
"?Person owl:hasFirstname ?hasFirstname." +
"}";
GraphStore gs=GraphStoreFactory.create(model);
gs.setDefaultGraph(model.getGraph());
UpdateRequest ur = UpdateFactory.create(queryString);
UpdateExecutionFactory.createRemote(ur,"
http://localhost:3030/ds2/update");
UpdateAction.execute(ur,gs);
// search part
Query query = QueryFactory.create(queryString1);
QueryExecution qe = QueryExecutionFactory.create(query, model);
ResultSet results = qe.execSelect();
ResultSetFormatter.out(System.out, results, query);
FileOutputStream fileour =new FileOutputStream("c:/search.owl");
model.write(fileour,"RDF/XML-ABBREV");
qe.close();
}
}
Regards
On Sun, Jun 17, 2012 at 3:19 AM, Andy Seaborne<[email protected]> wrote:
On 16/06/12 11:08, Don S wrote:
HI,
I modified the bin/tdb_init file by removing
-server.JVM_ARGS=${JVM_ARGS:--**Xmx1200M}. When I run the program
I received the same error as
http://superuser.com/**questions/286388/tdbloader-on-**cygwin-java-lang-*
*noclassdeffounderror<http://superuser.com/questions/286388/tdbloader-on-cygwin-java-lang-noclassdeffounderror>
.
So I modified the tdb_init file as
SEP=':'
if [ "$OSTYPE" = "cygwin" ]
then
SEP=';'
fi
and run these commands in cygwin editor Rex@Rex~/jena-tdb-0.9.0-**
incubating/bin
./tdb_path
./tdb_init
source tdb_init
echo $TDB_CP
What does that print?
Again I received the same error. My previous java version was jdk1.6.0_12
and jre6. I re-installed to jdk1.7.0_05 and jre7.
This time I got the error with out mentioning the " caused by ...
??
Rex@Rex ~/jena-tdb-0.9.0-incubating/**fuseki-0.2.3
$ tdbloader --loc ./TD ./pages/search.owl
Error: Could not find or load main class tdb.tdbloader
Try printing the classpath at the point java is executed. It looks like
your changes are not affecting the calculated classpath.
Is it because of my java installation or TDB.
Kindly give a solution to solve this.
Regards
You can run the program with
java -Xmx1200M -cp 'lib\*;' tdb.tdbloader .......
(I think it's 'lib\*;' for windows)
where "lib" has all the jars.
Andy