Created
January 11, 2019 21:41
-
-
Save jayrbolton/8e257633523376cf46b198380538321f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Simple doc fetch | |
{ | |
coll: "wsprov_object", | |
keys: ["1:2:3"], | |
user_ids: [], | |
page_limit: 10 | |
} | |
produces aql: | |
for obj1 in wsprov_object | |
filter obj1._id in ["1:2:3"] | |
filter obj1.is_public | |
return distinct obj1 | |
Provenance UI, given query: | |
{ | |
coll: "wsprov_object", | |
keys: ["1:2:3"], | |
user_ids: [], | |
page_limit: 10, | |
traversals: [ | |
{ | |
edge_name: "wsprov_links", | |
min_levels: 1, | |
max_levels: 100, | |
direction: "any" | |
} | |
] | |
} | |
produces aql: | |
for obj1 in wsprov_object | |
filter obj1._id in ["1:2:3"] | |
filter obj1.is_public | |
for obj2 in 1..100 ANY obj1 wsprov_links | |
filter obj2.is_public | |
return distinct obj2 | |
More complicated example. Given json query: | |
{ | |
coll: "rxn_reaction", | |
keys: ["xyz"], | |
user_ids: ["jjeffryes"], | |
bindings: { | |
df_sim: 0.99, | |
sf_sim: 0.95 | |
}, | |
traversals: [ | |
{ | |
edge_name: "rxn_similar_to_reaction", | |
filters: ["@edge.sf_similarity >= @sf_sim", "@edge.df_similarity >= @df_sim"] | |
}, | |
{ | |
edge_name: "rxn_reaction_within_complex" | |
}, | |
{ | |
edge_name: "rxn_gene_within_complex" | |
direction: "inbound" | |
} | |
] | |
} | |
produces aql: | |
let accessible_ids = ( | |
for e in user_can_read | |
filter e._from IN ["user/xyz"] | |
return e._to | |
) | |
for obj1 in rxn_reaction | |
filter obj1.is_public || (obj1._id IN accessible_ids) | |
filter obj1._key IN ["xyz"] | |
for obj2, edge1 in 1..1 OUTBOUND obj1 rxn_similar_to_reaction | |
filter edge1.sf_similarity >= 0.95 | |
filter edge1.df_similarity >= 0.99 | |
filter obj2.is_public || (obj2._id IN accessible_ids) | |
for obj3 in 1..1 OUTBOUND obj2 rxn_within_complex | |
filter obj3.is_public || (obj3._id IN accessible_ids) | |
for obj4 in 1..1 INBOUND obj3 rxn_gene_within_complex | |
filter obj4.is_public || (obj4._id IN accessible_ids) | |
return distinct obj4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment