If you have resource types with the same object class and whose subtrees overlap, you can differentiate them through include filters. An entry is categorized as a given resource type only if the entry's attributes match the resource type's include filters.

You can create a new resource only if the resource attributes match the include filters for the type of resource being created.

For example, to differentiate between two kinds of organizationalUnit resources stored in the same subtree, run the following commands.

$ bin/dsconfig create-constructed-attribute \
  --attribute-name businessCategoryHotel \
  --set attribute-type:businessCategory \
  --set value-pattern:Hotel

$ bin/dsconfig create-constructed-attribute \
  --attribute-name businessCategoryCruiseLine \
  --set attribute-type:businessCategory \
  --set value-pattern:CruiseLine

$ bin/dsconfig create-rest-resource-type \
  --type-name Hotel \
  --set enabled:true \
  --set resource-endpoint:hotels \
  --set "display-name:Hotel" \
  --set structural-ldap-objectclass:organizationalUnit \
  --set search-base-dn:dc=example,dc=com \
  --set parent-dn:dc=example,dc=com \
  --set 'search-filter-pattern:(&(objectClass=organizationalUnit)(ou=%%))' \
  --set primary-display-attribute-type:ou \
  --set include-filter:(businessCategory=Hotel) \
  --set post-create-constructed-attribute:businessCategoryHotel

$ bin/dsconfig create-rest-resource-type \
  --type-name "Cruise Line" \
  --set enabled:true \
  --set resource-endpoint:cruiselines \
  --set "display-name:Cruise Line" \
  --set structural-ldap-objectclass:organizationalUnit \
  --set search-base-dn:dc=example,dc=com \
  --set parent-dn:dc=example,dc=com \
  --set 'search-filter-pattern:(&(objectClass=organizationalUnit)(ou=%%))' \
  --set primary-display-attribute-type:ou \
  --set include-filter:(businessCategory=CruiseLine) \
  --set post-create-constructed-attribute:businessCategoryCruiseLine