Hi every one,
I need some help on using variables with shortest
. I want to find the shortest path between 2 nodes by attribute.
Here is the mutation where I feed the data into my schema
{
set {
# -- create 3 tables as 3 nodes
_:table1 <table> "Table1" .
_:table2 <table> "Table2" .
_:table3 <table> "Table3" .
# -- Prepare predicate joins_with with Facets
_:table1 <joins_with> _:table2 (joint_type="INNER", table_column="col_from_t1", remote_table_column="col_from_t2") .
_:table2 <joins_with> _:table3 (joint_type="LEFT", table_column="col_from_t1", remote_table_column="col_from_t3") .
}
}
I want to get the shortest path between table1 and table3. It should will be Table1 -> Table2 -> Table3
Here is my query
{
A as var(func:allofterms(table, "Table1")) {
table
}
B as var(func:allofterms(table, "Table3")) {
table
}
path as shortest(from: uid(A) , to: uid(B) ) {
joins_with
}
path(func: uid(path)) {
table
}
}
But I got this error "Expecting argument name. Got: lex.Item [12] \"(\""
, it’s like the value of uid
is never passed.
Can you guys help me on this? do I miss something?
Thank you already