Partilhar via


Relationship.GetRelationship Method

Definition

Overloads

GetRelationship(String, Nullable<Boolean>, RequestContext)

[Protocol Method] Get relationship information between entities by its GUID.

GetRelationship(String, Nullable<Boolean>, CancellationToken)

Get relationship information between entities by its GUID.

GetRelationship(String, Nullable<Boolean>, RequestContext)

Source:
Relationship.cs

[Protocol Method] Get relationship information between entities by its GUID.

public virtual Azure.Response GetRelationship (string guid, bool? extendedInfo, Azure.RequestContext context);
abstract member GetRelationship : string * Nullable<bool> * Azure.RequestContext -> Azure.Response
override this.GetRelationship : string * Nullable<bool> * Azure.RequestContext -> Azure.Response
Public Overridable Function GetRelationship (guid As String, extendedInfo As Nullable(Of Boolean), context As RequestContext) As Response

Parameters

guid
String

The globally unique identifier of the relationship.

extendedInfo
Nullable<Boolean>

Limits whether includes extended information.

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

guid is null.

guid 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 GetRelationship and parse the result.

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

Response response = client.GetRelationship("<guid>", null, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.ToString());

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

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

Response response = client.GetRelationship("<guid>", true, null);

JsonElement result = JsonDocument.Parse(response.ContentStream).RootElement;
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classificationNames")[0].ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("entityGuid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("entityStatus").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("removePropagationsOnEntityDelete").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("endTime").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("startTime").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("classifications")[0].GetProperty("validityPeriods")[0].GetProperty("timeZone").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("isIncomplete").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("labels")[0].ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meaningNames")[0].ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("confidence").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("description").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("displayText").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("expression").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("relationGuid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("steward").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("meanings")[0].GetProperty("termGuid").ToString());
Console.WriteLine(result.GetProperty("referredEntities").GetProperty("<key>").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("attributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("lastModifiedTS").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("createTime").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("createdBy").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("end1").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("end1").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("end1").GetProperty("uniqueAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("end2").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("end2").GetProperty("typeName").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("end2").GetProperty("uniqueAttributes").GetProperty("<key>").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("guid").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("homeId").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("label").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("provenanceType").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("status").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("updateTime").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("updatedBy").ToString());
Console.WriteLine(result.GetProperty("relationship").GetProperty("version").ToString());

Applies to

GetRelationship(String, Nullable<Boolean>, CancellationToken)

Source:
Relationship.cs

Get relationship information between entities by its GUID.

public virtual Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationshipWithExtInfo> GetRelationship (string guid, bool? extendedInfo = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GetRelationship : string * Nullable<bool> * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationshipWithExtInfo>
override this.GetRelationship : string * Nullable<bool> * System.Threading.CancellationToken -> Azure.Response<Azure.Analytics.Purview.DataMap.AtlasRelationshipWithExtInfo>
Public Overridable Function GetRelationship (guid As String, Optional extendedInfo As Nullable(Of Boolean) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Response(Of AtlasRelationshipWithExtInfo)

Parameters

guid
String

The globally unique identifier of the relationship.

extendedInfo
Nullable<Boolean>

Limits whether includes extended information.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

guid is null.

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

Examples

This sample shows how to call GetRelationship.

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

Response<AtlasRelationshipWithExtInfo> response = client.GetRelationship("<guid>");

This sample shows how to call GetRelationship with all parameters.

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

Response<AtlasRelationshipWithExtInfo> response = client.GetRelationship("<guid>", extendedInfo: true);

Applies to