www.openlinksw.com
docs.openlinksw.com

Book Home

Contents
Preface

RDF Data Access and Data Management

Data Representation
SPARQL
Extensions
RDF Graphs Security
RDF Views over RDBMS Data Source
Automated Generation of RDF Views over Relational Data Sources
Examples of RDF Views
RDF Insert Methods in Virtuoso
RDFizer Middleware (Sponger)
Virtuoso Facet Browser Installation and configuration
Prerequisites Pre Installation VAD Package Installation Post Installation Usage Statistics Examples
Virtuoso Facets Web Service
Linked Data
Inference Rules & Reasoning
RDF and Geometry
Performance Tuning
RDF Data Access Providers (Drivers)
RDF Graph Replication

14.10. Virtuoso Facet Browser Installation and configuration

14.10.1. Prerequisites

Requires Virtuoso 6.0 TP1 or higher for use.


14.10.2. Pre Installation

Note: This step is not required for Virtuoso Release 6.1 and above builds

If you have an existing Virtuoso 6.x installation, and your Quad Store has greater than 10K worth of triples, please perform the following steps:

  1. Run the following commands using the Virtuoso isql program before installing the Facet Browser VAD:
      drop index RDF_QUAD_OPGS;
      drop index RDF_QUAD_POGS;
      drop index RDF_QUAD_GPOS;
      drop index RDF_QUAD_OGPS;
    
      checkpoint;
    
      create table R2 (G iri_id_8, S iri_id_8, P iri_id_8, O any, primary key (S, P, O, G));
      alter index R2 on R2 partition (S int (0hexffff00));
    
      log_enable (2);
    
      INSERT INTO R2 (G, S, P, O) select G, S, P, O FROM rdf_quad;
    
      DROP TABLE RDF_QUAD;
      ALTER TABLE r2 rename RDF_QUAD;
    
      checkpoint;
    
      create bitmap index RDF_QUAD_OPGS on RDF_QUAD (O, P, G, S) partition (O varchar (-1, 0hexffff));
      create bitmap index RDF_QUAD_POGS on RDF_QUAD (P, O, G, S) partition (O varchar (-1, 0hexffff));
      create bitmap index RDF_QUAD_GPOS on RDF_QUAD (G, P, O, S) partition (O varchar (-1, 0hexffff));
    
      checkpoint;
    

Note this step may take sometime depending on how many triples are already in your Quad Store.


14.10.3. VAD Package Installation

  1. Download and install the Virtuoso Facet Browser VAD package using the Conductor System Admin - > Packages tab.
    Install the FCT package
    Figure: 14.10.3.1. Install the FCT package
  2. The HTML interface of the Faceted Browser Engine is exposed at: http://<cname>/fct, where "cname" is the hostname:portno your Virtuoso instance is running on.
    FCT HTML interface
    Figure: 14.10.3.1. FCT HTML interface
  3. The Facet Browser Engine exposes a REST API at the endpoint: http://<cname>/fct/service.

