Skip to content

Instantly share code, notes, and snippets.

@drankard
Created December 14, 2011 22:31
Show Gist options
  • Save drankard/1478870 to your computer and use it in GitHub Desktop.
Save drankard/1478870 to your computer and use it in GitHub Desktop.
clojure rdf test
(ns rdf-bi.core)
(defn dc [property]
(str "http://purl.org/dc/elements/1.1/contributor/" (name property)))
(defn rdfs [property]
(str "http://www.w3.org/2000/01/rdf-schema#" (name property)))
(defn rdf [property]
(str "http://www.w3.org/1999/02/22-rdf-syntax-ns#" (name property)))
(defn resource [res]
(str "<"res">"))
(defn literal [l]
(do l))
(def ^:dynamic *subject* nil)
(defmacro with-subject [subject & body]
`(binding [*subject* ~subject]
(str ~@body)))
(defn triple [p o]
(str *subject* " " p " " o " .\n"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment