Simple OSLC Reference Implementation
DOCUMENT UNDER CONSTRUCTION
This document gives you a quick overview of the Simple OSLC Reference Implementation (SORI), explain how SORI is organized and how to build and run the code.
What is SORI?
SORI is a simple, bare-bones reference implementation of the OSLC specifications. It is written in Java as a standard Java EE web applications. It is intended to help those who are adopting OSLC by providing a functioning system that can be explored via a simple UI and REST services, or by taking a look at the source code.
SORI architecture
The bullets below give a summary of the SORI architecture:
- Written in Java as standard Java EE web application
- Major dependencies:
- Java Servlet API
- Java Server Pages (JSP)
- Open RDF / Sesame RDF parser and triple-store
- ANTLR parser generator
- Maven build system
- Organized into two Web Applications that both share common components
- Organized into these modules
- sori-core: Core implementation Java classes (packaged as JAR)
- sori-am: Architecture Management Java classes (packaged as JAR)
- sori-cm: Change Management Java classes (packaged as JAR)
- sori-template-webapp: Common parts of OSLC web application (packaged as WAR)
- sori-am-webapp: The SORI-AM Web Application (packaged as WAR)
- sori-cm-webapp: The SORI-CM Web Application (packaged as WAR)
We choose to use a very minimal set of dependencies for SORI because we want it to be really simple. The web parts of SORI are implemented with only the Servlet API and JSP pages. For simplicity's sake, there is no webapp framework, no Dojo and no OSGI.
- For RDF, we choose to use OpenRDF? / Sesame over Jena because it seemed easier to work with.
- For the build, we choose Maven for these reasons:
- Allows developers to very easily build and run SORI with any IDE or no IDE at all, i.e. via command-line
- Allows us to pull in dependencies at build-time and we do not have to store or distribute any 3rd party jars
- Maven is very well known and supported, it is the de facto standard build system for Java based open source software
Areas for improvement We've discussed the following ideas for SORI development in 2011:
- Support for all OSLC domains
- Complete support of OSLC Query Syntax
- Make SORI a consumer as well as an OSLC provider
- User management
- Better UI via CSS, JavaScript? , etc.
- Hosting SORI on a public site, data wiped clean nightly
- Binary releases, with bundled Jetty so its unzip and run to get going
Building and running SORI
These steps lead you through the process of getting the SORI code, building it and running it via command-line or IDE.
First, verify that you have the necessary prerequisites. You will need the following things on your computer to build and run SORI:
- Java 1.6 - if you're a Java developer, you probably already have this on your machine
- http://subversion.tigris.org/? - even if your IDE does include Subversion support
- http://maven.apache.org/download.html? - but only if your IDE does not include Maven support
If you've got Eclipse 3.6 with the Subclipse Subversion plugin and the
M2Eclipse? Maven plugin, then you are all set and do not need to download anything to get started with SORI.
STEP 2: Get the SORI source code
The best way to get the code is via the SVN client because the Maven m2eclipse plugin's SCM import feature is broken (see
https://issues.sonatype.org/browse/MNGECLIPSE-2596? ). To get the code, do the following:
Once that operation is complete, you have everything you need to build and run SORI.
STEP 3: Build & run via command-line (option one)
If you are willing to use the command-line, then don't need an IDE to build and run SORI.
Before you do this, you will have to have Maven 3 installed on your computer. After you install Maven 3, make sure that Maven is in your path. Enter the Maven comamnd 'mvn -v' to verify that Maven is indeed installed and you should see something like this:
$ mvn -v
Apache Maven 3.0 (r1004208; 2010-10-04 07:50:56-0400)
Java version: 1.6.0_22
Java home: /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
Default locale: en_US, platform encoding: MacRoman
OS name: "mac os x" version: "10.6.6" arch: "x86_64" Family: "mac" $
Build via command-line
Use the top-level SORI to build everything in one shot, like so:
cd sori
mvn install
Run via command-line
After you have built things, you can run SORI.
To run the SORI AM server:
cd sori-am-webapp
mvn jetty:run-exploded
Once you've done that you can navigate to
http://localhost:8080/sori-am to use the SORI AM implementation. You can kill it with CNTRL-C.
To run the SORI CM server:
cd sori-cm-webapp
mvn jetty:run
Once you've done that you can navigate to
http://localhost:8080/sori-cm to use the SORI CM implementation. You can kill it with CNTRL-C.
STEP 4: Building and run via Eclipse (option two)
To build an run SORI via Eclipse you need to have Maven 3 installed and the Maven Eclipse plugin m2eclipse.
- One configuration that will work is Eclipse 3.6 and m2eclipse from the following update site:
Build via Eclipse
Step 4.1: Import the SORI projects into Eclipse
Open up Eclipse and use the sori_trunk directory as your Eclipse Workspace.
Use the Import facility provided by the Maven plugin to load the SORI projects into Eclipse:
Step 4.2: Build the SORI project via Eclipse
Go to the "sori" project and find the pom.xml file there. Right-click on the pom.xml file and run as Maven Install.
Once that operation complete, SORI is built and ready to run.
Run via Eclipse
Step 4.3: run SORI AM via Eclipse
To run SORI AM in Eclipse:
NOTE: If you make a change in a project, e.g. sori-core, you must do a mvn install on that project before you attempt to run, otherwise your changes will not be picked up. We're working to fix this.
- Ceate an Eclipse Run->Run Configurations... Launcher using the Maven Build option
- On the Main tab:
- Set the Workspace to ${workspace_loc:/sori
- Set the Goals to jetty:run-war
- Set the Profiles to sori-am
- Check the Non-Recursive check-box
- On the JRE tab:
- In the VM arguments, set property realpath to -D${workspace_loc}/sori-am-webapp/target/sori-am
- Hit the Run button to start SORI and Jetty
This screenshot shows the settings on the Main tab:
This screenshot shows the settings on the JRE tab:
Once you've done that you can navigate to
http://localhost:8080/sori-am to use the SORI AM implementation.
Step 4.3: run SORI CM via Eclipse
- Ceate an Eclipse Run->Run Configurations... Launcher using the Maven Build option
- On the Main tab:
- Set the Workspace to ${workspace_loc:/sori
- Set the Goals to jetty:run-war
- Set the Profiles to sori-cm
- On the JRE tab:
- In the VM arguments, set property realpath to -D${workspace_loc}/sori-cm-webapp/target/sori-cm
- Hit the Run button to start SORI and Jetty
See the screenshots above for examples.
Once you've done that you can navigate to
http://localhost:8080/sori-cm to use the SORI CM implementation.