def add_item(self, collection_uri, name, metadata):
        """Add a new item to a collection

        :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

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

        :raises: APIError if the request was not successful

        """

        metadata['dcterms:identifier'] = name
        metadata['dc:identifier'] = name  # for backward compatability in Alveo SOLR store until bug fix
        metadata['@type'] = 'ausnc:AusNCObject'

        meta = {'items': [{'metadata': { '@context': self.context,
                                         '@graph': [metadata]
                                        }
                          }]
                }

        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
def add_item ( self , collection_uri , name , metadata ) : metadata [ 'dcterms:identifier' ] = name metadata [ 'dc:identifier' ] = name metadata [ '@type' ] = 'ausnc:AusNCObject' meta = { 'items' : [ { 'metadata' : { '@context' : self . context , '@graph' : [ metadata ] } } ] } response = self . api_request ( collection_uri , method = 'POST' , data = json . dumps ( meta ) ) self . __check_success ( response ) item_uri = collection_uri + "/" + response [ 'success' ] [ 0 ] return item_uri
Add a new item to a collection

        :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

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

        :raises: APIError if the request was not successful