Share via


Glossary.GetRelatedTermsAsync Method

Definition

Overloads

GetRelatedTermsAsync(String, Nullable<Int32>, Nullable<Int32>, String, RequestContext)

[Protocol Method] Get all related terms for a specific term by its GUID. Limit, offset, and sort parameters are currently not being enabled and won't work even they are passed.

GetRelatedTermsAsync(String, Nullable<Int32>, Nullable<Int32>, String, CancellationToken)

Get all related terms for a specific term by its GUID. Limit, offset, and sort parameters are currently not being enabled and won't work even they are passed.

GetRelatedTermsAsync(String, Nullable<Int32>, Nullable<Int32>, String, RequestContext)

Source:
Glossary.cs

[Protocol Method] Get all related terms for a specific term by its GUID. Limit, offset, and sort parameters are currently not being enabled and won't work even they are passed.

public virtual System.Threading.Tasks.Task<Azure.Response> GetRelatedTermsAsync (string termId, int? limit, int? offset, string sort, Azure.RequestContext context);
abstract member GetRelatedTermsAsync : string * Nullable<int> * Nullable<int> * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.GetRelatedTermsAsync : string * Nullable<int> * Nullable<int> * string * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function GetRelatedTermsAsync (termId As String, limit As Nullable(Of Integer), offset As Nullable(Of Integer), sort As String, context As RequestContext) As Task(Of Response)

Parameters

termId
String

The globally unique identifier for glossary term.

limit
Nullable<Int32>

The page size - by default there is no paging.

offset
Nullable<Int32>

The offset for pagination purpose.

sort
String

The sort order, ASC (default) or DESC.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

termId is null.

termId is an empty string, and was expected to be non-empty.

Service returned a non-success status code.

Examples

This sample shows how to call GetRelatedTermsAsync and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

Response response = await client.GetRelatedTermsAsync("<termId>", null, null, null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("<key>")[0].ToString());

This sample shows how to call GetRelatedTermsAsync with all parameters and parse the result.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient(apiVersion: "2023-09-01");

Response response = await client.GetRelatedTermsAsync("<termId>", 1234, 1234, "<sort>", null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("<key>")[0].GetProperty("termGuid").ToString());

Applies to

GetRelatedTermsAsync(String, Nullable<Int32>, Nullable<Int32>, String, CancellationToken)

Source:
Glossary.cs

Get all related terms for a specific term by its GUID. Limit, offset, and sort parameters are currently not being enabled and won't work even they are passed.

public virtual System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyDictionary<string,System.Collections.Generic.IList<Azure.Analytics.Purview.DataMap.AtlasRelatedTermHeader>>>> GetRelatedTermsAsync (string termId, int? limit = default, int? offset = default, string sort = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRelatedTermsAsync : string * Nullable<int> * Nullable<int> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IList<Azure.Analytics.Purview.DataMap.AtlasRelatedTermHeader>>>>
override this.GetRelatedTermsAsync : string * Nullable<int> * Nullable<int> * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<System.Collections.Generic.IReadOnlyDictionary<string, System.Collections.Generic.IList<Azure.Analytics.Purview.DataMap.AtlasRelatedTermHeader>>>>
Public Overridable Function GetRelatedTermsAsync (termId As String, Optional limit As Nullable(Of Integer) = Nothing, Optional offset As Nullable(Of Integer) = Nothing, Optional sort As String = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of IReadOnlyDictionary(Of String, IList(Of AtlasRelatedTermHeader))))

Parameters

termId
String

The globally unique identifier for glossary term.

limit
Nullable<Int32>

The page size - by default there is no paging.

offset
Nullable<Int32>

The offset for pagination purpose.

sort
String

The sort order, ASC (default) or DESC.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

termId is null.

termId is an empty string, and was expected to be non-empty.

Examples

This sample shows how to call GetRelatedTermsAsync.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient();

Response<IReadOnlyDictionary<string, IList<AtlasRelatedTermHeader>>> response = await client.GetRelatedTermsAsync("<termId>");

This sample shows how to call GetRelatedTermsAsync with all parameters.

Uri endpoint = new Uri("<https://my-service.azure.com>");
TokenCredential credential = new DefaultAzureCredential();
Glossary client = new DataMapClient(endpoint, credential).GetGlossaryClient(apiVersion: "2023-09-01");

Response<IReadOnlyDictionary<string, IList<AtlasRelatedTermHeader>>> response = await client.GetRelatedTermsAsync("<termId>", limit: 1234, offset: 1234, sort: "<sort>");

Applies to