14.10.4. Post Installation

  1. Build Full Text Indexes by running the following commands using the Virtuoso isql program:
    RDF_OBJ_FT_RULE_ADD (null, null, 'All');
    VT_INC_INDEX_DB_DBA_RDF_OBJ ();
    
  2. Run the following procedure using the Virtuoso isql program to populate label lookup tables periodically and activate the Label text box of the URI Lookup(by Label) tab:
    urilbl_ac_init_db()
    
  3. Run the following procedure using the Virtuoso isql program to calculate the IRI ranks. Note this should be run periodically as the data grows to re-rank the IRIs.
    s_rank()
    
  4. Sponge some data to load some RDF triples in the quad store. This can easily be done using the Virtuoso description.vsp page which provides a hypertext description of RDF Linked Data, by describing the following page for example (or one of your choice):
    http://cname/about/html/http/news.cnet.com
    
    Sponge data
    Figure: 14.10.4.1. Sponge data
  5. Use the Facet Browser Search and Find User Interface to search for information on "CNET"
    Facet Browser Search
    Figure: 14.10.4.1. Facet Browser Search
  6. Results of the following form should be returned for the data sponged.
    Facet Browser Search Results
    Figure: 14.10.4.1. Facet Browser Search Results
  7. Click "Types" link shown at the right vertical Navigation
  8. Results of the classes/properties should be returned:
    Results of the classes/properties
    Figure: 14.10.4.1. Results of the classes/properties
  9. To exclude a type unhatch the checkbox associated with the type:
    Exclude Type(s)
    Figure: 14.10.4.1. Exclude Type(s)
  10. Click the Type URI link
  11. Results of excluding the Type(s) should be shown:
    Results of Excluded Type(s)
    Figure: 14.10.4.1. Results of Excluded Type(s)
  12. The Facet Browser Web service endpoint can also be queried to obtain the same results:
    $ more cnet.xml
    <?xml version="1.0"?>
    <query xmlns="http://openlinksw.com/services/facets/1.0" inference="" same-as="">
      <text>CNET</text>
      <view type="text" limit="20" offset=""/>
    </query>
    
    $ curl -H "Content-Type: text/xml" -d @cnet.xml  http://cname/fct/service
    <fct:facets xmlns:fct="http://openlinksw.com/services/facets/1.0/">
    <fct:sparql>    SELECT ?s1 as ?c1, (bif:search_excerpt (bif:vector ('CNET'), ?o1)) as ?c2, ?sc, ?rank WHERE {{{ SELECT ?s1, (?sc * 3e-1) as ?sc, ?o1, (sql:rnk_scale (<LONG::IRI_RANK> (?s1))) as ?rank  WHERE { ?s1 ?s1textp ?o1 . ?o1 bif:contains  '"CNET"'  option (score ?sc)  . } ORDER BY DESC (?sc * 3e-1 + sql:rnk_scale (<LONG::IRI_RANK> (?s1)))  LIMIT 20  OFFSET 0 }}}</fct:sparql>
    <fct:time>16</fct:time>
    <fct:complete>yes</fct:complete>
    <fct:timeout>0</fct:timeout>
    <fct:db-activity>   131R rnd     36R seq      0P disk      0B /      0 messages</fct:db-activity>
     <fct:result type="text">
      <fct:row>
        <fct:column datatype="trank">4.5</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.com">http://news.com</fct:column>
        <fct:column>Technology News - CNET News</fct:column>
        <fct:column><span class="srch_xerpt"><b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">4.5</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com/2547-1_3-0-20.xml">http://news.cnet.com/2547-1_3-0-20.xml</fct:column>
        <fct:column>CNET News.com</fct:column>
        <fct:column><span class="srch_xerpt"><b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">4.5</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com">http://news.cnet.com</fct:column>
        <fct:column>Technology News - CNET News</fct:column>
        <fct:column><span class="srch_xerpt"><b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3.9</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.com">http://news.com</fct:column>
        <fct:column>Technology News - CNET News</fct:column>
        <fct:column><span class="srch_xerpt">Technology News <b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3.9</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com">http://news.cnet.com</fct:column>
        <fct:column>Technology News - CNET News</fct:column>
        <fct:column><span class="srch_xerpt">Technology News <b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.com">http://news.com</fct:column>
        <fct:column>Technology News - CNET News</fct:column>
        <fct:column><span class="srch_xerpt">Tech news and business reports by <b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com/2547-1_3-0-20.xml">http://news.cnet.com/2547-1_3-0-20.xml</fct:column>
        <fct:column>CNET News.com</fct:column>
        <fct:column><span class="srch_xerpt">Tech news and business reports by <b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com">http://news.cnet.com</fct:column>
        <fct:column>Technology News - CNET News</fct:column>
        <fct:column><span class="srch_xerpt">Tech news and business reports by <b>CNET</b> News.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.com#6">http://news.com#6</fct:column>
        <fct:column>There's an electric car in your future</fct:column>
        <fct:column><span class="srch_xerpt">... <b>CNET</b> Car Tech posts photos of electric cars expected to come out by 2011.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com/2547-1_3-0-20.xml#9">http://news.cnet.com/2547-1_3-0-20.xml#9</fct:column>
        <fct:column>There's an electric car in your future</fct:column>
        <fct:column><span class="srch_xerpt">... <b>CNET</b> Car Tech posts photos of electric cars expected to come out by 2011.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com#9">http://news.cnet.com#9</fct:column>
        <fct:column>There's an electric car in your future</fct:column>
        <fct:column><span class="srch_xerpt">... <b>CNET</b> Car Tech posts photos of electric cars expected to come out by 2011.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.com#6">http://news.com#6</fct:column>
        <fct:column>There's an electric car in your future</fct:column>
        <fct:column><span class="srch_xerpt">... <b>CNET</b> Car Tech posts photos of electric cars expected to come out by 2011.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com/2547-1_3-0-20.xml#9">http://news.cnet.com/2547-1_3-0-20.xml#9</fct:column>
        <fct:column>There's an electric car in your future</fct:column>
        <fct:column><span class="srch_xerpt">... <b>CNET</b> Car Tech posts photos of electric cars expected to come out by 2011.</span></fct:column>
      </fct:row>
      <fct:row>
        <fct:column datatype="trank">3</fct:column>
        <fct:column datatype="erank">5.881291583872905e-014</fct:column>
        <fct:column datatype="url" shortform="http://news.cnet.com#9">http://news.cnet.com#9</fct:column>
        <fct:column>There's an electric car in your future</fct:column>
        <fct:column><span class="srch_xerpt">... <b>CNET</b> Car Tech posts photos of electric cars expected to come out by 2011.</span></fct:column>
      </fct:row>
     </fct:result>
    </fct:facets>
    
  13. In the Label text box of the URI Lookup (by Label) tab enter the name of a rdfs label to be Describe'd:
    Query Facet Browser Web service endpoint
    Figure: 14.10.4.1. Query Facet Browser Web service endpoint
  14. Select a URI from the list of available Labels to obtain a description of the URI:
    Select a URI from the list of available Labels
    Figure: 14.10.4.1. Select a URI from the list of available Labels
  15. In the URI text box of the URI Lookup tab enter the name URI to be Describe'd:
    Enter URI
    Figure: 14.10.4.1. Enter URI
  16. Select a URI from the list of available Labels to obtain a description of the URI:
    Obtain a description of the URI
    Figure: 14.10.4.1. Obtain a description of the URI
  17. If data is loaded into the quad store via DML functions (TTLP, RDF_LOAD_RDFXML etc.) the following procedure needs to run from isql to build the free text indexes required each time:
    VT_INC_INDEX_DB_DBA_RDF_OBJ ()
    

