     exploded-item))
 
 (defn extract-attribute [attr-key input]
+  "Extracts a hash-map containing a single key and its value from the input.
+  The key is expected to be a keyword, while input is supposed to be a hash-map
+  with strings as keys"
   (let [attr-name (name attr-key)
         attr-value (input attr-name)]
   {attr-key attr-value}))
 
 (defn extract-nested-item [attr input]
+  "Extracts a nested item from input, returning a hashmap with a single pair,
+  where the key is the nested item association name, and the value is a json
+  string representing all the attributes of the nested item.
+  attr is expected to be a hash-map with at least :name and :schema keys,
+  while input is expected to be a hash-map representing the profile, with strings as keys"
   (let [association-name   (:name   attr)
         association-schema (:schema attr)
         nested-item (->> association-schema

    {association-name associated-items}))

(defn parse-by-schema [input schema]
  (->> schema
       (reduce
         (fn [item attr]

    {association-name nested-item}))

(defn extract-associated-item [association-name association-schema input index]
  "Extracts the item belonging to a 'has many' association from input, at position index."
  (->> association-schema
    (reduce
      (fn [associated-item associated-item-attr]
