Ejemplo n.º 1
0
def create_prov_entity_for_data(id_scope, conn):
    return DBProvEntity(id='e' + str(id_scope.getNewId(DBProvEntity.vtType)),
                        vt_id=conn.db_id,
                        prov_type='vt:data',
                        prov_label=None,
                        prov_value=None,
                        vt_type=None,
                        vt_desc=None,
                        vt_package=None,
                        vt_version=None,
                        vt_cache=None,
                        vt_location_x=None,
                        vt_location_y=None,
                        is_part_of=None)
Ejemplo n.º 2
0
def create_prov_entity_from_workflow(id_scope, workflow):
    return DBProvEntity(id='e' + str(id_scope.getNewId(DBProvEntity.vtType)),
                        vt_id=workflow.db_id,
                        prov_type='prov:Plan',
                        prov_label=workflow._db_name,
                        prov_value=None,
                        vt_type='vt:workflow',
                        vt_desc=None,
                        vt_package=None,
                        vt_version=workflow._db_version,
                        vt_cache=None,
                        vt_location_x=None,
                        vt_location_y=None,
                        is_part_of=None)
Ejemplo n.º 3
0
def create_prov_entity_from_group(id_scope, group, is_part_of):

    # getting group label defined by the user
    desc = None
    for db_annotation in group.db_annotations:
        if db_annotation._db_key == '__desc__':
            desc = db_annotation._db_value
            break
    
    return DBProvEntity(id='e' + str(id_scope.getNewId(DBProvEntity.vtType)),
                        vt_id=group.db_id,
                        prov_type='prov:Plan',
                        prov_label=group.db_name,
                        prov_value=None,
                        vt_type='vt:group',
                        vt_desc=desc,
                        vt_package=None,
                        vt_version=None,
                        vt_cache=group.db_cache,
                        vt_location_x=group.db_location._db_x,
                        vt_location_y=group.db_location._db_y,
                        is_part_of=is_part_of)
Ejemplo n.º 4
0
def create_prov_entity_from_function(id_scope, function):
    values = []
    types = []
    aliases = []
    for parameter in function._db_parameters:
        values.append(str(parameter._db_val))
        types.append(str(parameter._db_type))
        if parameter._db_alias:
            aliases.append(parameter._db_alias)
        else:
            aliases.append('None')
        
    value = ''
    type = ''
    alias = None
    if len(values) == 1:
        value = values[0]
        type = types[0]
        alias = aliases[0]
    elif len(values) > 1:
        value = '(' + ','.join(values) + ')'
        type = '(' + ','.join(types) + ')'
        alias = '(' + ','.join(aliases) + ')'
    
    return DBProvEntity(id='e' + str(id_scope.getNewId(DBProvEntity.vtType)),
                        vt_id=function.db_id,
                        prov_type='vt:data',
                        prov_label=function.db_name,
                        prov_value=value,
                        vt_type=type,
                        vt_desc=alias,
                        vt_package=None,
                        vt_version=None,
                        vt_cache=None,
                        vt_location_x=None,
                        vt_location_y=None,
                        is_part_of=None)