virtuoso-opensource
virtuoso-opensource copied to clipboard
how to use `t_end_flag` in `TRANSITIVE` clause?
Virtuoso SPARQL allows access to Virtuoso's SQL transitivity extension.
option (transitive transitivity_option[,...])
transitivity_option ::= t_in (<variable_list>)
| t_out (<variable_list>)
| t_distinct
| t_shortest_only
| t_no_cycles
| t_cycles_only
| t_min (INTNUM)
| t_max (INTNUM)
| t_end_flag (<variable>)
| t_step (<variiable_or_step>)
| t_direction INTNUM
variable_list ::= <variable> [,...]
variable_or_step ::= <variable> | path_id' | 'step_no'
But don't give any description or sample about t_end_flag
please tell me something about this
I have exactly the same question.
T_END_FLAG (intnum) — This option is used to indicate that the transitive operation should stop when the variable returns a non-zero value. Its value is a positive integer indicating the ordinal position of the variable in the select list to be used.
Sample query showing its use:
SELECT ?syn
WHERE
{
{
SELECT ?x ?syn
WHERE
{
{ ?x owl:sameAs ?syn }
UNION
{ ?syn owl:sameAs ?x }
}
}
OPTION (TRANSITIVE, t_in (?x), t_out (?syn), t_distinct, t_min (0), T_END_FLAG 2)
FILTER (?x = <http://dbpedia.org/resource/New_York>) .
}
Live Query Link ...