У меня есть запрос на шифрование для получения данных о множестве узлов в базе данных grpah с узлами, такими как Company, Industry и Relations hasIndustry:
match (c:Company)-[r1:hasIndustry]->(ind:Industry)
where ind.Segment1 = 'Technology'
with
distinct c.Name as company_name ,c.CompanyType as CompanyType,c.Permalink as company_Permalink,
c.FoundedOnYear as company_FoundedOnYear,
c.Country as company_Country,
c.Region as company_Region,
c.City as company_City,
c.PEAcquired as company_PEAcquired,
c.EmployeeMin as company_EmployeeMin,
c.EmployeeMaxas as company_EmployeeMax,
[x in collect(distinct ind) | x.Segment2 +x.FundingMomentumCategory] as sector_details,
[x in collect(distinct ind) | x.Segment3 +x.FundingMomentumCategory] as industry_details,
[x in collect(distinct ind) | x.Segment4 +x.FundingMomentumCategory+x.IndustryMaturity] as subindustry_details
return distinct company_name,CompanyType,company_Permalink,
company_FoundedOnYear,
company_Country,
company_Region,
company_City,
company_PEAcquired,
company_EmployeeMin,company_EmployeeMax,
collect(distinct sector_details) as sector_details,
collect(distinct industry_details) as industry_details,
collect(distinct subindustry_details) as subindustry_details
, что дает мне вывод:
{
"company_name": "Olivia Greets",
"CompanyType": "Private",
"company_Permalink": "olivia-greets",
"company_FoundedOnYear": null,
"company_Country": "United States",
"company_Region": "Indiana",
"company_City": "Valparaiso",
"company_PEAcquired": null,
"company_EmployeeMin": 11,
"company_EmployeeMax": null,
"sector_details": [
[
"Artificial Intelligence (AI)High"
]
],
"industry_details": [
[
"Enterprise Chatbots and Virtual AssistantsHigh"
]
],
"subindustry_details": [
[
"Generic Virtual Personal AssistantHighAdolescent - Beyond Early Adoption"
]
]
}
Тем не менее, я хочу, чтобы результаты sector_details, industry_details, subindustry_details также были вложенными json. сектор, промышленность и подотрасль имеют свои свойства