Clj-osf

The clj-osf Clojure API is a framework available to Clojure developers to help them generate queries to any OSF Web Service endpoint. Each of the OSF web service endpoint has its own clojure function. A series of function can be chained to generate a OSF query. That function is used to generate any query, to send it to be endpoint of a OSF Web Service instance and to get back a resultset. The resultset can then be manipulated by using the internal structEDN data structure.

How to use the API
Using this API is really simple. Developers have to:


 * 1) Use the clj-osf package in their project
 * 2) Declare the namespaces they want to use
 * 3) Configure their applications to use the   package by calling the   and   macros
 * 4) Use the appropriate function to send the query to a web service endpoint.

The first thing you have to do is to make sure you make you add clj-osf as a dependancy in your Leiningen project:

Then you have to declare the namespaces you want to use. Let's just declare all of them for this tutorial, but you should only use the ones you required in your application:

Finally you have to make sure that you configure the clj-osf library before starting to use it. This configuration is required to make the API aware of the OSF endpoints to query and to configure the credentials to be able to send queries to it:

Patterns and Usage
This section shows some patterns necessary to understand in order to properly use a OSF instance.

Creating a new dataset
When you use the  web service endpoint, the permissions required to access it are not automatically created. It is the developer/user that has to specify the permissions to give to that newly created dataset in order to be able to access it:

Creating/Importing a new ontology
When you use the  web service endpoint, the permissions required to access it are not automatically created. It is the developer/user that has to specify the permissions to give to that newly created ontology in order to be able to access it:

Web Services Usage
This section show how each OSF endpoint can be queried using the clj-osf Clojure API.