我们如何在 docker 上运行 Neptune 图形数据库
由于 Neptune DB 最近已产品化,因此在 Localstack 上不可用,有人可以指导我如何将 AWS Neptune DB Service 部署到 docker 容器中
amazon-web-services docker docker-compose amazon-neptune localstack
我正在尝试从办公室的本地计算机连接到AWS Instance中的Neptune DB,就像从办公室连接RDS。是否可以从本地计算机连接Neptune db?Neptune db是公开可用的吗?开发人员可以通过任何方式从办公室连接neptune db。
Gremlin和SPARQL都有多种可视化选项。Amazon Neptune经过测试的可视化选项有哪些?
我想像以下那样建立合作伙伴关系模型,我以标签属性图的格式表示。
我想使用RDF语言来表达上面的图形,特别是我想了解是否可以表达“ loves”边缘的标签(这是文章/字母的URI)。
我是RDF的新手,我知道RDF可以轻松表示LPG中的节点属性,但是可以方便地表示边缘属性吗?
这个问题的背景更多:我想使用RDF(而不是Gremlin)的原因是,从长远来看,我想添加一些推理功能。
进一步增加的问题:如果我们选择一个RDF模型来用简单的英语表示上述LPG,我想用SPARQL查询来回答以下问题:
查询SPARQL语句有多复杂loveletters.com/123
?
大多数SPARQL端点都有一些允许全文搜索的扩展.我可以使用Amazon Neptune SPARQL端点进行全文搜索吗?
我正在使用 Amazon Neptune 创建和查询一个简单的图形数据库。我目前正在 AWS Jupyter Notebook 中运行我的代码,但最终会将代码移至 Python (gremlin_python)。正如您可能猜到的那样,我对 Gremlin 和一般图形数据库很陌生。
我有以下数据
g.addV('person').property(id, 'john')
.addV('person').property(id, 'jim')
.addV('person').property(id, 'pam')
.addV('game').property(id, 'G1')
.addV('game').property(id, 'G2')
.addV('game').property(id, 'G3').iterate()
g.V('john').as('p').V('G1').addE('bought').from('p').iterate()
g.V('john').as('p').V('G2').addE('bought').from('p').iterate()
g.V('john').as('p').V('G3').addE('bought').from('p').iterate()
g.V('jim').as('p').V('G1').addE('bought').from('p').iterate()
g.V('jim').as('p').V('G2').addE('bought').from('p').iterate()
g.V('pam').as('p').V('G1').addE('bought').from('p').iterate()
Run Code Online (Sandbox Code Playgroud)
数据库中有 3 个人和 3 个游戏。我的目标是,给定一个人,告诉我哪些人购买了与他们相同的游戏,哪些游戏是那些
查看示例代码(主要来自https://tinkerpop.apache.org/docs/current/recipes/#recommendation)后,我有以下代码尝试查找由以下用户购买的游戏
g.V('john').as('target') Target person we are interested in comparing against
.out('bought').aggregate('target_games') // Games bought by target
.in('bought').where(P.neq('target')).dedup() // Persons who bought same games as target (excluding target and without duplicates)
.group().by().by(out("bought").where(P.within("target_games")).count()) // Find persons, group by number of co owned games
.unfold().order().by(values, …
Run Code Online (Sandbox Code Playgroud) 在AWS Neptune文档中,它表示它与Apache TinkerPop Gremlin兼容,但它仅涉及在线事务处理(OLTP)类型的图遍历查询.我还没有看到任何关于长期运行的在线分析处理(OLAP)GraphComputer查询.
是否可以对存储在AWS Neptune图数据库服务中的图形执行OLAP查询?
因此,SPARQL 文档包含如何指定多个要搜索的字段的示例:
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX neptune-fts: <http://aws.amazon.com/neptune/vocab/v01/services/fts#>
SELECT * WHERE {
SERVICE neptune-fts:search {
neptune-fts:config neptune-fts:endpoint 'http://your-es-endpoint.com' .
neptune-fts:config neptune-fts:queryType 'query_string' .
neptune-fts:config neptune-fts:query 'mikael~ OR rondelli' .
neptune-fts:config neptune-fts:field foaf:name .
neptune-fts:config neptune-fts:field foaf:surname .
neptune-fts:config neptune-fts:return ?res .
}
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试做同样的事情,但在 Gremlin 中:
g.withSideEffect('Neptune#fts.endpoint', '...')
.V().has(['name', 'company'], 'Neptune#fts term*')
Run Code Online (Sandbox Code Playgroud)
这显然行不通。现在我可以像这样使用通配符:
g.withSideEffect('Neptune#fts.endpoint', '...')
.V().has('*', 'Neptune#fts term*')
Run Code Online (Sandbox Code Playgroud)
但是现在我正在匹配所有字段,但它失败了,因为我们的索引太多了。(我认为限制为 1,024。)
知道如何指定要在 Gremlin 查询中搜索的字段列表吗?
我目前正在将 Aws Appsync、Aws Lambda 和 Aws Neptune 用于应用程序。我的 Lambda 函数使用 NodeJS 12。现在我的问题是当我进行突变并最终进行查询(我想确保突变是先工作)。例如:
当我运行此测试查询以添加帖子时,出现以下数据为空的错误:addPost测试查询和结果
在 gremlin 中添加顶点是否返回数据/对象?如果是这样,我如何为我的 appsync graphql api 获取适当的 JSON 格式?我一直在阅读实用小精灵并在网上搜索,但没有运气。先感谢您。
amazon-web-services aws-lambda graphql aws-appsync amazon-neptune
当我部署 CloudFormation Stack 时,我收到以下错误:
在请求中发现重复的标签键:名称(服务:AmazonNeptune;状态代码:400;错误代码:InvalidParameterCombination;请求 ID:ffffc8f8-ac83-4eb0-8794-47c6f5ff5ed1;代理:null)
仅当我使用多个堆栈模板进行部署时才会发生此错误。如果我自行部署失败的模板(子子堆栈),那么它将成功。仅当此堆栈是我的其他模板的子项时才会失败。
有多层。我有包含多个子堆栈的根堆栈(其中一个是neptune-application-map.yaml
),然后我有一个子子堆栈(neptune.yaml
这是一个 NeptuneStack 资源)。子子堆栈是失败的堆栈。
请注意,此错误发生在失败堆栈(此子子堆栈)中的多个资源上。发生此错误的资源是:
由于有可选的,我尝试删除它们,但是对于NeptuneDBCluster
同一子子堆栈中的 Resource再次出现相同的错误。
在这里,我附上 yaml 以供参考。
neptune-application-map.yaml
AWSTemplateFormatVersion: '2010-09-09'
Description: Neptune full stack with gremlin and rd4j console
Parameters:
Environment:
Description: dev/staging/prod
Type: String
AllowedValues: ["dev", "staging", "prod"]
MaxLength: 15
SubnetIds:
Type: "List<AWS::EC2::Subnet::Id>"
Description: Neptune VPC Subnets
DefaultSecurityGroupId:
Type: AWS::EC2::SecurityGroup::Id
VpcId:
Type: AWS::EC2::VPC::Id
DbInstanceType:
Description: Neptune DB instance type
Type: String
Default: db.r5.large
AllowedValues:
- db.t3.medium
- db.r4.large
- db.r4.xlarge
- …
Run Code Online (Sandbox Code Playgroud) amazon-neptune ×10
gremlin ×4
aws-appsync ×1
aws-lambda ×1
docker ×1
graph ×1
graphql ×1
localstack ×1
olap ×1
python-3.x ×1
rdf ×1
sparql ×1