如何按父母分组并收集gremlin中孩子的所有财产价值?

问题描述

我想将所有节目及其相关流派收集在一起。 GENRES是SHOWS的子关系

Sample gemlin graph 因此输出类似于:

"1" [a,b]
"2" [c,d]

示例图:https://gremlify.com/x8i8stszn2

解决方法

您可以使用Gremlin中的library(shiny) # Create the ui ui <- fluidPage( dateRangeInput(inputId = "date_input1",label = "Select Date Range 1",start = "2000-01-01",end = "2019-12-31",min = "2000-01-01",max = "2019-12-31"),verbatimTextOutput(outputId = "date_output1"),dateRangeInput(inputId = "date_input2",verbatimTextOutput(outputId = "date_output2") ) # Create the server server <- function(session = session,input = input,output = output){ # Update the date selection in date_input2 observe({ updateDateRangeInput(session = session,inputId = "date_input2",start = input$date_input1[[1]],end = input$date_input1[[2]],max = "2019-12-31") }) # Print the selected date output$date_output1 <- renderText({ paste(input$date_input1[[1]],input$date_input1[[2]],sep = " - ") }) output$date_output2 <- renderText({ paste(input$date_input2[[1]],input$date_input2[[2]],sep = " - ") }) } # Run the application shinyApp(ui = ui,server = server) step来完成此操作,

project()

这将返回如下格式的数据:

g.V("2789").out('WATCHED').hasLabel('SHOW').
project('show','genre').
  by('NAME').
  by(out('HAS_GENRE').values('NAME').fold())