API
  • API Index
  • Batch API
  • Content Negotiation
  • Dynamic Paths
  • Hierarchy API
  • List API
  • Quick Reference
  • Time Series API
  • Views
    • Configuration
  • Overview
  • Application Configuration
  • Documentation Configuration
  • Spec Configuration
    • Features
  • API Testing
  • Asynchronous Processing
  • Cassandra Time-Series Engine
  • Cassandra Integration
  • Default Controller Customisation
  • Documentation
  • Geospatial Filtering
  • Model Documentation
  • PostgreSQL Integration
  • Excel Spreadsheet Format
    • Tutorials
  • Step-by-Step Guide
  • Archetype Setup
  • Logging
  • Prometheus
  • Sentry Logging
    • UI Customisation
  • UI Customisation
  • SASS Build Chain
  • Shared Layout
  • API Documentation
  • Model Documentation
  • Results
  • sapi-nt v current

    Dynamic Paths

    Recursive Properties

    When a property’s range is the same as its domain (ie. its values are resources of the same type as the original subject), sapi-nt treats the property as recursive.

    When supplying a filter or projection parameter, you can use recursive properties in the same way as non-recursive properties in property paths, or you can use them to specify recursive or inverse property paths.

    Recursive Paths

    Recursive property paths traverse the recursive relationship an indefinite number of times, and a resource satisfies the filter if any of the values in that chain match the filter criteria.

    The types of recursion are “one or more” and “zero or more”, given by the suffixes + and * respectively. These reflect the recursive path functionality defined in the SPARQL query language.

    To specify that a relationship in a property path is recursive, append the suffix to the name of the property.

    Example

    For example, the request parameter:

    region.broader+.label=England
    

    specifies a property path, region.broader+.label where the broader relationship is recursive. This filter will match any resource whose region has a broader ancestor with the label “England”.

    Alternatively, the filter given by:

    region.broader*.label=England
    

    will also match resources whose region itself has the label “England”.

    Inverse Paths

    Similarly to recursive paths, when a property is considered recursive, you can optionally specify the inverse of the property in a filter or projection path.

    Inverted properties are denoted by the ~ token preceding the property name. This is analogous to the ^ token in the SPARQL query language.

    Example

    For example, the request parameter:

    region.~broader.label=England
    

    specifies a property path region.~broader.label where the broader relationship is recursive. This filter will match any resource whose region is the broader value of a resource labelled “England” (eg. the parent of that resource in a hierarchy).