This example can be run here: http://graphgist.neo4j.com/#!/gists/b6a3833a7ec042f77e31 If you use the code or images, please cite: Valentina Franzoni, https://gist.github.com/valefranz/b6a3833a7ec042f77e31 First step: create some authors [source,cypher] ---- //CREATE authors, with name as a property CREATE (Author2:Person {name:'Jiming Liu'}), (Author3:Person {name:'Yuanxi Li'}), (Author4:Person {name:'Alfredo Milani'}), //CREATE publications, with title as a property (Publication4:JournalPaper {title:'Intelligent Social Media Indexing and Sharing Using an Adaptive Indexing Search Engine'}), (Journal2: Journal {journalName: 'ACM Transaction on Intelligent System Technologies'}); MATCH n RETURN n ---- //graph Second step: create a relationship [source,cypher] ---- MATCH (P: JournalPaper), (J:Journal) WHERE P.title = 'Intelligent Social Media Indexing and Sharing Using an Adaptive Indexing Search Engine' AND J.journalName = 'ACM Transaction on Intelligent System Technologies' CREATE //CREATE relationships between publications and journal (P)-[:publishedIn {year:2012 }]->(J); MATCH n RETURN n ---- //graph Third step, create some more data [source,cypher] ---- MATCH (n)-[r]->m DELETE r; MATCH n DELETE n; //CREATE authors, with name as a property CREATE (Author1:Person {name:'Valentina Franzoni'}), (Author2:Person {name:'Jiming Liu'}), (Author3:Person {name:'Yuanxi Li'}), (Author4:Person {name:'Alfredo Milani'}), (Author5:Person {name:'Valentina Poggioni'}), (Author6:Person {name:'Fabiana Zollo'}), (Author7:Person {name:'Aris Anagnostopoulos'}), (Author8:Person {name:'Osvaldo Gervasi'}), (Author9:Person {name:'Stefano Leonardi'}), (Author10:Person {name:'Alberto Marchetti Spaccamela'}), //CREATE publications, with title as a property (Publication1:ConferencePaper {title:'Set Similarity Measures for Images Based on Collective Knowledge'}), (Publication2:JournalPaper {title:'Heuristic semantic walk for concept chaining in collaborative networks'}), (Publication3:ConferencePaper {title:'Automated Classification of Book Blurbs According to the Emotional Tags of the Social Network Zazie'}), (Publication4:JournalPaper {title:'Intelligent Social Media Indexing and Sharing Using an Adaptive Indexing Search Engine'}), (Publication5:JournalPaper {title:'Guidelines for Web Usability and Accessibility on the Nintendo Wii'}), (Publication6:JournalPaper {title:'Experimental evaluation of pheromone models in ACOPlan'}), (Publication7:ConferencePaper {title:'Viral Misinformation: The Role of Homophily and Polarization'}), (Publication8:ConferencePaper {title:'Constant Integrality Gap LP Formulations of Unsplittable Flow on a Path'}), (Publication9:ConferencePaper {title:'Parallel scheduling problems in next generation wireless networks'}), (Publication10:JournalPaper {title:'X3DMMS an X3DOM tool for molecular and material sciences'}), (Journal1: Journal {journalName: 'Lecture Notes in Computer Science'}), (Journal2: Journal {journalName: 'ACM Transaction on Intelligent System Technologies'}), (Journal3: Journal {journalName: 'International Journal of Web Services'}), //CREATE relations of authorship between authors and papers, showing year (Author1)-[:isAuthorOf ]->(Publication1),(Author3)-[:isAuthorOf ]->(Publication1),(Author4)-[:isAuthorOf ]->(Publication1), (Author1)-[:isAuthorOf ]->(Publication2),(Author4)-[:isAuthorOf ]->(Publication2), (Author1)-[:isAuthorOf ]->(Publication3),(Author5)-[:isAuthorOf ]->(Publication3),(Author6)-[:isAuthorOf ]->(Publication3), (Author3)-[:isAuthorOf ]->(Publication4),(Author4)-[:isAuthorOf ] ->(Publication4),(Author2)-[:isAuthorOf ]->(Publication4), (Author1)-[:isAuthorOf ]->(Publication5),(Author8)-[:isAuthorOf ]->(Publication5), (Author4)-[:isAuthorOf ]->(Publication6),(Author5)-[:isAuthorOf ]->(Publication6), (Author6)-[:isAuthorOf ]->(Publication7),(Author7)-[:isAuthorOf ]->(Publication7), (Author7)-[:isAuthorOf ]->(Publication8),(Author9)-[:isAuthorOf ]->(Publication8), (Author9)-[:isAuthorOf ]->(Publication9),(Author10)-[:isAuthorOf ]->(Publication9), (Author6)-[:isAuthorOf ]->(Publication10),(Author8)-[:isAuthorOf ]->(Publication10), //CREATE relationships between publications and journal (Publication1)-[:publishedIn {year:2015 }]->(Journal1), (Publication2)-[:publishedIn {year:2014 }]->(Journal3), (Publication3)-[:publishedIn {year:2014 }]->(Journal1), (Publication4)-[:publishedIn {year:2012 }]->(Journal2), (Publication5)-[:publishedIn {year:2009 }]->(Journal1), (Publication6)-[:publishedIn {year:2011 }]->(Journal2); MATCH n RETURN n ---- //graph Fourth step: exploit some path functions [source,cypher] ---- //qui //MATCH (a) where a.name="Yuanxi Li" or a.name="Jiming Liu" MATCH p=(a)-[:isAuthorOf*..2]-(b) where a.name="Yuanxi Li" and b.name="Jiming Liu" RETURN nodes(p) //a qui //MATCH n RETURN n ---- //table End of the brief experiment.