14.10.5. Usage Statistics

  1. Use the Faceted Browser Search and Find User Interface to search for information on "Michael Jackson":
    Usage Statistics
    Figure: 14.10.5.1. Usage Statistics
  2. Results of the following form should be returned for the data sponged:
    Usage Statistics
    Figure: 14.10.5.1. Usage Statistics
  3. Click the "Types" link under "Navigation"
  4. Results about "Michael Jackson" as Type/Label/Count list should be returned.
  5. Click a type link, for ex.:
    dbpedia-owl:Artist
    
    Usage Statistics
    Figure: 14.10.5.1. Usage Statistics
  6. Should be shown type results and:
    Displaying types of e1 where:
    e1 has any property whose value contains "Michael Jackson".
    
    e1 is a dbpedia-owl:Artist . Drop
    
    Usage Statistics
    Figure: 14.10.5.1. Usage Statistics
  7. Click the "Show values" link under "Navigation"
  8. Results should be shown for "Michael Jackson" as values and text summaries associated with pattern:
    Displaying values and text summaries associated with pattern e1 where:
    e1 has any property whose value contains "Michael Jackson".
    e1 is a dbpedia-owl:Artist . Drop
    
  9. Click the link:
    dbpedia:Michael_Jackson
    
    Usage Statistics
    Figure: 14.10.5.1. Usage Statistics
  10. Results about "Michael Jackson" as property/value list should be returned:
    Usage Statistics
    Figure: 14.10.5.1. Usage Statistics
  11. Click the "Usage Statistics" link under "Actions" shown right of the list.
  12. Results of usage statistics for "Michael Jackson" grouped in 4 tabs should be shown:
    1. Referenced by Graphs: shows how many times the URI is found as subject in the relevant graph(s):
      SPARQL
      SELECT ?g count (*)
      where
            {
          graph ?g { <URI> ?p ?o }
        }
      group by ?g
      order by desc 2
      limit 20
      
      Usage Statistics
      Figure: 14.10.5.1. Usage Statistics
    2. Source Graphs: shows how many times the URI is found as object in the relevant graph(s):
      SPARQL
      SELECT ?g count (*)
      where
            {
          graph ?g { ?s ?p <URI>  }
            }
      group by ?g
      order by desc 2
      limit 20
      
      Usage Statistics
      Figure: 14.10.5.1. Usage Statistics
    3. Direct co-references: shows results as subject and calculated rank, based on running transitive closure over owl:sameAs of the URI in subject or object:
      SPARQL
      SELECT ?syn ( sql:rnk_scale (<LONG::IRI_RANK> (?syn)))
      where
            {
          { SELECT ?s ?syn
            where
             {
               {?syn owl:sameAs ?s } union {?s owl:sameAs ?syn}
          }
        }
          option (transitive, t_distinct, t_min (0), T_in (?s), t_out (?syn)) . filter (!isliteral (?syn) &amp;&amp; ?s = <URI> )
      }
      order by desc 2
      limit 20
      
      Usage Statistics
      Figure: 14.10.5.1. Usage Statistics
    4. Indirect co-references: shows expanded results for objects concur with the URI by IFP:
      SPARQL
      SELECT distinct ?syn ?p ?o (sql:rnk_scale (<LONG::IRI_RANK> (?syn)))
      where
        { <URI> ?p ?o .  filter (0 != (<LONG::bif:rdf_is_sub> ("b3sifp", ?p, lod:ifp_like, 3))) .
          ?syn ?p ?o .
      }
      order by desc 4
      limit 20
      
      Usage Statistics
      Figure: 14.10.5.1. Usage Statistics

