dbpedia/lookup — pull request #1 by matth (2013-01-04 15:04:39+00:00)
Title: Add JSON support and domain objects, update pom dependencies and some refactoring

## Update pom.xml dependencies

* maven-scala-plugin is deprecated in favour of maven.scala-maven-plugin
* scala-tools.org repo is deprecated in favour of oss.sonatype.org
* Remove maven-compiler-plugin
* Remove commons-lang
* Add maven-scalatest-plugin
* Add maven-resources-plugin
* Add net.liftweb.lift-json
* Add ch.qos.logback.logback-classic
* Add com.sun.jersey.jersey-client (test scope only)

## Refactor Server and Lookup Resource code

* Server now returns application/json with correct Accept header
* Server port configurable via a system property
* Make the legacy .asmx part of the URL optional
* Refactor LookupResource to remove duplication and take more advantage of jersey's dependency injection
* Decouple relationship between LookupResource and Server object (using DI provider, now no need to call Server.searcher)

## Extend Result domain objects

I have extended the object graph returned by the Searcher, this now models concepts such as
Categories, OntologyClasses, etc as Scala objects rather than Strings. This was useful as I have
started using the lookup codebase from other Scala projects and allows for better interaction with the
data.

* src/main/scala/org/dbpedia/lookup/entities/Entities.scala
* src/test/scala/org/dbpedia/lookup/entities/EntitiesTest.scala

## Refactor Result XML serialization and add JSON serialization

I refactored the XML serialization to use Scala's built in XML handling. This is type safe and compiler
checked so less error prone. It also removes the need for the commons-lang dependency. I have also
added JSON serialization via the lift-web json library.

* src/main/scala/org/dbpedia/lookup/entities/EntitiesSerialization.scala
* src/test/scala/org/dbpedia/lookup/entities/EntitiesSerializationTest.scala

## Add Scala test

I have added a couple of unit / integration test scenarios. The most useful is probably the full
integration test which starts with some raw ntriples, builds a small index then uses the Jersey
client over HTTP to interogate an embedded server.

* src/test/scala/org/dbpedia/lookup/IntegrationTest.scala

## Add logging via Logback

I replaced the System.err.println calls with a Logback logger which should be more configurable to a user's preference