Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixup README.

  • Loading branch information...
commit c943fdda094c7c08c37e9a08df16a6b6cd389d95 1 parent 43a2cdb
Richard Newman authored
Showing with 84 additions and 74 deletions.
  1. +0 −74 README
  2. +84 −0 README.markdown
View
74 README
@@ -1,74 +0,0 @@
-This project has a dependency on clj-apache-http, as well as Clojure and
-clojure-contrib.
-
-A recent build of clj-apache-http is in the lib/ directory; everything you need
-to use this code (apart from Clojure and contrib) is in the checkout.
-
-You can use the enclosed shell scripts as an example:
-
- $ sh restaurants.sh "/en/los_gatos"
- Looking in /en/los_gatos ...
- Andale Taqueria, 21 N Santa Cruz Ave
- Cafe Primavera, 15970 Los Gatos Blvd
- California Cafe Bar and Grill, 50 University Avenue
- Fleur de Cocoa, 39 N. Santa Cruz Ave
- Gallo's, 14180 Blossom Hill Road
- High Tech Burrito, 15960 Los Gatos Boulevard
- Kamakura Japanese Restaurant, 135 N. Santa Cruz Avenue
- Los Gatos Brewing Company, 130 N. Santa Cruz Avenue
- Manresa, 320 Village Lane
- Marbella, 14109 Winchester Boulevard
- Nonno's Pizza and Pasta, 24133 Broadway
- Pastaria and Market, 49 E Main St
- Ristorante Valeriano, 160 W Main St
- T-Birds Pizza of Las Gatos, 444 N. Santa Cruz Avenue
- Tapestry: A California Bistro, 11 College Avenue
- Valeriano's Ristorante, 160 W. Main St.
- Whole Foods, 15980
- Willow Street Wood-Fired Pizza, 20 S. Santa Cruz Avenue
- Wine Cellar, 50 University Ave.
- Cin-Cin Wine Bar and Restaurant, 386 Village Lane
- Pedro's, 316 North Santa Cruz Aveue
-
-The MQL library (com.twinql.clojure.mql) supports authentication, reading,
-writing, and assorted status operations.
-
-Examples:
-
-(use 'com.twinql.clojure.mql)
-
-(with-sandbox ; Use Sandbox API locations.
- (with-login ["user" "pass"] ; Make a login request and keep the cookie.
- (println "Logged in?" (mql-logged-in?)))
-
- ;; Ordinary requests don't need authentication; only writes.
- (prn (take 3 (map :id (mql-search "Los Gatos")))))
-
-;; Let's try to look up Blade Runner by name and attributes.
-(first ; Return the best result.
- (only-matching ; Exclude any that don't match.
- (mql-reconcile { "/type/object/name" "Blade Runner",
- "/type/object/type" "/film/film",
- "/film/film/starring/actor" ["Harrison Ford", "Rutger Hauer"],
- "/film/film/starring/character" ["Rick Deckard", "Roy Batty"],
- "/film/film/director" {
- "name" "Ridley Scott",
- "id" "/guid/9202a8c04000641f8000000000032ded"
- },
- "/film/film/release_date_s" "1981"
- })))
-
-;; Run a read query.
-(mql-read { "name" "Blade Runner" "/type/object/type" [] })
-
-;; Make more than one query at a time.
-(mql-read [
- { "id" "/guid/9202a8c04000641f8000000000009e89"
- "name" nil }
-
- { "id" "/guid/9202a8c04000641f8000000000032ded"
- "/type/object/type" [] }])
-
-;; Fetch status info.
-(prn (mql-version))
-(prn (mql-status))
View
84 README.markdown
@@ -0,0 +1,84 @@
+# What is it? #
+
+`clj-mql` is a client library for Freebase (or any site that implements its API).
+
+It currently allows you to issue unauthenticated version, status, read, search,
+and reconcile requests, and to issue write requests within the scope of a
+login. Logins and writes are performed over HTTPS by default.
+
+This project has a dependency on clj-apache-http, as well as Clojure and
+clojure-contrib, and Dan Larkin's JSON library.
+
+A recent build of clj-apache-http and clojure-json are in the lib/ directory;
+everything you need to use this code (apart from Clojure and contrib) is in the
+checkout.
+
+Also included in this library is an example application which lists restaurants
+in a city.
+
+You can use the enclosed shell scripts as an example:
+
+ $ sh restaurants.sh "/en/los_gatos"
+ Looking in /en/los_gatos ...
+ Andale Taqueria, 21 N Santa Cruz Ave
+ Cafe Primavera, 15970 Los Gatos Blvd
+ California Cafe Bar and Grill, 50 University Avenue
+ Fleur de Cocoa, 39 N. Santa Cruz Ave
+ Gallo's, 14180 Blossom Hill Road
+ High Tech Burrito, 15960 Los Gatos Boulevard
+ Kamakura Japanese Restaurant, 135 N. Santa Cruz Avenue
+ Los Gatos Brewing Company, 130 N. Santa Cruz Avenue
+ Manresa, 320 Village Lane
+ Marbella, 14109 Winchester Boulevard
+ Nonno's Pizza and Pasta, 24133 Broadway
+ Pastaria and Market, 49 E Main St
+ Ristorante Valeriano, 160 W Main St
+ T-Birds Pizza of Las Gatos, 444 N. Santa Cruz Avenue
+ Tapestry: A California Bistro, 11 College Avenue
+ Valeriano's Ristorante, 160 W. Main St.
+ Whole Foods, 15980
+ Willow Street Wood-Fired Pizza, 20 S. Santa Cruz Avenue
+ Wine Cellar, 50 University Ave.
+ Cin-Cin Wine Bar and Restaurant, 386 Village Lane
+ Pedro's, 316 North Santa Cruz Aveue
+
+
+# Examples #
+
+ (use 'com.twinql.clojure.mql)
+
+ (with-sandbox ; Use Sandbox API locations.
+ (with-login ["user" "pass"] ; Make a login request and keep the cookie.
+ (println "Logged in?" (mql-logged-in?)))
+
+ ;; Ordinary requests don't need authentication; only writes.
+ (prn (take 3 (map :id (mql-search "Los Gatos")))))
+
+ ;; Let's try to look up Blade Runner by name and attributes.
+ (first ; Return the best result.
+ (only-matching ; Exclude any that don't match.
+ (mql-reconcile { "/type/object/name" "Blade Runner",
+ "/type/object/type" "/film/film",
+ "/film/film/starring/actor" ["Harrison Ford", "Rutger Hauer"],
+ "/film/film/starring/character" ["Rick Deckard", "Roy Batty"],
+ "/film/film/director" {
+ "name" "Ridley Scott",
+ "id" "/guid/9202a8c04000641f8000000000032ded"
+ },
+ "/film/film/release_date_s" "1981"
+ })))
+
+ ;; Run a read query.
+ (mql-read { "name" "Blade Runner" "/type/object/type" [] })
+
+ ;; Make more than one query at a time.
+ (mql-read [
+ { "id" "/guid/9202a8c04000641f8000000000009e89"
+ "name" nil }
+
+ { "id" "/guid/9202a8c04000641f8000000000032ded"
+ "/type/object/type" [] }])
+
+ ;; Fetch status info.
+ (prn (mql-version))
+ (prn (mql-status))
Please sign in to comment.
Something went wrong with that request. Please try again.