Created
October 6, 2012 22:15
-
-
Save denlab/3846358 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn create-attr-map | |
[attr-code attr-type src-code] | |
{"attribute" | |
{"name" attr-code | |
"attributeType" {"href" (format "/foundation/v2/attributeTypes/%s" attr-type)} | |
"source" {"href" (format "/foundation/v2/%s" src-code)}}}) | |
(comment | |
(def att0 (create-attr-map "new-attr-code" "String" "System")) | |
(json-encode att0)) | |
(defn put-attr | |
"Put an attribute into wikeo" | |
[attr-code attr-type src-code] | |
(wikeo-query :put | |
(format "/foundation/v2/attributes/%s" attr-code) | |
{:body (json-encode (create-attr-map attr-code attr-type src-code)) | |
:content-type :json})) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment