(self, name, values, ontology='text')
return error.get_response_json(response, logger)
Adds or modifies attributes to the sketch.

        Args:
            name (str): The name of the attribute.
            values (list): A list of values (in their correct type according
                to the ontology).
            ontology (str): The ontology (matches with
                /data/ontology.yaml), which defines how the attribute
                is interpreted.

        Raises:
            ValueError: If any of the parameters are of the wrong type.

        Returns:
            A dict with the results from the operation.
Adds or modifies attributes to the sketch.
Adds or modifies attributes to the sketch .
def add_attribute_list(self, name, values, ontology='text'):
        """Adds or modifies attributes to the sketch.

        Args:
            name (str): The name of the attribute.
            values (list): A list of values (in their correct type according
                to the ontology).
            ontology (str): The ontology (matches with
                /data/ontology.yaml), which defines how the attribute
                is interpreted.

        Raises:
            ValueError: If any of the parameters are of the wrong type.

        Returns:
            A dict with the results from the operation.
        """
        if not isinstance(name, str):
            raise ValueError('Name needs to be a string.')

        if not isinstance(ontology, str):
            raise ValueError('Ontology needs to be a string.')

        resource_url = '{0:s}/sketches/{1:d}/attribute/'.format(
            self.api.api_root, self.id)

        data = {
            'name': name,
            'values': values,
            'ontology': ontology,
        }
        response = self.api.session.post(resource_url, json=data)

        status = error.check_return_status(response, logger)
        if not status:
            logger.error('Unable to add the attribute to the sketch.')

        return error.get_response_json(response, logger)
def add_attribute_list ( self , name , values , ontology = 'text' ) : if not isinstance ( name , str ) : raise ValueError ( 'Name needs to be a string.' ) if not isinstance ( ontology , str ) : raise ValueError ( 'Ontology needs to be a string.' ) resource_url = '{0:s}/sketches/{1:d}/attribute/' . format ( self . api . api_root , self . id ) data = { 'name' : name , 'values' : values , 'ontology' : ontology , } response = self . api . session . post ( resource_url , json = data ) status = error . check_return_status ( response , logger ) if not status : logger . error ( 'Unable to add the attribute to the sketch.' ) return error . get_response_json ( response , logger )