I want to create a simple RDF graph and then try simple querying using SPARQL. Since I'm familiar with java and net beans, I want to use Apache Jena on NetBeans. I downloaded the related files from http://www.apache.org/dist/jena/ .
What should I do next to write RDF codes on net beans? ie Should I install something or add lib files/jar files somewhere?
(Too long for a comment on Ian's reply)
Maven is easy on netbeans, and a good way to get started with everything you need (as Ian says). Here's a quick guide to start a jena project:
File -> New Project
. Choose Maven
then Java Application
. Finish
. Dependencies
, choose Add Dependency...
. org.apache.jena
as the Group ID, jena-core
(or jena-arq
if you want SPARQL) as the Artifact ID, and 2.10.1
as the Version. Dependencies
folder. It ought to have a number jars present -- these are jena and its required jars. You might need to right-click on Dependencies
again and choose Download Declared Dependencies
to ensure jena is ready for use. Source Packages
you'll find App.java
. Try some of the simple jena api tutorials and try running them. You need to put the .jar
files from the Jena distribution where Netbeans will find them. I don't know Netbeans, but in Eclipse I might have a lib directory in my project top-level directory, and then set the Eclipse's project classpath to include each of those .jar
files. Netbeans I'm sure has something similar .
Actually what I do in Eclipse is not use downloaded jars at all, but I would use Maven to manage the dependencies for me. So I would create a pom.xml
file in my project folder that stated that, among other things, my project depends on Jena, and then Maven takes care of downloading the dependencies for me. Eclipse and Maven work well together; I'd hope the same would be true of Netbeans. Setting up Maven to use Jena is described on the Jena site . However, learning Maven can be a bit of a steep curve, so if you're not ready to take that on just yet then downloading the .jar
files to a project lib directory is the way to go.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.