The class, instance and question nodes have been created with the query above.
This one fetches the instance and question nodes with MATCH
, and creates everything related to the answers.
// instance nodes
MATCH (LaRochelle:Inst {name:'La Rochelle'})
MATCH (Marseille:Inst {name:'Marseille'})
MATCH (France:Inst {name:'France'})
MATCH (Atlantic:Inst {name:'Atlantic'})
MATCH (Mediterranean:Inst {name:'Mediterranean'})
// question nodes
MATCH (CityPartCountry:Quest {name:'city part of country'})
MATCH (CountryAccessSea:Quest {name:'country access to sea'})
MATCH (CountryBordersCountry:Quest {name:'country borders country'})
MATCH (PortCityAccessSea:Quest {name:'port city access to sea'})
/////////////////////////////////////////////////////////////////////////////
// answer nodes
CREATE (LaRochellePartFrance:Ans)
CREATE (MarseillePartFrance:Ans)
CREATE (LaRochelleAccessAtlantic:Ans)
CREATE (MarseilleAccessMediterranean:Ans)
CREATE (FranceAccessAtlantic:Ans)
CREATE (FranceAccessMediterranean:Ans)
// answer question relations
CREATE (LaRochellePartFrance) -[:AQ]-> (CityPartCountry)
CREATE (MarseillePartFrance) -[:AQ]-> (CityPartCountry)
CREATE (FranceAccessAtlantic) -[:AQ]-> (CountryAccessSea)
CREATE (FranceAccessMediterranean) -[:AQ]-> (CountryAccessSea)
CREATE (LaRochelleAccessAtlantic) -[:AQ]-> (PortCityAccessSea)
CREATE (MarseilleAccessMediterranean) -[:AQ]-> (PortCityAccessSea)
// answer relations
CREATE (LaRochellePartFrance) -[:ANS {name: 'city'}]-> (LaRochelle)
CREATE (LaRochellePartFrance) -[:ANS {name: 'country'}]-> (France)
CREATE (MarseillePartFrance) -[:ANS {name: 'city'}]-> (Marseille)
CREATE (MarseillePartFrance) -[:ANS {name: 'country'}]-> (France)
CREATE (FranceAccessAtlantic) -[:ANS {name: 'country'}]-> (France)
CREATE (FranceAccessAtlantic) -[:ANS {name: 'sea'}]-> (Atlantic)
CREATE (FranceAccessMediterranean) -[:ANS {name: 'country'}]-> (France)
CREATE (FranceAccessMediterranean) -[:ANS {name: 'sea'}]-> (Mediterranean)
CREATE (LaRochelleAccessAtlantic) -[:ANS {name: 'port city'}]-> (LaRochelle)
CREATE (LaRochelleAccessAtlantic) -[:ANS {name: 'sea'}]-> (Atlantic)
CREATE (MarseilleAccessMediterranean) -[:ANS {name: 'port city'}]-> (Marseille)
CREATE (MarseilleAccessMediterranean) -[:ANS {name: 'sea'}]-> (Mediterranean)