14.10.6. Examples

Example for Use Faceted Navigation to Explore Virtuoso hosted Linked Data

The following example demonstrates a simple scenario of tracking Kingsley Idehen's conversations across the Web, using the Virtuoso Faceted Browser hosted on LOD.

  1. Go to http://lod.openlinksw.com/fct/
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  2. Enter a free text search pattern (for example, "Kingsley Idehen"), and click Search
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  3. Your initial query results page will display a list of literal value snippets from property values associated with the query text pattern
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  4. Using the Navigation section on the right, click on "Types", which alters the contents of the query results area by presenting CURIE based hyperlinks for each of the Entity Types associated with Property values that contains the query text pattern
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  5. Click on the "foaf:Person" link to narrow the result set down to Entities of this Type, un-hatch the checkbox beside this link for Negation (filtering out) based on this Entity Type
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  6. You can filter further, by switching (pivoting) to the a Property based view, by returning to the Navigation section and then clicking on "Properties" or "Referencing Properties" links; in either case, you have further filtering of based on the combination of Properties and Entities where Entities in the result-set contain values matching the query text pattern
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  7. From the list of Property Types, click on the "foaf:interest" link to filter further, based on the values of this property
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  8. From the list of "foaf:interest" Values, click on "dbpedia:Linked_Data", which filters the result-set further to display reveal Entity Identifier Links (Generic HTTP URIs) and Labels for each "foaf:Person" associated with the property "foaf:interest", in the URIBurner data space.
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  9. Click on one of the HTTP URIs in the filtered results-set to obtain a detailed structured description of a given Entity. Each listed Property is a Link; thus, each Property is a link to other structured Entity descriptions
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  10. Click on "Usage Statistics" link to get a summary view of this Linked Data Space, "Reference" and "Source" graphs are akin to saying "Table X" and "Table Y" where each table is the container of Records re. RDBMS or Worksheet re. Spreadsheet.:
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
    Faceted Navigation Example
    Figure: 14.10.6.2. Faceted Navigation Example
  11. "Direct" and "In-Direct" co-references show other references (Identifiers) that relate associated with Kingsley Idehen (like saying: here are his other names or his know by this name in this other place)
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
    Faceted Navigation Example
    Figure: 14.10.6.2. Faceted Navigation Example
  12. Click on "Settings" check "owl:sameAs" and it sets a context mode for the session (meaning: a set of rules to take place)
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  13. Go back to the "Direct Co-reference" tab
    Faceted Navigation Example
    Figure: 14.10.6.1. Faceted Navigation Example
  14. As result each link will unveil a union (combination) of all the the data associated with all Kingsley Idehen's other Identifiers (other Names in other places), i.e., they all show the same data.