The following example shows how to use the fct_exec
APi in vsp page to perform a "text" search for the word "Mike" assuming that exists in your Virtuoso RDF store (if not amend the query in the fct_example.vsp
code sample below to search for text known to exist).
fct_example.vsp
:
<?vsp declare txt, reply, tree any; declare timeout int; tree := xtree_doc (' <query> <text>Mike</text> <view type="text"/> </query> '); timeout := 3000; reply := fct_exec (tree, timeout); txt := string_output (); http_value (xslt ('virt://WS.WS.SYS_DAV_RES.RES_FULL_PATH.RES_CONTENT:/DAV/fct_example.xsl', reply, vector ()), null, txt); http (txt); ?>
fct_example.vsp
should be: