Virtuoso Facets Web Service CURL Example with search string "Seattle Mariners traveled all the way to Japan to watch"


curl -H "Content-Type: text/xml" -d @post.xml  http://lod.openlinksw.com/fct/service

Where 'post.xml' document contains query document:


<?xml version="1.0"?>
<query xmlns="http://openlinksw.com/services/facets/1.0" inference="" same-as="">
  <text>Seattle Mariners traveled all the way to Japan to watch</text>
  <view type="text" limit="20" offset=""/>
</query>

Produces the following response:


<fct:facets xmlns:fct="http://openlinksw.com/services/facets/1.0/">
<fct:sparql>
   SELECT DISTINCT  ?s1 AS ?c1, 
                    ( bif:search_excerpt 
                      ( bif:vector 
                        ( 'THE', 
                          'MARINERS', 
                          'WAY', 
                          'SEATTLE', 
                          'WATCH', 
                          'ALL', 
                          'TO', 
                          'JAPAN', 
                          'TRAVELED'
                        ), ?o1
                      )
                    ) AS ?c2  
     WHERE { ?s1 ?s1textp ?o1 .
             FILTER ( bif:contains 
                      ( ?o1, 
                        '(THE AND MARINERS AND WAY AND SEATTLE AND WATCH AND ALL AND TO AND JAPAN AND TRAVELED)'
                      )
                    ) 
           } 
     LIMIT 20
     OFFSET 0
</fct:sparql>
<fct:time>116</fct:time>
<fct:complete>yes</fct:complete>
<fct:db-activity>   134R rnd  9.488KR seq      0P disk  8.966MB /    602 messages</fct:db-activity>
 <fct:result>
  <fct:row>
    <fct:column datatype="url" shortform="http://bobdupuy.mlbl...ld_baseball__6.html"><![CDATA[http://bobdupuy.mlblogs.com/bobdupuy/2006/03/world_baseball__6.html]]></fct:column>
    <fct:column />
    <fct:column><![CDATA[<span class="srch_xerpt">... While Chuck Armstrong president of <b>the</b> <b>Seattle</b> <b>Mariners</b> <b>traveled</b> <b>all</b> <b>the</b> <b>way</b> <b>to</b> <b>Japan</b> <b>to</b> <b>watch</b> Ichiro... for <b>the</b> advancing <b>Japan</b> team last week <b>the</b> star from <b>the</b> <b>Seattle</b> roster so far in Round 1 has without a doubt... leading <b>the</b> Dominican <b>to</b> its...</span>]]></fct:column>
  </fct:row>
  <fct:row>
    <fct:column datatype="url" shortform="http://bobdupuy.mlbl...ld_baseball__6.html"><![CDATA[http://bobdupuy.mlblogs.com/bobdupuy/2006/03/world_baseball__6.html]]></fct:column>
    <fct:column />
    <fct:column><![CDATA[<span class="srch_xerpt">Orlando While Chuck Armstrong president of <b>the</b> <b>Seattle</b> <b>Mariners</b> <b>traveled</b> <b>all</b> <b>the</b> <b>way</b> <b>to</b> <b>Japan</b> <b>to</b> <b>watch</b>... perform for <b>the</b> advancing <b>Japan</b> team last week <b>the</b> star from <b>the</b> <b>Seattle</b> roster so far in Round 1 has without...</span>]]></fct:column>
  </fct:row>
 </fct:result>
</fct:facets>

Related