Add a new item to a collection containing a single
        text document.

        The full text of the text document is specified as the text
        argument and will be stored with the same name as the
        item and a .txt extension.

        This is a shorthand for the more general add_item method.

        :param collection_uri: The URI that references the collection
        :type collection_uri: String

        :param name: The item name, suitable for use in a URI (no spaces)
        :type name: String

        :param metadata: a dictionary of metadata values describing the item
        :type metadata: Dict

        :param text: the full text of the document associated with this item
        :type text: String


        :param title: document title, defaults to the item name
        :type title: String

        :rtype String
        :returns: the URI of the created item

        :raises: APIError if the request was not successful

def add_text_item(self, collection_uri, name, metadata, text, title=None):
        """Add a new item to a collection containing a single
        text document.

        The full text of the text document is specified as the text
        argument and will be stored with the same name as the
        item and a .txt extension.

        This is a shorthand for the more general add_item method.

        :param collection_uri: The URI that references the collection
        :type collection_uri: String

        :param name: The item name, suitable for use in a URI (no spaces)
        :type name: String

        :param metadata: a dictionary of metadata values describing the item
        :type metadata: Dict

        :param text: the full text of the document associated with this item
        :type text: String


        :param title: document title, defaults to the item name
        :type title: String

        :rtype String
        :returns: the URI of the created item

        :raises: APIError if the request was not successful

        """

        docname = name + ".txt"
        if title is None:
            title = name

        metadata['dcterms:identifier'] = name
        metadata['@type'] = 'ausnc:AusNCObject'
        metadata['hcsvlab:display_document'] = {'@id': docname}
        metadata['hcsvlab:indexable_document'] = {'@id': docname}
        metadata['ausnc:document'] =  [{ '@id': 'document1.txt',
                                         '@type': 'foaf:Document',
                                         'dcterms:extent': len(text),
                                         'dcterms:identifier': docname,
                                         'dcterms:title': title,
                                         'dcterms:type': 'Text'}]

        meta = {'items': [{'metadata': { '@context': self.context,
                                         '@graph': [metadata]
                                        },
                            'documents': [{'content': text, 'identifier': docname}]
                          }]
                }

        response = self.api_request(collection_uri, method='POST', data=json.dumps(meta))

        # this will raise an exception if the request fails
        self.__check_success(response)

        item_uri = collection_uri + "/" + response['success'][0]

        return item_uri