kbaseattic / relation_engine_spec

Specifications and config for the KBase Relation Engine
https://kbase.us
MIT License
0 stars 7 forks source link

no_taxa_intermediates #41

Closed JamesJeffryes closed 5 years ago

jayrbolton commented 5 years ago

After testing some objects, I might go with this query:

with wsprov_object
let obj_id = CONCAT("wsprov_object/", @obj_key)
for v, e, p in 1..@max_depth
    any obj_id wsprov_links, wsprov_copied_into
    options {uniqueVertices: "global", bfs: true}
    FILTER p.vertices[1].is_taxon != true
    FILTER (!@types || v.workspace_type IN @types)
    FILTER (!@owners || v.owner IN @owners)
    FILTER (@show_private && @show_public) ? (v.is_public || v.workspace_id IN @ws_ids) :
        (!@show_private || v.workspace_id IN @ws_ids) && (!@show_public || v.is_public)
    return {
        vertex: {
            _key: v._key,
            is_public: v.is_public,
            narr_name: v.narr_name,
            obj_name: v.obj_name,
            owner: v.owner,
            save_date: v.save_date,
            workspace_id: v.workspace_id,
            ws_type: v.ws_type
        },
        path: {
            edges: p.edges[*]._id,
            verts: p.vertices[*]._id
        }
    }
jayrbolton commented 5 years ago

@JamesJeffryes if you have time, can we do a simpler version of this PR, where all it does is avoid traversing taxa on the wsprov_fetch_linked_objects view as well as the wsprov_fetch_copies view without any breaking API changes (ie exact same bind vars)?