Skip to main content
Solved

How do we filter the terms (AOL) by relationship type

  • February 12, 2025
  • 4 replies
  • 45 views

Forum|alt.badge.img

Need support with AQL expression to filter terms based on a particular relationship type. Referring to Relations section under Glossary Terms.

 

 

Best answer by Lisa Kovalskaia

Hi โ€‹@sumisha, try this:

@termRelationship(target).any(type.$id='#relationship_type_id#') to find child terms in a given type of relationship

OR 

@termRelationship(source).any(type.$id='#relationship_type_id#') to find parent terms in a given type of relationship.

You'll notice the use of back references and aggregation operators in these queries, see the linked documentation pages for more details and examples.

To provide the relationship type id go to your environment's Global Settings ยป Relationship types ยป Click on the type and copy the GUID from the URL bar of your browser.

Is that what you were looking for? Let me know if you have a more specific use case that you're working on.

View original
Did this topic help you find an answer to your question?

4 replies

Lisa Kovalskaia
Ataccamer
Forum|alt.badge.img+3

Hi โ€‹@sumisha, try this:

@termRelationship(target).any(type.$id='#relationship_type_id#') to find child terms in a given type of relationship

OR 

@termRelationship(source).any(type.$id='#relationship_type_id#') to find parent terms in a given type of relationship.

You'll notice the use of back references and aggregation operators in these queries, see the linked documentation pages for more details and examples.

To provide the relationship type id go to your environment's Global Settings ยป Relationship types ยป Click on the type and copy the GUID from the URL bar of your browser.

Is that what you were looking for? Let me know if you have a more specific use case that you're working on.


Forum|alt.badge.img
  • Author
  • Data Pioneer
  • 16 replies
  • February 13, 2025

Thanks โ€‹@Lisa Kovalskaia That work! Thanks for your reply.

I have similar issue with AQL query, slightly different context:

In Metamodel, I have created a new โ€˜Termโ€™ Property as referenced object array and this points to โ€˜Sourceโ€™ metamodel entity, name property. How can I use AQL to filter particular Source?

 


Lisa Kovalskaia
Ataccamer
Forum|alt.badge.img+3

โ€‹@sumisha the following should work:

Source.any(name='#your_source#')

Please make sure to check your capitalization when you type it up - AQL search is case sensitive so entity/property names should match the metadata model exactly. On that note, as a best practice we recommend to stick with camel case across the metadata model to make spelling more predictable and to streamline the process of working with the model for everyone on the team. In this case, I'd name this referenced object array property sources  - using camel case and making it plural, to reflect this being an array rather than a single reference.

Just curious, what is the purpose this new property? Out of the box you can apply terms onto sources, but you want to do it the other way around - how will you use that? Thanks for sharing!


Forum|alt.badge.img
  • Author
  • Data Pioneer
  • 16 replies
  • February 17, 2025

Thanks for your support and guidance Lisa. I know what you are referring as right approach. Just trying a different approach here to get more exhaustive list than actual sources by creating list of sources as terms and linking them.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings