From f370cd5237f31e05e57bd34a51c93412be9bf92f Mon Sep 17 00:00:00 2001 From: Zoltan Magyari Date: Thu, 17 Oct 2024 18:26:41 +0300 Subject: [PATCH] Fix: take name and description from different sources - description node - dataResource node Signed-off-by: Zoltan Magyari --- src/services/cypherQueryApiService.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/services/cypherQueryApiService.ts b/src/services/cypherQueryApiService.ts index eb832f57..2cd57bff 100644 --- a/src/services/cypherQueryApiService.ts +++ b/src/services/cypherQueryApiService.ts @@ -80,11 +80,11 @@ export const CypherQueryApiService = { OPTIONAL MATCH (dataResource)-[:general]-(general) OPTIONAL MATCH (general)-[:description]-(description) - WHERE properties(dataResource).uri IN properties(description).claimsGraphUri + WHERE description IS NULL OR properties(dataResource).uri IN properties(description).claimsGraphUri RETURN - properties(description).name AS name, - properties(description).description AS description, + coalesce(properties(description).name, properties(dataResource).name) AS name, + coalesce(properties(description).description, properties(dataResource).description) AS description, properties(dataResource).uri AS uri, properties(dataResource).claimsGraphUri AS claimsGraphUri, coalesce(properties(format).type, properties(format).formatType) AS format, @@ -105,11 +105,14 @@ export const CypherQueryApiService = { OPTIONAL MATCH (instantiatedVirtualResource)-[:serviceAccessPoint]-(serviceAccessPoint:ServiceAccessPoint) OPTIONAL MATCH (dataResource)-[:general]-(general:General) OPTIONAL MATCH (general)-[:data]-(data:Data) + OPTIONAL MATCH (general)-[:description]-(description:Description) - WHERE properties(dataResource).uri IN properties(data).claimsGraphUri + WHERE (data IS NULL OR properties(dataResource).uri IN properties(data).claimsGraphUri) + AND (description IS NULL OR properties(dataResource).uri IN properties(description).claimsGraphUri) WITH COUNT(*) AS totalCount, - properties(dataResource).name AS name, + coalesce(properties(description).name, properties(dataResource).name) AS name, + coalesce(properties(description).description, properties(dataResource).description) AS description, properties(dataResource).uri AS uri, labels(dataResource) AS labels, CASE