# Aspect Tree Query


# Description

An aspect tree request is very similar to a basic aspect query request where you specify an aspect and it returns the facets, except this time you are able to provide multiple aspects into the request to produce a tree of results.

# Benefits of Aspect Tree Request

Aspect tree queries allow you to see relating child aspects and their facets in a simplified format, which will enable you to easily implement them into your website in the form of drop-down menus. It provides an easy way to visualise the aspects.

# Syntax

at=\<Aspect1>,\<Aspect2>,...,\<AspectN>|<AspectDisplayNameKey>

Note that the more aspects that are provided, the slower the result will be generated.

# Attributes

Note: all attributes marked with * are required.

  • Aspect 1-N
    • The list of aspects to be placed into the tree result.
  • Aspect display name key
    • The key that determines which set of aspect display names to use. This is configured in the Navigation Display Name section
    • If it is not specified, the aspect name will be used

# Example One

# Query

?at=Genre,Series|Spanish

# Result

{
  "Aspect":"Genre",
  "Facet":"Adventure Fiction",
  "AspectDisplayName": "Género",
  "ChildNodes":[
    {
      "Aspect":"Series",
      "AspectDisplayName": "Serie",
      "Facet":"Jojo's Bizarre Adventure"
    }
  ]
},

# Explanation

In this result the first aspect is shown as the parent, with child nodes that relate to that first aspect below, this, in turn, creates the tree structure.


# Example Two

# Query

?at=Genre,Series,Author|spanish

# Result

{
  "Aspect":"Genre",
  "AspectDisplayName": "Género",
  "Facet":"Adventure Fiction",
  "ChildNodes":[
    {
      "Aspect":"Series",
      "AspectDisplayName": "Género",
      "Facet":"Jojo's Bizarre Adventure"
    }
  ]
},
{
  "Aspect":"Author",
  "AspectDisplayName": "Autora",
  "Facet":"Junji Ito",
},
{
  "Aspect":"Author",
  "AspectDisplayName": "Autora",
  "Facet":"J.K. Rowling",
}

# Explanation

Because The Aspect Author is not related to the Genre at all, it appears in its own section down the bottom of the list and doesn't contain any child nodes


# Example Three

# Query

?at=Genre,Series

# Result

{
  "Aspect":"Genre",
  "AspectDisplayName": "Genre",
  "Facet":"Adventure Fiction",
  "ChildNodes":[
    {
      "Aspect":"Genre",
      "AspectDisplayName": "Genre",
      "Facet":"Jojo's Bizarre Adventure"
    }
  ]
},

# Explanation

No aspect display name key is specified here. Therefore, the aspect name will be shown as AspectDisplayName.