Skip to content

Instantly share code, notes, and snippets.

@peterneubauer
Forked from deepeshk79/epublishing.adoc
Last active August 29, 2015 13:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peterneubauer/8691660 to your computer and use it in GitHub Desktop.
Save peterneubauer/8691660 to your computer and use it in GitHub Desktop.

EPublishing: A graphical approach to digital publications

Concept

Electronic publishing has become common in scientific publishing where it has been argued that peer-reviewed scientific journals are in the process of being replaced by electronic publishing. It is also becoming common to distribute books, magazines, and newspapers to consumers through tablet reading devices, a market that is growing by millions each year, generated by online vendors such as Apple’s iTunes bookstore, Amazon’s bookstore for Kindle, and books in the Google Play Bookstore. Market research suggests that half of all magazine and newspaper circulation will be via digital delivery by the end of 2015 and that half of all reading in the United States will be done without paper by 2015.

Included Variables

  • Article: an e-published document

  • Author: a user of type person who 'Authors' articles

  • Expert: a user of type person who contributes to an/multiple articles

  • Media: a user of type media who demand articles and publish them

  • Url: the url of a published article

  • Question: queries raised/posted by Authors

  • Quote: answers posted by Experts to Questions

  • Status: status of an article (InProgress, Completed, Published)

  • Trend: timeline of activities for e.g. when was an article written or conceived, when was it published, who is demanding the article etc.


Graph Data Model

Visio

Graph Cypher Sample Data

The cypher query for the sample graph data model is as below

//Node Creation Queries First
CREAT(RelativityTheory:Article {contentId: 'ART000001', name : 'Relativity Theory', content: 'The theory of relativity, or simply relativity in physics, usually encompasses two theories by Albert Einstein: special relativity and general relativity.' })

CREATE (AlbertEinstein:Person {userId: 'UID000001', name : 'Albert Einstein'})
CREATE (ElonMusk:Person {userId: 'UID000002', name : 'Elon Musk'})
CREATE (DaveThomson:Person {userId: 'UID000003', name : 'Dave Thomson'})

CREATE (VivendiSt:Media {userId: 'UID000009', name : 'Vivendi St'})
CREATE (TeslaMedia:Media {userId: 'UID000010', name : 'Tesla Media'})

CREATE (UrlRelativityTheory:Url {url: 'http://www.abcd.com/relativitytheory'})

CREATE (StatusInProgress:Status {status: 'InProgress'})

CREATE (QuestionQID01:Question {questionId: 'QID01', question: 'What is Relativity Theory ?'})
CREATE (QuoteQUT000001:Quote {quoteId: 'QUT000001', quote : 'Relativity theory is a famous theory in physics…'})

CREATE (QuestionQID02:Question {questionId: 'QID02', question: 'What are the consequences of theory of relativity ?'})
CREATE (QuoteQUT000002:Quote {quoteId: 'QUT000002', quote : 'Relativity theory postulates multiple consequences for e.g. Time Dilation, Relativistic mass, Relativity of Simultaneity etc'})


//Run - Create TimeStamp Node for Quote Demand by Author
//Get or create Day
CREATE (day:Day{day:18, month: 12, year: 2013})

// Create TimeStamp Node and new LAST relationship
CREATE (TimeStampNode1:Timestamp {timestamp: 'Oct 12, 2013 4:30PM'})
CREATE (TimeStampNode2:Timestamp {timestamp: 'Oct 12, 2013 6:00PM'})
CREATE (TimeStampNode3:Timestamp {timestamp: 'Oct 12, 2013 7:30PM'})
CREATE (TimeStampNode4:Timestamp {timestamp: 'Oct 12, 2013 9:00PM'})
CREATE (TimeStampNode5:Timestamp {timestamp: 'Oct 12, 2013 10:30PM'})
CREATE (TimeStampNode6:Timestamp {timestamp: 'Oct 12, 2013 11:00PM'})

CREATE

 (RelativityTheory)-[:AUTHOR]->(AlbertEinstein),
 (RelativityTheory)-[:STATUS]->(StatusInProgress),
 (RelativityTheory)-[:DEMAND_SIMILAR]->(VivendiSt),
 (RelativityTheory)-[:OFFERED_PUBLISHING]->(TeslaMedia),
 (RelativityTheory)-[:PUBLISHER]->(TeslaMedia),
 (RelativityTheory)-[:PUBLISHED_URL]->(UrlRelativityTheory),
 (UrlRelativityTheory)-[:PUBLISHED_BY]->(TeslaMedia),

 (RelativityTheory)-[:EXPERT]->(ElonMusk),
 (RelativityTheory)-[:SHARED]->(ElonMusk),
 (RelativityTheory)-[:LIKED]->(ElonMusk),

 (RelativityTheory)-[:EXPERT]->(DaveThomson),
 (RelativityTheory)-[:LIKED]->(DaveThomson),

 (RelativityTheory)-[:QUESTION]->(QuestionQID01),
 (RelativityTheory)-[:QUESTION]->(QuestionQID02),

 (QuestionQID01)-[:SENT_TO]->(ElonMusk),
 (QuestionQID02)-[:SENT_TO]->(DaveThomson),

 (ElonMusk)-[:ANSWER_QUOTE]->(QuoteQUT000001),
 (DaveThomson)-[:ANSWER_QUOTE]->(QuoteQUT000002),

 (RelativityTheory)<-[:QUOTE_FOR]-(QuoteQUT000001)-[:SUBMITTED]->(QuestionQID01),
 (RelativityTheory)<-[:QUOTE_FOR]-(QuoteQUT000002)-[:ACCEPTED]->(QuestionQID02),

 (day)-[:FIRST]->(TimeStampNode1)-[:NEXT]->(TimeStampNode2)-[:NEXT]->(TimeStampNode3)-[:NEXT]->(TimeStampNode4)-[:NEXT]->(TimeStampNode5)-[:NEXT]->(TimeStampNode6)<-[:LAST]-(day),


//Run - Now Connect user VivendiSt node to timestamp thus creating an Event for Demand Similar Activity
(VivendiSt)-[:ACTIVITY_TIME {activity:['TimeStampDemandSimilar'],contentId: ['ART000001']}]->(TimeStampNode1),

//Run - Now Connect user TeslaMedia to timestamp thus creating an Event for Offered Publishing
(TeslaMedia)-[:ACTIVITY_TIME {activity:['TimeStampOfferedPublishing'],contentId: ['ART000001']}]->(TimeStampNode2),

//Run - Now Connect user TeslaMedia to timestamp thus creating an Event for Accepted Publishing
(TeslaMedia)-[:ACTIVITY_TIME {activity:['TimeStampAcceptedPublication'],contentId: ['ART000001']}]->(TimeStampNode3),

//Run - Now Connect user TeslaMedia to timestamp thus creating an Event for Offered Publishing
(UrlRelativityTheory)-[:ACTIVITY_TIME {activity:['TimeStampExternalUrlPublication'],contentId: ['ART000001']}]->(TimeStampNode4),

//Run - Now Connect the Quote to timestamp thus creating an Event for Quote Submission
(QuoteQUT000001)-[:ACTIVITY_TIME {activity:['TimeStampQuoteSubmitted'],contentId: ['ART000001']}]->(TimeStampNode5);

[[X3]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment