thoughtworks
为了获得圣诞节假期的乐趣,我认为在ThoughtWorks Technology Radar上创建不同点的图形以及建议随时间的变化是很酷的。
我编写了一个脚本来提取每个blip(例如.NET Core )以及在每个雷达中出现的建议。我最终得到了一个CSV文件 :
|----------------------------------------------+----------+-------------|
| technology | date | suggestion |
|----------------------------------------------+----------+-------------|
| AppHarbor | Mar 2012 | Trial |
| Accumulate-only data | Nov 2015 | Assess |
| Accumulate-only data | May 2015 | Assess |
| Accumulate-only data | Jan 2015 | Assess |
| Buying solutions you can only afford one of | Mar 2012 | Hold |
|----------------------------------------------+----------+-------------|
然后,我编写了Cypher脚本来创建以下图形模型:
WITH ["Hold", "Assess", "Trial", "Adopt"] AS positions
UNWIND RANGE (0, size(positions) - 2) AS index
WITH positions[index] AS pos1, positions[index + 1] AS pos2
MERGE (position1:Position {value: pos1})
MERGE (position2:Position {value: pos2})
MERGE (position1)-[:NEXT]->(position2);load csv with headers from "file:///blips.csv" AS row
MATCH (position:Position {value: row.suggestion })
MERGE (tech:Technology {name: row.technology })
MERGE (date:Date {value: row.date})
MERGE (recommendation:Recommendation {id: tech.name + "_" + date.value + "_" + position.value})
MERGE (recommendation)-[:ON_DATE]->(date)
MERGE (recommendation)-[:POSITION]->(position)
MERGE (recommendation)-[:TECHNOLOGY]->(tech);match (date:Date)
SET date.timestamp = apoc.date.parse(date.value, "ms", "MMM yyyy");MATCH (date:Date)
WITH date
ORDER BY date.timestamp
WITH COLLECT(date) AS dates
UNWIND range(0, size(dates)-2) AS index
WITH dates[index] as month1, dates[index+1] AS month2
MERGE (month1)-[:NEXT]->(month2);MATCH (tech)<-[:TECHNOLOGY]-(reco:Recommendation)-[:ON_DATE]->(date)
WITH tech, reco, date
ORDER BY tech.name, date.timestamp
WITH tech, COLLECT(reco) AS recos
UNWIND range(0, size(recos)-2) AS index
WITH recos[index] AS reco1, recos[index&#43;1] AS reco2
MERGE (reco1)-[:NEXT]->(reco2);
请注意&#xff0c;我安装了APOC过程库&#xff0c;以便可以使用apoc.date.parse函数将日期的字符串表示形式转换为时间戳。 blips.csv文件需要进入Neo4j的导入目录。
现在&#xff0c;我们正在阅读以编写一些查询。
对于特定技术&#xff0c;技术雷达有4个职位&#xff1a;保留&#xff0c;评估&#xff0c;试用和采用&#xff1a;
- 保留&#xff1a;谨慎处理
- 评估&#xff1a;值得探索&#xff0c;目的是了解它将如何影响您的企业。
- 试用&#xff1a;值得追求。 了解如何建立此功能非常重要。 企业应该在可以处理风险的项目上尝试使用该技术。
- 采用&#xff1a;我们强烈认为行业应采用这些项目。 我们在项目中适当时使用它们。
我很好奇是否曾经有过一种技术&#xff0c;其建议最初是“保留”&#xff0c;后来又变成了“评估”。 我写了以下查询来找出&#xff1a;
MATCH (pos1:Position {value:"Hold"})<-[:POSITION]-(reco)-[:TECHNOLOGY]->(tech),(pos2:Position {value:"Assess"})<-[:POSITION]-(otherReco)-[:TECHNOLOGY]->(tech),(reco)-[:ON_DATE]->(recoDate),(otherReco)-[:ON_DATE]->(otherRecoDate)
WHERE (reco)-[:NEXT]->(otherReco)
RETURN tech.name AS technology, otherRecoDate.value AS dateOfChange;╒════════════╤══════════════╕
│"technology"│"dateOfChange"│
╞════════════╪══════════════╡
│"Azure" │"Aug 2010" │
└────────────┴──────────────┘
只有天蓝色 &#xff01; 该页面没有任何有关2010年4月最初的“保留”建议的解释&#xff0c;该建议大概是在“云”成为主流之前。 那反过来呢&#xff1f; 是否有最初建议“评估”但后来建议“保留”的技术&#xff1f;
MATCH (pos1:Position {value:"Assess"})<-[:POSITION]-(reco)-[:TECHNOLOGY]->(tech),(pos2:Position {value:"Hold"})<-[:POSITION]-(otherReco)-[:TECHNOLOGY]->(tech),(reco)-[:ON_DATE]->(recoDate),(otherReco)-[:ON_DATE]->(otherRecoDate)
WHERE (reco)-[:NEXT]->(otherReco)
RETURN tech.name AS technology, otherRecoDate.value AS dateOfChange;╒═══════════════════════════════════╤══════════════╕
│"technology" │"dateOfChange"│
╞═══════════════════════════════════╪══════════════╡
│"RIA" │"Apr 2010" │
├───────────────────────────────────┼──────────────┤
│"Backbone.js" │"Oct 2012" │
├───────────────────────────────────┼──────────────┤
│"Pace-layered Application Strategy"│"Nov 2015" │
├───────────────────────────────────┼──────────────┤
│"SPDY" │"May 2015" │
├───────────────────────────────────┼──────────────┤
│"AngularJS" │"Nov 2016" │
└───────────────────────────────────┴──────────────┘
其中有一些是Javascript库/框架&#xff0c;因此现在建议使用React代替。 让我们检查&#xff1a;
MATCH (t:Technology)<-[:TECHNOLOGY]-(reco)-[:ON_DATE]->(date), (reco)-[:POSITION]->(pos)
WHERE t.name contains "React.js"
RETURN pos.value, date.value
ORDER BY date.timestamp╒═══════════╤════════════╕
│"pos.value"│"date.value"│
╞═══════════╪════════════╡
│"Assess" │"Jan 2015" │
├───────────┼────────────┤
│"Trial" │"May 2015" │
├───────────┼────────────┤
│"Trial" │"Nov 2015" │
├───────────┼────────────┤
│"Adopt" │"Apr 2016" │
├───────────┼────────────┤
│"Adopt" │"Nov 2016" │
└───────────┴────────────┘
灰烬也很受欢迎&#xff1a;
MATCH (t:Technology)<-[:TECHNOLOGY]-(reco)-[:ON_DATE]->(date), (reco)-[:POSITION]->(pos)
WHERE t.name contains "Ember"
RETURN pos.value, date.value
ORDER BY date.timestamp╒═══════════╤════════════╕
│"pos.value"│"date.value"│
╞═══════════╪════════════╡
│"Assess" │"May 2015" │
├───────────┼────────────┤
│"Assess" │"Nov 2015" │
├───────────┼────────────┤
│"Trial" │"Apr 2016" │
├───────────┼────────────┤
│"Adopt" │"Nov 2016" │
└───────────┴────────────┘
让我们进行不同的切线研究&#xff0c;看看最近的雷达中引入了多少种技术&#xff1f;
MATCH (date:Date {value: "Nov 2016"})<-[:ON_DATE]-(reco)
WHERE NOT (reco)<-[:NEXT]-()
RETURN COUNT(*) ╒══════════╕
│"COUNT(*)"│
╞══════════╡
│"45" │
└──────────┘
哇&#xff0c;有45件事&#xff01; 它们如何分散在不同的职位上&#xff1f;
MATCH (date:Date {value: "Nov 2016"})<-[:ON_DATE]-(reco)-[:TECHNOLOGY]->(tech), (reco)-[:POSITION]->(position)
WHERE NOT (reco)<-[:NEXT]-()
WITH position, COUNT(*) AS count, COLLECT(tech.name) AS technologies
ORDER BY LENGTH((position)-[:NEXT*]->()) DESC
RETURN position.value, count, technologies╒════════════════╤═══════╤══════════════════════════════════════════════╕
│"position.value"│"count"│"technologies" │
╞════════════════╪═══════╪══════════════════════════════════════════════╡
│"Hold" │"1" │["Anemic REST"] │
├────────────────┼───────┼──────────────────────────────────────────────┤
│"Assess" │"28" │["Nuance Mix","Micro frontends","Three.js","Sc│
│ │ │ikit-learn","WebRTC","ReSwift","Vue.js","Elect│
│ │ │ron","Container security scanning","wit.ai","D│
│ │ │ifferential privacy","Rapidoid","OpenVR","AWS │
│ │ │Application Load Balancer","Tarantool","IndiaS│
│ │ │tack","Ethereum","axios","Bottled Water","Cass│
│ │ │andra carefully","ECMAScript 2017","FBSnapshot│
│ │ │Testcase","Client-directed query","JuMP","Cloj│
│ │ │ure.spec","HoloLens","Android-x86","Physical W│
│ │ │eb"] │
├────────────────┼───────┼──────────────────────────────────────────────┤
│"Trial" │"13" │["tmate","Lightweight Architecture Decision Re│
│ │ │cords","APIs as a product","JSONassert","Unity│
│ │ │ beyond gaming","Galen","Enzyme","Quick and Ni│
│ │ │mble","Talisman","fastlane","Auth0","Pa11y","P│
│ │ │hoenix"] │
├────────────────┼───────┼──────────────────────────────────────────────┤
│"Adopt" │"3" │["Grafana","Babel","Pipelines as code"] │
└────────────────┴───────┴──────────────────────────────────────────────┘
假期中有很多新事物可供探索&#xff01; 如果您想使用它们&#xff0c;则本文中使用的CSV文件&#xff0c;导入脚本和查询都可以在github上找到 。
翻译自: https://www.javacodegeeks.com/2016/12/neo4j-graphing-thoughtworks-technology-radar.html
thoughtworks