Back to The Blog

Faceted Search

A console extension for data exploration and querying in RDFox

A console extension for data exploration and querying in RDFox

RDFox Faceted Search and Console

RDFox v3.1.0 introduced the ability to serve extensions to built-in functionality, and Faceted Search is the first extension to take advantage of this feature.

Faceted Search enables the navigation of graph data via a successive refinement approach, which is similar in principle to e-commerce websites, where the available products may be filtered by applying a series of constraints. For example, for a website selling televisions, the variety of televisions available for purchase may be refined down to a small set by stipulating the screen-size, then the manufacturer, and then a feature such as 4K resolution.

However, although Faceted Search enables such refinement, it is not limited to a pre-defined set of properties, and is also graph-aware. This enables filters to be applied not just to top-level properties of objects in a graph, but to the properties of objects that are the targets of the top-level properties, and in turn down the entire hierarchy of properties and objects.

Using Faceted Search

Faceted Search shows the results of applying a set of filters to the data in a graph, and is oriented around guiding the user to produce a set of results, and so removes options and selections that are contradictory.

The first filter allows the selection of a set of types, which defines a set of valid objects. The properties available from this set of objects define the next level of filterable properties.

This second level may be filtered by choosing any available property or properties desired, and selecting the allowed values for the objects that are the targets of these properties. This process may carry on to any depth desired.

The allowed values within a filter for a given property are alternatives, and so are OR-ed together (the property may take any of the selected values).

The set of filters for properties at the same level are AND-ed together (filters on different properties must all be satisfied to produce results).

In this way we could choose, say, Person as the only top-level type allowed, and the residesInCountry property to have values UK or Germany or USA, and the dateOfBirth property to be greater than 1950–01–01. This selection equates to “find me all people who reside in the UK or Germany or the USA, who were also born after the 1st January 1950”.

An example of following a property hierarchy is to choose Person as the top-level type, and not to specify a direct value for the residesInCountry property. Instead the value France could be specified for the hasBorderWith property nested under residesInCountry. This selection equates to “find me all people who were born in a country that has a border with France”.

Faceted Search — nested properties
Faceted Search — nested properties

Finally, more complex queries may be constructed by selecting values at different levels. The allowed values within a filter for a given property, and the set of any nested property filters are OR-ed together (any of the selected values, or something that satisfies all the property filters).

An example would be to find people who reside in the USA, or in some country that has a border with France.

The first image in this article shows another such query, where values are selected at different levels.

Faceted Search Interface

Faceted Search allows the selection of filter values either individually via check-boxes, or if numeric or a date, via a slider or date range picker. These range elements are only shown if there are three or more values.

Faceted Search — slider feature
Faceted Search — slider feature
Faceted Search — date picker feature
Faceted Search — date picker feature

When initially loaded, the user is prompted to choose a datastore in the associated RDFox instance by typing a datastore name into a dialog box. To subsequently switch to a different datastore, click on the “Options” link to open the dialog box again.

Faceted Search Queries

In order to avoid excessive data being held in the browser, the number of types, number of properties at any given depth, and number of values for each property are limited. If this limit is reached, a warning is shown. Range limits are derived from the values in the loaded data.

Once a selection is made, Faceted Search issues a SPARQL query to RDFox to obtain the results displayed. This query is over all data held in RDFox in the chosen datastore, though also with a limit on the number of results to prevent excessive amounts of data being passed to the browser. If this limit is reached a warning is shown. The query may be shown in the RDFox console by clicking on the “SPARQL” link above the results in the Faceted Search interface.

Faceted Search — generated SPARQL query
Faceted Search — generated SPARQL query

Installation

The Faceted Search console extension requires an RDFox v3.1.0 or later installation.

To add Faceted Search to RDFox, download the Faceted Search console extension zip (a link is available on the Faceted Search webpage on our website). Unzip it, and place the resulting directory (which should be called “fsearch”) into a directory named “console-extensions” in an RDFox server directory. The Faceted Search directory name should not be changed from “fsearch” to a different value.

For example, on macOS or linux a possible location is,

~/.RDFox/console-extensions/fsearch

or on Windows a possible location is,

C:\users\my-user-name\AppData\Local\RDFox\console-extensions\fsearch

See the RDFox documentation at docs.oxfordsemantic.tech for more details on specifying alternative server directory locations when using RDFox.

Once the RDFox server is started, and the endpoint started, Faceted Search is available at the /console-extensions/fsearch/ path. For example, if using a local machine and the default RDFox endpoint port:

http://localhost:12110/console-extensions/fsearch/

Further examples

For more information on how faceted search could be harnessed by e-commerce sites, read our article about how dynamic website navigation can be used to find the perfect coffee

To find out how RDFox can power faceted search for your business, contact us at info@oxfordsemantic.tech, or click here to request an evaluation license.

...

The Team and Resources

The team behind Oxford Semantic Technologies started working on RDFox in 2011 at the Computer Science Department of the University of Oxford with the conviction that flexible and high-performance reasoning was a possibility for data-intensive applications without jeopardising the correctness of the results. RDFox is the first market-ready knowledge graph designed from the ground up with reasoning in mind. Oxford Semantic Technologies is a spin-out of the University of Oxford and is backed by leading investors including Samsung Venture Investment Corporation (SVIC), Oxford Sciences Innovation (OSI) and Oxford University’s investment arm (OUI). The author is proud to be a member of this team.