Did that. Where is the property file there, containing Connection String to the NSS? A couple of lines with Connect, execute simple query and pick up the result set will get us started. Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That class has everything you need except the initialization of a RemoteRepository object. You need to locate the HTTP endpoint for your NanoSparqlServer, it will look something like this:
This might only be in the dev branch. We are currently prepping that for a release. You can check out the code from SVN and then do "ant war" to generate the WAR artifact.
The database file on the disk is compatible. The WAR contains the server side of the REST interface. You need to update it. You should have only had to apply edits to web.xml and RWStore.properties, so the rest can be safely overwritten.
Bryan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
#
# Note: These options are applied when the journal and the triple store are
# first created.
##
## Journal options.
##
# The backing file. This contains all your data. You want to put this someplace
# safe. The default locator will wind up in the directory from which you start
# your servlet container.
com.bigdata.journal.AbstractJournal.file=bigdata.jnl
# The persistence engine. Use 'Disk' for the WORM or 'DiskRW' for the RWStore.
com.bigdata.journal.AbstractJournal.bufferMode=DiskRW
com.bigdata.btree.writeRetentionQueue.capacity=4000
com.bigdata.btree.BTree.branchingFactor=128
# 200M initial extent.
com.bigdata.journal.AbstractJournal.initialExtent=209715200
com.bigdata.journal.AbstractJournal.maximumExtent=209715200
##
## Setup for QUADS mode without the full text index.
##
com.bigdata.rdf.sail.truthMaintenance=false
com.bigdata.rdf.store.AbstractTripleStore.quads=true
com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=false
com.bigdata.rdf.store.AbstractTripleStore.textIndex=false
com.bigdata.rdf.store.AbstractTripleStore.axiomsClass=com.bigdata.rdf.axioms.NoAxioms
#com.bigdata.rdf.store.AbstractTripleStore.inlineDateTimes=true
In this case, I ran the NanoSparqlServer main() routine with the following command line arguments rather than running against a tomcat instance:
8080 kb RWStore.properties
Since you are running inside of tomcat, please verify that there are no errors in the relevant log files for your installation.
Thanks,
Bryan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
So, I downloaded .WAR file from https://sourceforge.net/projects/bigdata/files/latest/download, uploaded it to Tomcat 7 and validated it via.http://localhost:8080/bigdata/sparql.
Now I need to run SPARQL queries from a simple Java program. Does anyone have "Hello World" example or Quick Start how-to?
Many thanks,
Clova
Check out com.bigdata.rdf.sail.webapp.TestNanoSparqlClient and see if that helps.
Did that. Where is the property file there, containing Connection String to the NSS? A couple of lines with Connect, execute simple query and pick up the result set will get us started. Thanks.
That class has everything you need except the initialization of a RemoteRepository object. You need to locate the HTTP endpoint for your NanoSparqlServer, it will look something like this:
http://localhost:80/bigdata/sparql
Use that to initialize the RemoteRepository and you're good to go. Also see here:
https://sourceforge.net/apps/mediawiki/bigdata/index.php?title=NanoSparqlServer
Thank you, mrpersonick. Will do as you suggest and report.
Clove
com.bigdata.rdf.sail.webapp.client.RemoteRepository is not in the NSS .war file. Where can I download client package from?
WEB-INF/lib/bigdata-1.2.2.jar
This might only be in the dev branch. We are currently prepping that for a release. You can check out the code from SVN and then do "ant war" to generate the WAR artifact.
Bryan
https://bigdata.svn.sourceforge.net/svnroot/bigdata/branches/BIGDATA_RELEASE_1_2_0 (this is the current dev branch)
OK. Will do just that and report.
Question. Can I mix the client from the DEV release 1.2.0 with the WAR that I installed and validated yesterday on Tomcat 7?
The database file on the disk is compatible. The WAR contains the server side of the REST interface. You need to update it. You should have only had to apply edits to web.xml and RWStore.properties, so the rest can be safely overwritten.
Bryan
Almost there…. Ran com.bigdata.gom.Example1 (renamed to Example11). Connected to the server OK, but received "404" as a response:
Exception in thread "main" java.lang.RuntimeException: query=PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT {
?u a foaf:Person .
?u foaf:knows ?v .
?u rdfs:label ?name .
}
WHERE {
?u a foaf:Person .
?u foaf:knows ?v .
OPTIONAL { ?u rdfs:label ?name } .
} LIMIT 100
at com.bigdata.gom.om.NanoSparqlObjectManager.evaluateGraph(NanoSparqlObjectManager.java:127)
at test.Example11.call(Example11.java:51)
at test.Example11.main(Example11.java:111)
Caused by: com.bigdata.rdf.sail.webapp.client.HttpException: Status Code=404, Status Line=HTTP/1.1 404 Not Found, Response=<html><head><title>Apache Tomcat/7.0.37 - Error report</title><style><!-H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}-></style> </head><body><h1>HTTP Status 404 - /sparql/</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>/sparql/</u></p><p><b>description</b> <u>The requested resource is not available.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.37</h3></body></html>
at com.bigdata.rdf.sail.webapp.client.RemoteRepository.checkResponseCode(RemoteRepository.java:1361)
at com.bigdata.rdf.sail.webapp.client.RemoteRepository$GraphQuery.evaluate(RemoteRepository.java:957)
at com.bigdata.gom.om.NanoSparqlObjectManager.evaluateGraph(NanoSparqlObjectManager.java:119)
… 2 more
Verified namespace = "kb"
I am not sure what problem you are encountering. I just ran Example1 from SVN against a NSS instance:
Here is the output of Example1:
Here is the RWStore.properties file:
In this case, I ran the NanoSparqlServer main() routine with the following command line arguments rather than running against a tomcat instance:
Since you are running inside of tomcat, please verify that there are no errors in the relevant log files for your installation.
Thanks,
Bryan
I ran NSS on Tomcat 7 over Windows. I am going to recompile the DEV branch and re-deploy it on a less restrictive network, but also onto Window 7.
ETD is Sunday. Will report when done.
Many thanks,
Clove