This project has retired. For details please refer to its Attic page.
Apache Stanbol - Contenthub (1 minute tutorial)

Contenthub (1 minute tutorial)

The Apache Stanbol Contenthub is an Apache Solr based document repository which enables storage of text-based documents and customizable semantic search facilities. Contenthub exposes an efficient Java API together with the corresponding RESTful services.

Apache Stanbol comes with several launchers. If you build Stanbol from its source with the following command

mvn clean install

You can find all launchers under the launchers directory. Contenthub is currently included in the full launcher of Apache Stanbol. That is, you can make use of Contenthub services if you run the full launcher.

To run the full launcher of Apache Stanbol, go to the directory of full launcher and run the jar file under the target directory

cd {stanbol}/launchers/full
java -Xmx1g -jar target/org.apache.stanbol.launchers.full-{snapshot-version}-incubating-SNAPSHOT.jar

Your Stanbol instance is running under {stanbol}/launchers/full/sling and Contenthub is accessible at

http://localhost:8080/contenthub

Contenthub is divided into Store and Search subcomponents. The link above will be automatically redirected to

http://localhost:8080/contenthub/contenthub/store

You can submit text content (sending in the payload of an HTTP POST request) with the following command

curl -i -X POST -H "Content-Type:text/plain" \
    --data "I live in Istanbul." \ 
    http://localhost:8080/contenthub/contenthub/store

Contenthub provides different search interfaces. You can directly query the Solr backend as follows

http://localhost:8080/solr/default/contenthub/select?q=*:*

http://localhost:8080/solr/default/contenthub/select?q=turkey

You can obtain a Contenthub specific search result from the featured search service based on a keyword search. The results can be retrieved in JSON format as in the following command

curl -i -X GET -H "Accept: application/json" \
    -H "Content-Type:text/plain" \ 
    http://localhost:8080/contenthub/contenthub/search/featured?queryTerm=turkey

Featured search not only returns resulting documents, but also related keywords retrieved from various resources (if the resources are available within the running Stanbol instance)

Here, you can find a more detailed version (5 minutes tutorial) of the tutorial.