Showing posts from December, 2011

(re) learning Clojure

I have been using Clojure for about 25% of my consulting work in the last 2 years, read two books on Clojure, and I had some Clojure examples in a book I wrote last year. That said, I don't really feel "expert" at the language the way I do with Java, Ruby, and Common Lisp. I am trying to fill in some gaps by carefully reading through one of my customer's Clojure code , and all Clojure libraries that I use like Noir, Compojure, etc. I am trying to pick up more idioms. I enjoy it when I see a new trick in someone else's code and going back to my code to improve it.

Using the New York Times Semantic Web APIs

I am working on a side project of my own in Clojure using the AllegroGraph 4 and Stardog RDF repositories (thanks to Franz and to Clark & Parsia for licenses to use their products!) and my own NLP code. I am using the excellent NYT data access APIs to get research/test data. I am going to show you some simple examples in Ruby for accessing the NYT Semantic Web APIs that are free to use up to 5000 API calls a day. I also use other NYT APIs. Each API has an access key that you need to sign up for. I set my access keys as environment variables that I access in my code; for example in Ruby: # New York Times API Keys: NYT_SEMANTIC_WEB = ENV['NYT_SEMANTIC_WEB'] NYT_SEARCH = ENV['NYT_SEARCH'] NYT_NEWSWIRE = ENV['NYT_NEWSWIRE'] NYT_PEOPLE = ENV['NYT_PEOPLE'] NYT_TAGS = ENV['NYT_TAGS'] In the following code snippets, I am only using the Semantic Web APIs. I want to first search for available concept types and concept names, based on keyword sea