Skip to content

Commit

Permalink
Fix: take name and description from different sources
Browse files Browse the repository at this point in the history
- description node
- dataResource node

Signed-off-by: Zoltan Magyari <[email protected]>
  • Loading branch information
Zoltan Magyari committed Oct 17, 2024
1 parent 63c400e commit f370cd5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/services/cypherQueryApiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit f370cd5

Please sign in to comment.