# Plans for RGG and descriptive phrases

**URL:** https://discourse.kitware.com/t/plans-for-rgg-and-descriptive-phrases/323
**Category:** Design
**Created:** [September 26, 2019, 6:22pm UTC](https://discourse.kitware.com/t/plans-for-rgg-and-descriptive-phrases/323 "2019-09-26T18:22:40Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![dcthomp](https://discourse.kitware.com/user_avatar/discourse.kitware.com/dcthomp/32/10_2.png) [@dcthomp](https://discourse.kitware.com/u/dcthomp)
#### Post date: [September 26, 2019, 8:18pm UTC](https://discourse.kitware.com/t/plans-for-rgg-and-descriptive-phrases/323/3 "2019-09-26T20:18:59Z")

</div>

> [@Haocheng\_Liu](#):
>
> Do yo mean that `QueryPhraseModel` should be a generic class that can be reused by other sessions?

Yes.

> [@Haocheng\_Liu](#):
>
> As a result RGGSubphraseGenerator is just a subclass user who uses the API defined in this class?

You should not need to write an RGGSubphraseGenerator class. Instead the rgg session will provide `<View>...</View>` configuration XML that tells the QueryPhraseModel what to do. For example, we might have

```xml
<View Type="DescriptivePhrase" TopLevel="true" AllowSortFilter="true">
  <PhraseModel Type="RGGPhraseModel"/>
  <SubphraseGenerator Type="QueryPhraseModel">
    <MapPhrase ParentTitle="pins">
      <Resource Type="smtk::session::rgg::Resource" 
        Filter="aux_geom[string{'rgg_type'='pin'}]"/>
   </MapPhrase>
    <MapPhrase ParentTitle="ducts">
      <Resource Type="smtk::session::rgg::Resource" 
        Filter="aux_geom[string{'rgg_type'='duct'}]"/>
   </MapPhrase>
    <MapPhrase ParentTitle="assemblies">
      <Resource Type="smtk::session::rgg::Resource" 
        Filter="group[string{'rgg_type'='assembly'}]"/>
   </MapPhrase>
    <MapPhrase ParentTitle="cores">
      <Resource Type="smtk::session::rgg::Resource" 
        Filter="group[string{'rgg_type'='core'}]"/>
   </MapPhrase>
  </SubphraseGenerator>
</View>

```

(The filter strings are discussed here: [Query filter strings for model resources](https://discourse.kitware.com/t/query-filter-strings-for-model-resources/242) .)

---

_[View the full topic](https://discourse.kitware.com/t/plans-for-rgg-and-descriptive-phrases/323)._
