What is Faceted Search?

Faceted search is a method of searching through data by using facets, I.e. attributes in the data, to gradually filter down a large selection of data to a smaller one that we are looking for.

Usually, the user of faceted search will write text in a search bar, and the faceted search UI will display all relevant data where the text occurs.
Then there will be some boxes with facets, that can be ticked to find the correct data.

You will have seen this on most web interfaces, e.g. Amazon

Above, we searched for ‘Moka’, and we then have some features we can use to filter, e.g. brand, cost, material, rating etc.

So what?

Knowledge graphs are particularly suited for faceted search as it happens. Why?
With 3 simple (and fast) queries we can populate the interface:

1-

SELECT DISTINCT ?type
WHERE {
?item a ?type ;
rdfs:label ?label .
FILTER(CONTAINS(?label, “Moka”)
}

This tells us what kinds of items we can choose from, so looking for “Moka” might return ‘coffee maker’, but also ‘book’ (books about mokas), ‘coffee’ (coffee ground for mokas), ‘clothes’ (in the moka colour) etc.

2-

SELECT DISTINCT ?p
WHERE {
?item a :CoffeeMaker;
?p ?o ;
rdfs:label ?label .
FILTER(CONTAINS(?label, “Moka”)

}

This tells us the facets we can use to filter on, e.g. brand, material, condition.

3- Finally we want to see the actual items that are available matching our search parameters?

SELECT ?item
WHERE {
?item a :CoffeeMaker;
:brand :Alessi ;
:material :steel ;
rdfs:label ?label .
FILTER(CONTAINS(?label, “Moka”)
}


In SQL this would be much more complicated.

Furthermore, what if we want to go even deeper in our search?
Maybe we don’t care exactly what brand our moka is, so long as it’s Italian and from a small artisan brand.

IN SPARQL, this looks like this:

SELECT ?item
WHERE {
?item a :CoffeeMaker;
:brand ?brand ;
rdfs:label ?label .
FILTER(CONTAINS(?label, “Moka”)
?brand :employees ?employees ;
:country :Italy .
FILTER(?employees < 50)
}


Of course, at every stage, we will want to see the facets that we can choose from when looking at brands. Not only that, because the available brands will already be filtered to brands that sell coffee makers, we will only see facets that apply.
So for coffee maker brands we might see if they adhere to certain workplace safety requirements for factories, but for food brands we might see if they signed a pact against, say, animal cruelty, which would make no sense for a coffee maker brand.

Hence our interface is completely data driven.

To provide the performance it needs, we offer a faceted search powered by a knowledge graph, a graph database and semantic reasoner.

Down arrow icon.