Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamkat/add3b89951eca13cd993 to your computer and use it in GitHub Desktop.
Save iamkat/add3b89951eca13cd993 to your computer and use it in GitHub Desktop.
Production and Supply for a Guitar

Guitar Production and Supply GraphGist

Query console

CREATE (w_redcedar:Wood{name:'Red Cedar'}),
 (w_ebony:Wood{name:'Ebony'}),
 (m_bronze:Metal{name:'Bronze'}),

 (p_guitarmanufacture:Production{name:'Guitar Manufacture'}),
 (d_guitarshop:Distribution{name:'Guitar Shop'}),



 (A:Location{name:'Brasil', description:'Rainforest'}),
 (B:Location{name:'Canada', description: 'Hardwood forest'}),
 (C:Location{name:'Texas', description: 'Metal mine'}),

 (w_ebony)-[:GROWN_IN]->(A)-[:GOES_TO]->(p_guitarmanufacture),
 (w_redcedar)-[:GROWN_IN]->(B)-[:GOES_TO]->(p_guitarmanufacture),
 (m_bronze)-[:MINED_IN]->(C)-[:GOES_TO]->(p_guitarmanufacture)


;

Domain

Graph

Queries

Whiskies like Ardbeg

As a fan of smokey whiskies, I would like to know all brands similar to Ardbeg which are also in flavour group J (Full-Bodied, Dry, Pungent, Peaty and Medicinal, with Spicy, Feinty Notes).

MATCH (:Wood)-[:GOES_TO]->(p_guitarmanufacture)
RETURN name

Whiskies from Port Ellen or Port Askaig

My favorite brands are based in Port Ellen or Port Askaig. Show me a list with all of them.

MATCH (whisky:Whisky)-[:PRODUCED_IN]->(:Location{name:'Port Ellen'}) RETURN distinct(whisky.name) UNION ALL MATCH (whisky:Whisky)-[:PRODUCED_IN]->(:Location{name:'Port Askaig'}) RETURN distinct(whisky.name)

Similar Whiskies to Oban

The Oban distillery is one of the smallest in Scotland. It produces a "West Highland" flavour that falls between the dry, smoky style of the Scottish islands and the lighter, sweeter malts of the Highlands. Let’s search for similar brands.

MATCH (:Whisky{name:"Oban"})-[:HAS_FLAVOURS]->()<-[:HAS_FLAVOURS]-(whisky) RETURN whisky.name

Speyside Whiskies

Sitting together with friends, a wee dram for every occasion could be from the Speyside region, I guess this will be a though decision.

MATCH (:Region{name:'Speyside'})<-[:LOCATED_IN]-()<-[:PRODUCED_IN]-(whisky:Whisky) RETURN distinct(whisky.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment