gremlin

沃尔玛的产品知识图谱

那年仲夏 提交于 2020-08-11 04:02:07
作者|Karthik Deivasigamani 编译|VK 来源|Medium 介绍 电子商务目录是通过从卖家、供应商/品牌获取数据而创建的。合作伙伴(销售商、供应商、品牌)提供的数据往往不完整,有时会遗漏我们客户正在寻找的关键信息。尽管合作伙伴遵循一个规范(一种发送产品数据的约定格式),但在标题、描述和图像中隐藏着大量数据。除了我们的合作伙伴提供的数据外,互联网上还有许多非结构化数据,如产品手册、产品评论、博客、社交媒体网站等。 沃尔玛正致力于构建一个零售图谱(Retail Graph),捕捉有关产品及其相关实体的知识,以帮助我们的客户更好地发现产品。它是一个产品知识图谱,可以在零售环境中回答有关产品和相关知识的问题,可用于语义搜索、推荐系统等。本文进一步阐述了什么是零售图谱、如何构建零售图谱、围绕图模型的技术选择、数据库和一些用例。 沃尔玛的零售图谱是什么 零售图谱捕获了零售世界中存在的产品和实体之间的连接。实体是存在的物体、事物、概念或抽象,例如客厅、野生动物摄影、颜色、农舍风格。我们关注的实体大致有两种:抽象的和具体的。前者帮助我们回答诸如“夏日游泳池派对用品”、“农家客厅家具”、“野生动物摄影镜头”之类的问题,而后者帮助我们回答诸如“蓝色牛仔裤裤子”、“木制餐桌”之类的问题。该图谱还将产品之间的关系捕获到两个类别,替代品和补充品(附件、兼容产品等)。它还试图将抽象概念

沃尔玛的产品知识图谱

若如初见. 提交于 2020-08-08 07:25:17
作者|Karthik Deivasigamani 编译|VK 来源|Medium 介绍 电子商务目录是通过从卖家、供应商/品牌获取数据而创建的。合作伙伴(销售商、供应商、品牌)提供的数据往往不完整,有时会遗漏我们客户正在寻找的关键信息。尽管合作伙伴遵循一个规范(一种发送产品数据的约定格式),但在标题、描述和图像中隐藏着大量数据。除了我们的合作伙伴提供的数据外,互联网上还有许多非结构化数据,如产品手册、产品评论、博客、社交媒体网站等。 沃尔玛正致力于构建一个零售图谱(Retail Graph),捕捉有关产品及其相关实体的知识,以帮助我们的客户更好地发现产品。它是一个产品知识图谱,可以在零售环境中回答有关产品和相关知识的问题,可用于语义搜索、推荐系统等。本文进一步阐述了什么是零售图谱、如何构建零售图谱、围绕图模型的技术选择、数据库和一些用例。 沃尔玛的零售图谱是什么 零售图谱捕获了零售世界中存在的产品和实体之间的连接。实体是存在的物体、事物、概念或抽象,例如客厅、野生动物摄影、颜色、农舍风格。我们关注的实体大致有两种:抽象的和具体的。前者帮助我们回答诸如“夏日游泳池派对用品”、“农家客厅家具”、“野生动物摄影镜头”之类的问题,而后者帮助我们回答诸如“蓝色牛仔裤裤子”、“木制餐桌”之类的问题。该图谱还将产品之间的关系捕获到两个类别,替代品和补充品(附件、兼容产品等)。它还试图将抽象概念

How to Perfrom Where Filter in Gremlin queries

天涯浪子 提交于 2020-07-23 06:52:36
问题 where(​ and​ (​ choose(constant(0).is(1),​ select('WorkLocation'). is(within('Not Updated')),​ select('WorkLocation')),​ ​ choose(constant(1).is(1),​ select('Status'). is(within('Red', 'Orange')),​ select('Status')),​ ​ choose(constant(0).is(1),​ select('ConfirmationDate'). is(between(637281491635663900, 637258237221895200)),​ select('ConfirmationDate'))​ )​ ) In the Above Where condition Query, I have to do a filter on three fields WorkLocation, Status, ConfirmationDate, I have used choose

How to Perfrom Where Filter in Gremlin queries

