Jaccard Similarity - Sample example

Hi Team,

We wanted to use jaccard similarity for one our use case. Tried replicating it on sample data set(movie graph) as mentioned from link https://docs.tigergraph.com/graph-algorithm-library/similarity/jaccard-similarity-of-neighborhoods-single-source and https://github.com/tigergraph/gsql-graph-algorithms but not able to do it. I feel the documentation on algorithms is not clear as that of accumulators and other topics. Can you please guide me to a link or place where it explains 1) why query CREATE QUERY tg_jaccard_nbor_ss (VERTEX source, STRING e_type, STRING rev_e_type,
INT top_k = 100, BOOL print_accum = TRUE, STRING similarity_edge_type = “”, STRING file_path = “”) takes rev_e_type instead of saying rev_e_type is reverse edge 2) Sample data set and schema on which tg_jaccard_nbor_ss can be ran.

For your first question, STRING rev_e_type is kept as an additional input to the query because you can set reverse edge types to have custom names. This field is just to ensure that the query knows what you named this reverse edge in particular (in case you did not make it the default reverse_EDGENAME).

Similarly, STRING e_type does not actually take in an EDGE type as input, but rather the STRING that you named that edge type with.

In regards to the second question, I am currently looking through our starter kits to see whether one of them is a good example of using Jaccard similarity.

Here are some good examples to look at:

We have many flavors of Jaccard floating around, so I can’t attest to whether these solutions represent our latest implementation(s).