Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/extjs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Gremlin 使用Jupyter笔记本查看海王星图模式_Gremlin_Amazon Sagemaker_Amazon Neptune_Gremlinpython - Fatal编程技术网

Gremlin 使用Jupyter笔记本查看海王星图模式

Gremlin 使用Jupyter笔记本查看海王星图模式,gremlin,amazon-sagemaker,amazon-neptune,gremlinpython,Gremlin,Amazon Sagemaker,Amazon Neptune,Gremlinpython,有没有办法使用Jupyter笔记本查看Neptune集群中的图形模式 就像您使用SQL在RDS中执行“select*from tablename limit 10”一样,是否有办法通过Jupyter笔记本获得图形数据的感觉?这取决于图形的大小以及执行效果,但您可以使用下面的示例来了解节点和边的类型。根据您使用的标签,我假设您使用的是Gremlin: g.V().groupCount().by(label) g.E().groupCount().by(label) 如果您有一个非常大的图形,请尝

有没有办法使用Jupyter笔记本查看Neptune集群中的图形模式


就像您使用SQL在RDS中执行“select*from tablename limit 10”一样,是否有办法通过Jupyter笔记本获得图形数据的感觉?

这取决于图形的大小以及执行效果,但您可以使用下面的示例来了解节点和边的类型。根据您使用的标签,我假设您使用的是Gremlin:

g.V().groupCount().by(label)
g.E().groupCount().by(label)
如果您有一个非常大的图形,请尝试在
groupCount
步骤之前添加类似
limit(100000)
的内容

如果您使用的是Python之类的编程语言(安装了gremlin Python),则需要在查询中添加
next()
终端步骤,如下所示:

g.V().groupCount().by(label).next()
g.E().groupCount().by(label).next()
找到标签和标签的分布后,您可以使用其中一个来探索一些属性。让我们想象有一个标签叫做“人”


请记住,对于Gremlin属性图,具有相同标签的顶点可能不一定具有所有相同的属性,因此最好查看多个顶点以了解这些属性。

如果要可视化图形,即要查看给定根节点下的所有子节点,然后您可以在jupyter笔记本单元中使用下面的gremlin查询

    %%gremlin -p v,e  
    g.V({label},{property},{value}) 
    .repeat(outE().inV()).until(outE().count().is(0)).path() 
    .by(valueMap({propertiesList})).by(label)
改变

  • {label}:顶点标签
  • {property}:要筛选的顶点属性
  • {value}:prop的值
  • {propertiesList}:要在图形中显示的顶点的属性列表

  • 查看此博客文章以获取示例:
        %%gremlin -p v,e  
        g.V({label},{property},{value}) 
        .repeat(outE().inV()).until(outE().count().is(0)).path() 
        .by(valueMap({propertiesList})).by(label)