戏子无情 提交于 2020-07-23 06:51:17
问题 where(​ and​ (​ choose(constant(0).is(1),​ select('WorkLocation'). is(within('Not Updated')),​ select('WorkLocation')),​ ​ choose(constant(1).is(1),​ select('Status'). is(within('Red', 'Orange')),​ select('Status')),​ ​ choose(constant(0).is(1),​ select('ConfirmationDate'). is(between(637281491635663900, 637258237221895200)),​ select('ConfirmationDate'))​ )​ ) In the Above Where condition Query, I have to do a filter on three fields WorkLocation, Status, ConfirmationDate, I have used choose

How to mock a gremlin server or create in-memory graph for unit testing?

六眼飞鱼酱① 提交于 2020-07-19 04:32:19
问题 I'm using Gremlin.Net and I want to write unit tests for the functions that query the database. I want the queries to run on a mock data, to see if the result is being converted correctly to my desired format, especially with Traverser.Object that has a dynamic type. Is there any way I can achieve this? Maybe run a server in code or have an in-memory instance of graph. Here's a toy example: var query = graphTraversalSource.V(leafIds).As("leaf") .Emit(__.HasLabel("root")) .As("root") .Repeat(

How to mock a gremlin server or create in-memory graph for unit testing?

丶灬走出姿态 提交于 2020-07-19 04:29:23
问题 I'm using Gremlin.Net and I want to write unit tests for the functions that query the database. I want the queries to run on a mock data, to see if the result is being converted correctly to my desired format, especially with Traverser.Object that has a dynamic type. Is there any way I can achieve this? Maybe run a server in code or have an in-memory instance of graph. Here's a toy example: var query = graphTraversalSource.V(leafIds).As("leaf") .Emit(__.HasLabel("root")) .As("root") .Repeat(

Upgrading to AnonymousTraversalSource ( Gremlin 3.3.5+ Node.js)

不羁岁月 提交于 2020-07-09 03:15:27
问题 I'm writing code in Lamda Nodejs12.x I wanted to update to the not-deprecated way of connecting const gremlin = require('gremlin'); const DriverRemoteConnection = gremlin.driver.DriverRemoteConnection; const traversal = gremlin.process.AnonymousTraversalSource.traversal; const clusterEndpoint = process.env.CLUSTER_ENDPOINT; const port = process.env.CLUSTER_PORT; const connectionStrArray = []; connectionStrArray.push("wss://"); connectionStrArray.push(clusterEndpoint); connectionStrArray.push(

can we relate a property with other property of same vertex

我的未来我决定 提交于 2020-06-29 03:21:29
问题 A sample vertex g.addV('a').property('vehicle','v1').property('time',1000).property(list,'vehicle','v2').property(list,'time',830) how can we map the values in property 'vehicle' to the values in property 'time'. I tired the following code g.V(1).hasKey('vehicle').map(hasKey('time')) To find path I tired following code g.V().hasLabel('a').repeat(out().simplePath()).until(hasLabel('h')).path().by(union(label(),values('vehicle','time')).fold()) can you help me please 回答1: Changing the data

can we relate a property with other property of same vertex

孤人 提交于 2020-06-29 03:21:23
问题 A sample vertex g.addV('a').property('vehicle','v1').property('time',1000).property(list,'vehicle','v2').property(list,'time',830) how can we map the values in property 'vehicle' to the values in property 'time'. I tired the following code g.V(1).hasKey('vehicle').map(hasKey('time')) To find path I tired following code g.V().hasLabel('a').repeat(out().simplePath()).until(hasLabel('h')).path().by(union(label(),values('vehicle','time')).fold()) can you help me please 回答1: Changing the data

gremlin intersection operation

与世无争的帅哥 提交于 2020-06-28 05:16:17
问题 I'm using the gremlin console v3.3.1. Using the "Modern" graph from the tutorial: http://tinkerpop.apache.org/docs/current/tutorials/getting-started/ Creating the graph with this: gremlin>graph = TinkerFactory.createModern() gremlin>g = graph.traversal() I can find all the people that know "vadas" like this: g.V().hasLabel('person').has('name', 'vadas').in('knows').hasLabel('person').valueMap() And I can find all the people that created the software "lop" with this: g.V().hasLabel('software')