Eclipse for Jena & ARQ
File needed
• Jena-2.5.5 (http://jena.sourceforge.net/downloads.html)
• ARQ-2.2 (http://jena.sourceforge.net/ARQ/download.html)
• Eclipse (http://www.eclipse.org/downloads/)
Part I. Create a java project
1. Open Eclipse and create a new project
2. Select java project
3. Define a project name then click finish
5. Copy lib folder in Jena-2.5.5 to the project folder (the default path is c:\users\{yourname}\workspace\{project name})
6. Copy jena folder in Tutorial folder to src folder under your project folder
7. Right click the project folder in Eclipse and refresh it
Part II. Add library files to project
8. Right click the project folder in Eclipse and select Properties
9. Go to Java Build Path> Libraries
10. Click Add JARs… and select all the jar file in lib folder
11. Click OK to finish adding jar library
Part III. Run Jena Program
12. Select a java program, right click, select Run As> Java Application
Part IV. Run ARQ Program
13. Create a package named arq under folder src of your project folder
14. Copy sparql.java in ARQ-2.2\src\arq folder to the folder you’ve just created
15. Copy vc-db-1.rdf and arq file in the Tutorial folder to your project folder
16. Copy the files in lib folder under ARQ-2.2 folder to lib folder under your project older
17. Refresh the project folder in Eclipse and open sparql.java
18. Right click the sparql.java file and select Run Configurations…
19. Go to Arguments and type “--data vc-db-1.rdf --query arq\q1.rq”
20. Click Apply, Click Run
Bloggers.java
Move Bloggers.java into src folder, it will automatically set up a default package
Move bloggers.rdf into src folder as well
Run Bloggers.java as run configurations
Click Java Application, and select Bloggers
Make sure in your Main, that you are in the right project and right main class
Click run.
Now you can see the result in the Console window
Jena Example: Expert Search
Move expert search java files into src folder, it will automatically set up a default package
Since your expert.owl is stored in mysql, there is no need to move expert.owl into the src folder
Run MainIndividual.java as run configurations
Click Java Application, and select MainIndividual
Make sure in your Main, that you are in the right project and right main class
Click run.
Now you can see the result in the Console window
Jena Example: Family Tree
Move familytree java files into src folder, it will automatically set up a default package
Move family.rdf, family1.nt and family2.nt into src folder as well
Run FamilyModel.java as run configurations
Click Java Application, and select FamilyModel
Make sure in your Main, that you are in the right project and right main class
Click run.
Now you can see the result in the Console window
Data Search Tutorial
Move data files into project folder
Move files in queries folder into project folder
Run Sparql.java as run configurations
Run Sparql.java as run configurations
Get results