Advanced Database Design and Implementation

$20 Bonus + 25% OFF CLAIM OFFER

Place Your Order With Us Today And Go Stress-Free

Advanced Database Design and Implementation
  • 2

  • Course Code:
  • University:
  • Country: Australia

Advanced Database Design and Implementation

Executive Summary

This report describes the development of an enhanced database for an environmental scanning tool with the domain of interest being that of sports. It also IPv6 Databases two different types MongoDB, for integration unstructured and time series data together and Neo4j for representing graph data which focuses on the relationship among events, regions, and key players.

1.    Environmental Scanning: To do this, the domain related to the field of sports was chosen to identify and collect appropriate articles. Together with the general administrative parameters that included source, URL, title, and summary, the specific features of the domain that included the type of sport, the event, teams or athletes involved, the result or outcome, and the region where the information was gathered from, were recorded.

2.    MongoDB Integration: Sports data had been compiled and stored in MongoDB using complex functions like $text, $set and date-range. Some of the operations performed included; searching for terms in words, getting documents resulting from a certain search term, and modifying values of keys.

3.    Neo4j graph Database: In order to create a model and analyze, nodes and relationships were developed in Neo4j based on sports events, regions, and major actors. Of the displayed examples, I made various queries grouped by the existing relationships between people or events: players’ participation in multiple events, specific territories where events occurred.

4.    Extended Functionality: Thus, to forecast the probability of candidates winning the 2025 IOC Presidential Election an Analysis of Competing Hypotheses (ACH) was conducted based on data obtained from both, MongoDB, and Neo4j. This showed how information from the combined database system can be employed for additional complicated examinations.

5.    Comparative Analysis: For geospatial, the report compared MongoDB’s geospatial and an analogous feature from PostgreSQL, and for time-series, MongoDB was compared to PostgreSQL’s TimescaleDB. Moreover, it solved issues related to data import from MongoDB to Neo4j with keeping the schema and analyzing nested data structures.

This report describes the actual use of multiple data sources, sophisticated querying techniques, and hypothesis testing within the selected area of sports. It is useful as a way to understand how the techniques and technologies based on the new generation of databases can be applied to the real data, and it gives a good introduction to how unstructured or graph data can be used for analysis.

Task: Choose OSINT sources

Two news sources chosen is 
BBC - British Broadcasting Corporation
CBC - Canadian Broadcasting Corporation

Task: Determine domain for Environmental Scanning

In this section, I am concentrating the sport industry as the field where environmental scanning is to be executed. The aim is to compile the articles featuring the topics of interest, as well as identify the trends in users’ activity, while illustrating all the results and observational markers using the features that are both consistent with the administration of the site and specific to the domain. Thus, the intention is to recognize desirable patterns, key personnel, as well as results within the sporting context studying the sports news.

Also Read - Object Oriented System Requirement Analysis, Design, And Development

Selection of new Domain:

Sports is my area of interest because I believe I understand enough about it and am passionate about the area. Sport is an international affair and it impacts many areas of players’ functions, teams’ tactics, results of tournaments, and construction of sports facilities. This area is very general and it will enable me look at a wide range of occasions and happenings.

Administrative Feature:

The key administrative features for representing the news articles include:
News Media: The source of the news article.
URL: The link to the article for reference.
Title of Article and Author: The title of the news article and the author.
Date of Article: The date the article was published.
Summary: A brief description or main points of the article.

Domain-Specific Features:

Since my chosen area is sports, the domain-specific features I will track include the following:
Sport: The type of sport.
Event / Competition: The tournament or event being covered in the news.
Key Players / Teams: The individuals or teams involved in the event.
Outcome: The result of the event.
Region: The location or region where the event is taking place.

Task: Create and insert data into MongoDB

use sports_database

db.createCollection("sports_data")


Complete documents in one collection:  




key-value pairs in another collection
keyvalue pairs 

Task: MongoDB queries

1.    Query using $text to find documents containing a specific word
When using $text, we have to ensure that text indexes exist on the required target fields mentioned earlier. Here it is supposed that the title and the content fields are relevant.

// Create text index on title and content
db.sports_data.createIndex({ title: "text", content: "text" });

// Search for documents containing the word "win"
db.sports_data.find({ $text: { $search: "win" } }).pretty();


 

2.    Retrieve and display 5 documents

This query simply retrieves the first 5 documents from the collection.
db.sports_data.find().limit(5).pretty();
 

3.    Use the $set operator to add a new key-value pair

This query will update all documents and add a new key-value pair, for example, "view_count": 0.
db.sports_data.updateMany(
  {}, 
  { $set: { view_count: 0 } }
);

4.    Query documents within a certain date range

Assuming your documents have a date field in "YYYY-MM-DD" format, you can query documents within a specific date range like this:
db.sports_data.find({
  date: { $gte: "2024-10-10", $lte: "2024-10-11" }
}).pretty();

 

5.    Retrieve documents with a common key-value pair.

we retrieve all documents where the sport is "Football"
db.sports_key_value_data.find({ sport: "Football" }).pretty();
 

6.    Demonstrate the use of logical operators ($and, $or)

In this query there are logical operators used They include The OR operator and the grouping symbol (). It pulls out all documents in which the sport can be ‘Football’ or ‘Cricket’ and the region can only be ‘USA’.

db.sports_key_value_data.find({
  $and: [
    { $or: [{ sport: "Football" }, { sport: "Cricket" }] },
    { region: "USA" }
  ]
}).pretty(); 
In other words, there is no sport that is “Football” or “Cricket” and the region is “USA”. But played in Europe. 

db.sports_key_value_data.find({
  $and: [
    { $or: [{ sport: "Football" }, { sport: "Cricket" }] },
    { region: "Europe" }
  ]
}).pretty();
 

Task: Insert data into Neo4j


Neo4j 
Database Created :  itech2004-30430040-osint

 

Create Nodes: Create Relationships: 


Event Nodes:
// Create Event Nodes
CREATE (e1:Event {name: "England vs Pakistan First Test", sport: "Cricket", outcome: "England victory after conceding over 550 runs"});
CREATE (e2:Event {name: "2025 T20 Blast", sport: "Cricket", outcome: "Riley Meredith re-signs with Somerset for 2025"});
CREATE (e3:Event {name: "WNBA Finals Game 2", sport: "Basketball", outcome: "New York Liberty win 80-66, evening the series 1-1"});
CREATE (e4:Event {name: "National League Championship Series Game 1", sport: "Baseball", outcome: "Dodgers win 9-0, tie post-season record of 33 consecutive scoreless innings"});
CREATE (e5:Event {name: "IOC Presidential Election", sport: "Olympics", outcome: "IOC to elect new president in March 2025"});
CREATE (e6:Event {name: "Wuhan Open", sport: "Tennis", outcome: "Leylah Fernandez eliminated in singles, advances in doubles"});
CREATE (e7:Event {name: "Northern Super League", sport: "Soccer", outcome: "Katrine Pedersen appointed head coach of Ottawa Rapid FC"});
CREATE (e8:Event {name: "Fifa Legal Complaint", sport: "Football", outcome: "Legal complaint filed by European leagues and Fifpro against Fifa"});
CREATE (e9:Event {name: "Afcon 2025 Qualifier", sport: "Football", outcome: "Nigeria plans to boycott Afcon 2025 qualifier in Libya due to mistreatment"});
CREATE (e10:Event {name: "Women's Championship", sport: "Football", outcome: "Newcastle defeats Sunderland 2-1 in front of record crowd"});
CREATE (e11:Event {name: "Black Desert Championship", sport: "Golf", outcome: "Matt McCarty wins his first PGA Tour title"});
CREATE (e12:Event {name: "Alfred Dunhill Links Championship", sport: "Golf", outcome: "Colsaerts and John share the lead at 14 under"});
CREATE (e13:Event {name: "Spanish Open", sport: "Golf", outcome: "Angel Hidalgo wins the Spanish Open in a play-off"});
CREATE (e14:Event {name: "Chicago Marathon", sport: "Athletics", outcome: "Ruth Chepngetich sets a new marathon world record"});
CREATE (e15:Event {name: "Cold War Sports Doping", sport: "Olympics", outcome: "Revelations of widespread doping in both East and West Germany during the Cold War"});
CREATE (e16:Event {name: "Eliyahu Wellness Centre", sport: "Hockey", outcome: "Cost overruns criticized, residents call for accountability and mayor's resignation"});
CREATE (e17:Event {name: "NHL Debut", sport: "Hockey", outcome: "Macklin Celebrini placed on IR after impressive NHL debut"});
CREATE (e18:Event {name: "World Cup Ski Cross", sport: "Ski Cross", outcome: "Marielle Thompson wins her 4th Crystal Globe in women's ski cross"});
CREATE (e19:Event {name: "Northern Super League Women's Team Announcement", sport: "Soccer", outcome: "Katrine Pedersen appointed as Ottawa Rapid FC's head coach"});
CREATE (e20:Event {name: "International Para Hockey Cup", sport: "Para Hockey", outcome: "U.S. defeats Canada 2-1 in overtime at the Para Hockey Cup"});
CREATE (e21:Event {name: "Short Track World Championships", sport: "Speed Skating", outcome: "William Dandjinou wins gold in the men's 1,000m final"});
CREATE (e22:Event {name: "FIS World Cup", sport: "Snowboard Cross", outcome: "Eliot Grondin wins his 5th gold medal of the World Cup season"}); 

Region Nodes:

// Create Region Nodes
CREATE (r1:Region {name: "Multan, Pakistan"});
CREATE (r2:Region {name: "Somerset, UK"});
CREATE (r3:Region {name: "New York, USA"});
CREATE (r4:Region {name: "Los Angeles, USA"});
CREATE (r5:Region {name: "Global"});  // For IOC Presidential Election
CREATE (r6:Region {name: "Wuhan, China"});
CREATE (r7:Region {name: "Ottawa, Canada"});
CREATE (r8:Region {name: "Europe"});  // For Fifa Legal Complaint
CREATE (r9:Region {name: "Libya"});
CREATE (r10:Region {name: "Newcastle, UK"});
CREATE (r11:Region {name: "Utah, USA"});
CREATE (r12:Region {name: "Scotland"});
CREATE (r13:Region {name: "Madrid, Spain"});
CREATE (r14:Region {name: "Chicago, USA"});
CREATE (r15:Region {name: "Germany"});  // For Cold War Sports Doping
CREATE (r16:Region {name: "North Rustico, P.E.I., Canada"});  // For Eliyahu Wellness Centre
CREATE (r17:Region {name: "San Jose, USA"});
CREATE (r18:Region {name: "Idre Fjäll, Sweden"});
CREATE (r19:Region {name: "Ostrava, Czech Republic"});
CREATE (r20:Region {name: "Rotterdam, Netherlands"});
CREATE (r21:Region {name: "Cortina d'Ampezzo, Italy"});


 

Key Player Nodes:

// Create Key Player Nodes
CREATE (p1:Person {name: "Joe Root"});
CREATE (p2:Person {name: "Harry Brook"});
CREATE (p3:Person {name: "Jack Leach"});
CREATE (p4:Person {name: "Zak Crawley"});
CREATE (p5:Person {name: "Riley Meredith"});
CREATE (p6:Person {name: "Breanna Stewart"});
CREATE (p7:Person {name: "Bridget Carleton"});
CREATE (p8:Person {name: "Jack Flaherty"});
CREATE (p9:Person {name: "Mookie Betts"});
CREATE (p10:Person {name: "Shohei Ohtani"});
CREATE (p11:Person {name: "Thomas Bach"});
CREATE (p12:Person {name: "Juan Antonio Samaranch Jr."});
CREATE (p13:Person {name: "Kirsty Coventry"});
CREATE (p14:Person {name: "Sebastian Coe"});
CREATE (p15:Person {name: "Leylah Fernandez"});
CREATE (p16:Person {name: "Zheng Qinwen"});
CREATE (p17:Person {name: "Coco Gauff"});
CREATE (p18:Person {name: "Katrine Pedersen"});
CREATE (p19:Person {name: "Rodri"});
CREATE (p20:Person {name: "Manuel Akanji"});
CREATE (p21:Person {name: "Alisson"});
CREATE (p22:Person {name: "William Troost-Ekong"});
CREATE (p23:Person {name: "Victor Boniface"});
CREATE (p24:Person {name: "Beth Lumsden"});
CREATE (p25:Person {name: "Emily Scarr"});
CREATE (p26:Person {name: "Matt McCarty"});
CREATE (p27:Person {name: "Stephan Jaeger"});
CREATE (p28:Person {name: "Nicolas Colsaerts"});
CREATE (p29:Person {name: "Cameron John"});
CREATE (p30:Person {name: "Angel Hidalgo"});
CREATE (p31:Person {name: "Jon Rahm"});
CREATE (p32:Person {name: "Ruth Chepngetich"});
CREATE (p33:Person {name: "Birgit Dressel"});
CREATE (p34:Person {name: "Ines Geipel"});
CREATE (p35:Person {name: "Town of North Rustico"});
CREATE (p36:Person {name: "Mayor Heather McKenna"});
CREATE (p37:Person {name: "Macklin Celebrini"});
CREATE (p38:Person {name: "Marielle Thompson"});
CREATE (p39:Person {name: "Brittany Phelan"});
CREATE (p40:Person {name: "Jack Wallace"});
CREATE (p41:Person {name: "Anton Jacobs-Webb"});
CREATE (p42:Person {name: "William Dandjinou"});
CREATE (p43:Person {name: "Eliot Grondin"});
 

Relationships Between Events and Regions:

// Events and Regions Relationships
MATCH (e1:Event {name: "England vs Pakistan First Test"}), (r1:Region {name: "Multan, Pakistan"})
CREATE (e1)-[:OCCURRED_AT]->(r1);

MATCH (e2:Event {name: "2025 T20 Blast"}), (r2:Region {name: "Somerset, UK"})
CREATE (e2)-[:OCCURRED_AT]->(r2);

MATCH (e3:Event {name: "WNBA Finals Game 2"}), (r3:Region {name: "New York, USA"})
CREATE (e3)-[:OCCURRED_AT]->(r3);

MATCH (e4:Event {name: "National League Championship Series Game 1"}), (r4:Region {name: "Los Angeles, USA"})
CREATE (e4)-[:OCCURRED_AT]->(r4);

MATCH (e5:Event {name: "IOC Presidential Election"}), (r5:Region {name: "Global"})
CREATE (e5)-[:OCCURRED_AT]->(r5);

MATCH (e6:Event {name: "Wuhan Open"}), (r6:Region {name: "Wuhan, China"})
CREATE (e6)-[:OCCURRED_AT]->(r6);

MATCH (e7:Event {name: "Northern Super League"}), (r7:Region {name: "Ottawa, Canada"})
CREATE (e7)-[:OCCURRED_AT]->(r7);

MATCH (e8:Event {name: "Fifa Legal Complaint"}), (r8:Region {name: "Europe"})
CREATE (e8)-[:OCCURRED_AT]->(r8);

MATCH (e9:Event {name: "Afcon 2025 Qualifier"}), (r9:Region {name: "Libya"})
CREATE (e9)-[:OCCURRED_AT]->(r9);

MATCH (e10:Event {name: "Women's Championship"}), (r10:Region {name: "Newcastle, UK"})
CREATE (e10)-[:OCCURRED_AT]->(r10);

MATCH (e11:Event {name: "Black Desert Championship"}), (r11:Region {name: "Utah, USA"})
CREATE (e11)-[:OCCURRED_AT]->(r11);

MATCH (e12:Event {name: "Alfred Dunhill Links Championship"}), (r12:Region {name: "Scotland"})
CREATE (e12)-[:OCCURRED_AT]->(r12);

MATCH (e13:Event {name: "Spanish Open"}), (r13:Region {name: "Madrid, Spain"})
CREATE (e13)-[:OCCURRED_AT]->(r13);

MATCH (e14:Event {name: "Chicago Marathon"}), (r14:Region {name: "Chicago, USA"})
CREATE (e14)-[:OCCURRED_AT]->(r14);

MATCH (e15:Event {name: "Cold War Sports Doping"}), (r15:Region {name: "Germany"})
CREATE (e15)-[:OCCURRED_AT]->(r15);

MATCH (e16:Event {name: "Eliyahu Wellness Centre"}), (r16:Region {name: "North Rustico, P.E.I., Canada"})
CREATE (e16)-[:OCCURRED_AT]->(r16);

MATCH (e17:Event {name: "NHL Debut"}), (r17:Region {name: "San Jose, USA"})
CREATE (e17)-[:OCCURRED_AT]->(r17);

MATCH (e18:Event {name: "World Cup Ski Cross"}), (r18:Region {name: "Idre Fjäll, Sweden"})
CREATE (e18)-[:OCCURRED_AT]->(r18);

MATCH (e19:Event {name: "Northern Super League Women's Team Announcement"}), (r7:Region {name: "Ottawa, Canada"})
CREATE (e19)-[:OCCURRED_AT]->(r7);

MATCH (e20:Event {name: "International Para Hockey Cup"}), (r19:Region {name: "Ostrava, Czech Republic"})
CREATE (e20)-[:OCCURRED_AT]->(r19);

MATCH (e21:Event {name: "Short Track World Championships"}), (r20:Region {name: "Rotterdam, Netherlands"})
CREATE (e21)-[:OCCURRED_AT]->(r20);

MATCH (e22:Event {name: "FIS World Cup"}), (r21:Region {name: "Cortina d'Ampezzo, Italy"})
CREATE (e22)-[:OCCURRED_AT]->(r21);

Relationships Between Key Players and Events:

// Relationships for Event 1: "England vs Pakistan First Test"
MATCH (e1:Event {name: "England vs Pakistan First Test"}), (p1:Person {name: "Joe Root"})
CREATE (p1)-[:PARTICIPATED_IN]->(e1);

MATCH (e1:Event {name: "England vs Pakistan First Test"}), (p2:Person {name: "Harry Brook"})
CREATE (p2)-[:PARTICIPATED_IN]->(e1);

MATCH (e1:Event {name: "England vs Pakistan First Test"}), (p3:Person {name: "Jack Leach"})
CREATE (p3)-[:PARTICIPATED_IN]->(e1);

MATCH (e1:Event {name: "England vs Pakistan First Test"}), (p4:Person {name: "Zak Crawley"})
CREATE (p4)-[:PARTICIPATED_IN]->(e1);

// Relationships for Event 2: "2025 T20 Blast"
MATCH (e2:Event {name: "2025 T20 Blast"}), (p5:Person {name: "Riley Meredith"})
CREATE (p5)-[:PARTICIPATED_IN]->(e2);

// Relationships for Event 3: "WNBA Finals Game 2"
MATCH (e3:Event {name: "WNBA Finals Game 2"}), (p6:Person {name: "Breanna Stewart"})
CREATE (p6)-[:PARTICIPATED_IN]->(e3);

MATCH (e3:Event {name: "WNBA Finals Game 2"}), (p7:Person {name: "Bridget Carleton"})
CREATE (p7)-[:PARTICIPATED_IN]->(e3);

// Relationships for Event 4: "National League Championship Series Game 1"
MATCH (e4:Event {name: "National League Championship Series Game 1"}), (p8:Person {name: "Jack Flaherty"})
CREATE (p8)-[:PARTICIPATED_IN]->(e4);

MATCH (e4:Event {name: "National League Championship Series Game 1"}), (p9:Person {name: "Mookie Betts"})
CREATE (p9)-[:PARTICIPATED_IN]->(e4);

MATCH (e4:Event {name: "National League Championship Series Game 1"}), (p10:Person {name: "Shohei Ohtani"})
CREATE (p10)-[:PARTICIPATED_IN]->(e4);

// Relationships for Event 5: "IOC Presidential Election"
MATCH (e5:Event {name: "IOC Presidential Election"}), (p11:Person {name: "Thomas Bach"})
CREATE (p11)-[:PARTICIPATED_IN]->(e5);

MATCH (e5:Event {name: "IOC Presidential Election"}), (p12:Person {name: "Juan Antonio Samaranch Jr."})
CREATE (p12)-[:PARTICIPATED_IN]->(e5);

MATCH (e5:Event {name: "IOC Presidential Election"}), (p13:Person {name: "Kirsty Coventry"})
CREATE (p13)-[:PARTICIPATED_IN]->(e5);

MATCH (e5:Event {name: "IOC Presidential Election"}), (p14:Person {name: "Sebastian Coe"})
CREATE (p14)-[:PARTICIPATED_IN]->(e5);

// Relationships for Event 6: "Wuhan Open"
MATCH (e6:Event {name: "Wuhan Open"}), (p15:Person {name: "Leylah Fernandez"})
CREATE (p15)-[:PARTICIPATED_IN]->(e6);

MATCH (e6:Event {name: "Wuhan Open"}), (p16:Person {name: "Zheng Qinwen"})
CREATE (p16)-[:PARTICIPATED_IN]->(e6);

MATCH (e6:Event {name: "Wuhan Open"}), (p17:Person {name: "Coco Gauff"})
CREATE (p17)-[:PARTICIPATED_IN]->(e6);

// Relationships for Event 7: "Northern Super League"
MATCH (e7:Event {name: "Northern Super League"}), (p18:Person {name: "Katrine Pedersen"})
CREATE (p18)-[:PARTICIPATED_IN]->(e7);

// Relationships for Event 8: "Fifa Legal Complaint"
MATCH (e8:Event {name: "Fifa Legal Complaint"}), (p19:Person {name: "Rodri"})
CREATE (p19)-[:PARTICIPATED_IN]->(e8);

MATCH (e8:Event {name: "Fifa Legal Complaint"}), (p20:Person {name: "Manuel Akanji"})
CREATE (p20)-[:PARTICIPATED_IN]->(e8);

MATCH (e8:Event {name: "Fifa Legal Complaint"}), (p21:Person {name: "Alisson"})
CREATE (p21)-[:PARTICIPATED_IN]->(e8);

// Relationships for Event 9: "Afcon 2025 Qualifier"
MATCH (e9:Event {name: "Afcon 2025 Qualifier"}), (p22:Person {name: "William Troost-Ekong"})
CREATE (p22)-[:PARTICIPATED_IN]->(e9);

MATCH (e9:Event {name: "Afcon 2025 Qualifier"}), (p23:Person {name: "Victor Boniface"})
CREATE (p23)-[:PARTICIPATED_IN]->(e9);

// Relationships for Event 10: "Women's Championship"
MATCH (e10:Event {name: "Women's Championship"}), (p24:Person {name: "Beth Lumsden"})
CREATE (p24)-[:PARTICIPATED_IN]->(e10);

MATCH (e10:Event {name: "Women's Championship"}), (p25:Person {name: "Emily Scarr"})
CREATE (p25)-[:PARTICIPATED_IN]->(e10);

// Relationships for Event 11: "Black Desert Championship"
MATCH (e11:Event {name: "Black Desert Championship"}), (p26:Person {name: "Matt McCarty"})
CREATE (p26)-[:PARTICIPATED_IN]->(e11);

MATCH (e11:Event {name: "Black Desert Championship"}), (p27:Person {name: "Stephan Jaeger"})
CREATE (p27)-[:PARTICIPATED_IN]->(e11);

// Relationships for Event 12: "Alfred Dunhill Links Championship"
MATCH (e12:Event {name: "Alfred Dunhill Links Championship"}), (p28:Person {name: "Nicolas Colsaerts"})
CREATE (p28)-[:PARTICIPATED_IN]->(e12);

MATCH (e12:Event {name: "Alfred Dunhill Links Championship"}), (p29:Person {name: "Cameron John"})
CREATE (p29)-[:PARTICIPATED_IN]->(e12);

// Relationships for Event 13: "Spanish Open"
MATCH (e13:Event {name: "Spanish Open"}), (p30:Person {name: "Angel Hidalgo"})
CREATE (p30)-[:PARTICIPATED_IN]->(e13);

MATCH (e13:Event {name: "Spanish Open"}), (p31:Person {name: "Jon Rahm"})
CREATE (p31)-[:PARTICIPATED_IN]->(e13);

// Relationships for Event 14: "Chicago Marathon"
MATCH (e14:Event {name: "Chicago Marathon"}), (p32:Person {name: "Ruth Chepngetich"})
CREATE (p32)-[:PARTICIPATED_IN]->(e14);

// Relationships for Event 15: "Cold War Sports Doping"
MATCH (e15:Event {name: "Cold War Sports Doping"}), (p33:Person {name: "Birgit Dressel"})
CREATE (p33)-[:PARTICIPATED_IN]->(e15);

MATCH (e15:Event {name: "Cold War Sports Doping"}), (p34:Person {name: "Ines Geipel"})
CREATE (p34)-[:PARTICIPATED_IN]->(e15);

// Relationships for Event 16: "Eliyahu Wellness Centre"
MATCH (e16:Event {name: "Eliyahu Wellness Centre"}), (p35:Person {name: "Town of North Rustico"})
CREATE (p35)-[:PARTICIPATED_IN]->(e16);

MATCH (e16:Event {name: "Eliyahu Wellness Centre"}), (p36:Person {name: "Mayor Heather McKenna"})
CREATE (p36)-[:PARTICIPATED_IN]->(e16);

// Relationships for Event 17: "NHL Debut"
MATCH (e17:Event {name: "NHL Debut"}), (p37:Person {name: "Macklin Celebrini"})
CREATE (p37)-[:PARTICIPATED_IN]->(e17);

// Relationships for Event 18: "World Cup Ski Cross"
MATCH (e18:Event {name: "World Cup Ski Cross"}), (p38:Person {name: "Marielle Thompson"})
CREATE (p38)-[:PARTICIPATED_IN]->(e18);

MATCH (e18:Event {name: "World Cup Ski Cross"}), (p39:Person {name: "Brittany Phelan"})
CREATE (p39)-[:PARTICIPATED_IN]->(e18);

// Relationships for Event 19: "Northern Super League Women's Team Announcement"
MATCH (e19:Event {name: "Northern Super League Women's Team Announcement"}), (p18:Person {name: "Katrine Pedersen"})
CREATE (p18)-[:PARTICIPATED_IN]->(e19);

// Relationships for Event 20: "International Para Hockey Cup"
MATCH (e20:Event {name: "International Para Hockey Cup"}), (p40:Person {name: "Jack Wallace"})
CREATE (p40)-[:PARTICIPATED_IN]->(e20);

MATCH (e20:Event {name: "International Para Hockey Cup"}), (p41:Person {name: "Anton Jacobs-Webb"})
CREATE (p41)-[:PARTICIPATED_IN]->(e20);

// Relationships for Event 21: "Short Track World Championships"
MATCH (e21:Event {name: "Short Track World Championships"}), (p42:Person {name: "William Dandjinou"})
CREATE (p42)-[:PARTICIPATED_IN]->(e21);

// Relationships for Event 22: "FIS World Cup"
MATCH (e22:Event {name: "FIS World Cup"}), (p43:Person {name: "Eliot Grondin"})
CREATE (p43)-[:PARTICIPATED_IN]->(e22);

Find all the  Event:
 

Players participated in Event:

 
Task: Neo4j Queries

1.    Query to Find Two People (or Events) That Are Connected and Display All Paths

Search and get all People between two specific nodes (Joe Root and Zak Crawley) and will show both people connected first.
MATCH path = allShortestPaths((p1:Person {name: "Joe Root"})-[*]-(p2:Person {name: "Zak Crawley"})) RETURN path ORDER BY length(path) ASC;
 

2.    Query to Find Two People (or Events) That Are Not Connected
The query to perform is whether or not two individuals (‘Joe Root’ and ‘Katrine Pedersen’) are not related in any way.
MATCH (p1:Person {name: "Joe Root"}), (p2:Person {name: "Katrine Pedersen"})
WHERE NOT (p1)-[*]-(p2)
RETURN p1.name AS Person1, p2.name AS Person2;


 
returns the names of the people as no connection is found between them.


3.    Two Additional Functionalities for Your Scenario
3.1. Functionality 1: Find All Events by Sport


The query searches for all the events associated with a given sport for instance “Cricket”.
MATCH (e:Event {sport: "Cricket"}) RETURN e.name AS EventName, e.sport AS Sport ORDER BY e.name ASC;

 

3.2 Find Key Players Who Participated in Multiple Events

It uses identification of the various players who are active in more than one event as valuable for following up the decisive performers

MATCH (p:Person)-[:PARTICIPATED_IN]->(e:Event)
WITH p, COUNT(e) AS eventCount
WHERE eventCount > 1
RETURN p.name AS PlayerName, eventCount AS NumberOfEvents
ORDER BY eventCount DESC;

Some Extra Queries 

1.    Find All Key Players for a Specific Event

It can also find all the key performers who were involved in a particular event say the “WNBA Finals Game 2”.
MATCH (p:Person)-[:PARTICIPATED_IN]->(e:Event {name: "WNBA Finals Game 2"})
RETURN p.name AS PlayerName, e.name AS EventName;


 
2.    Find Events That Happened in a Specific Region
The query looks for all events that happened in a given area, for instance, “New York, USA.”
MATCH (e:Event)-[:OCCURRED_AT]->(r:Region {name: "New York, USA"})
RETURN e.name AS EventName, r.name AS RegionName;


 
3.    List All Events in a Specific Sport
The below query will show all the events associated with sports like “Cricket”.
MATCH (e:Event {sport: "Cricket"})
RETURN e.name AS EventName, e.sport AS Sport;

 
4.    Find Events a Pair of Players Participated in Together
It is a query where all events with Joe Root playing alongside Harry Brook are displayed.
MATCH (p1:Person {name: "Joe Root"})-[:PARTICIPATED_IN]->(e:Event)<-[:PARTICIPATED_IN]-(p2:Person {name: "Harry Brook"})
RETURN p1.name AS Player1, p2.name AS Player2, e.name AS EventName;

 

5.    Count the Number of Events in Each Region
That is why the query that is used to answer this question counts the total number of events that were identified in each region.
MATCH (e:Event)-[:OCCURRED_AT]->(r:Region)
RETURN r.name AS RegionName, COUNT(e) AS EventCount
ORDER BY EventCount DESC;

 
6.    List All Events with Outcomes Including a Specific Word
Every event that was searched had outcomes that contained the words ‘victory’.
MATCH (e:Event)
WHERE e.outcome CONTAINS "victory"
RETURN e.name AS EventName, e.outcome AS Outcome;
 

Task: Extended functionality: Analysis of Competing Hypotheses

Implementing the Analysis of Competing Hypotheses (ACH) for Your Database
We will proceed with the uploaded data from MongoDB and neo4j for the purpose of creating a priori an Analysis of Competing Hypothesis (ACH).

Step 1: Define Competing Hypotheses

Let's define two competing hypotheses based on the IOC Presidential Election scenario provided in your data:
●    Hypothesis A: Sebastian Coe will success in the 2025 IOC Presidential Election.
●    Hypothesis B: Juan Antonio Samaranch Jr. will triumph in 2025 IOC Presidential Election.

Step 2: Gather Evidence

According to the somehow different result, we will deem that data collected support or refute the hypotheses with at least three proofs.

Evidence 1: Sebastian Coe's global influence in sports governance.
●    Consistent with Hypothesis A: Coe is well known internationally in the sphere of sports management, and he is now the President of World Athletics. This boosts his candidacy.
●    Inconsistent with Hypothesis B: Samaranch Sr.’s mistake – He’s the lone former Olympic Committee president today, Harald Samaranch Jr., whose administration hasn’t achieved such a large-scale success recently.

Evidence 2: Juan Antonio Samaranch Jr.'s role as IOC Vice President.
●    Consistent with Hypothesis B: Samaranch Jr. occupies a position of the Vice President of the IOC and his next step could well be to assume the position of the IOC President.
●    Inconsistent with Hypothesis A: Coe is not a senior official in the IOC.

Evidence 3: Kirsty Coventry’s potential to split votes.
●    Inconsistent with both Hypotheses: Coventry [78] indicates that if the IOC member is able to stand as a candidate, the possibility of either Coe or Samaranch Jr. winning is reduced because voters may be inclined to vote for the Coventry ticket.

Step 3: Mapping Evidence to Hypotheses

Evidence    Hypothesis A: Coe Wins    Hypothesis B: Samaranch Jr. Wins
1. Coe's global influence as World Athletics president    Consistent    Inconsistent
2. Samaranch Jr.'s role as IOC Vice President    Inconsistent    Consistent
3. Kirsty Coventry’s potential vote split    Inconsistent    Inconsistent

Step 4: Querying the Database

MongoDB Queries:
To find relevant data supporting or refuting the hypotheses, we can query the MongoDB collections you uploaded:

Find events or key players associated with Sebastian Coe:
db.sports_key_value_data.find({ key_players: "Sebastian Coe" }).pretty();

Find events or key players associated with Juan Antonio Samaranch Jr.:
db.sports_key_value_data.find({ key_players: "Juan Antonio Samaranch Jr." }).pretty();
 
Retrieve information about Kirsty Coventry's candidacy:
db.sports_key_value_data.find({ key_players: "Kirsty Coventry" }).pretty();
 
Neo4j Queries:
In Neo4j, we can query relationships and events connected to the candidates:

Find events or positions held by Sebastian Coe:
MATCH (p:Person {name: "Sebastian Coe"})-[:PARTICIPATED_IN]->(e:Event)
RETURN e.name AS Event, e.outcome AS Outcome;
 
Find events or positions held by Juan Antonio Samaranch Jr.:
MATCH (p:Person {name: "Juan Antonio Samaranch Jr."})-[:PARTICIPATED_IN]->(e:Event)
RETURN e.name AS Event, e.outcome AS Outcome;
 
Check for relationships or events involving Kirsty Coventry:
MATCH (p:Person {name: "Kirsty Coventry"})-[:PARTICIPATED_IN]->(e:Event)
RETURN e.name AS Event, e.outcome AS Outcome;
 

Step 5: Conclusion

The competition assessment indicates that both candidates bring certain virtues, although Kirsty Coventry could well act as a vote spoiler and thereby affect the chances of defeating Coe or Samaranch Jr. Based on the evidence:
●    The probability of Coe winning, thus confirming Hypothesis A, is ramped up by his global influence but countered by Samaranch Jr.’s existing leadership of the IOC.
●    Hypothesis B (Samaranch Jr. wins) is supported now that he serves on the International Olympic Committee but other candidates can also win due its Votes splitting effect.

Task: Data type reflection
1.    Comparing MongoDB Geospatial Operators with POSTGIS from PostgreSQL
MongoDB Geospatial Operators: MongoDB provides geospatial query capabilities using two types of data:
2dsphere index: Works with data stored in GeoJSON format for spherical calculations, such as latitude/longitude on Earth.
2d index: Used for flat 2D maps.

MongoDB offers a wide range of geospatial operators:
$geoWithin: Finds documents within a specified geometry.
$geoIntersects: Finds documents that intersect with a given geometry.
$near: Finds documents near a point.
$nearSphere: Similar to $near but calculates distances on a spherical surface (e.g. Earth).

MongoDB supports several geometry types (e.g. points, lines, polygons) and can perform operations like:
Distance-based queries: Using $near and $geoWithin to find points near a location or within an area.
Spatial analysis: Like intersections and containment checks with $geoIntersects.

Another geospatial database is PostgreSQL with POSTGIS, which is nearly twice as large as MySQL and MARIA DB in regards to the geospatial functions and operators. These include:

ST_Within: Checks if a geometry is within another.
ST_Intersects: Checks if two geometries intersect.
ST_Distance: Calculates the distance between two geometries.
ST_Buffer: Expands a geometry by a certain distance, forming a buffer zone.
ST_Union, ST_Difference: Advanced geometry operations like combining or subtracting geometries.

PostGIS can handle advanced geometries types, 3D geometries, geodetic data, raster data and more that 1000 different functions.

Comparison:
MongoDB: Mainly designed to support simple searches on geographic information and is appropriate for applications requiring easy jurisdictional search capabilities (for example, identifying nearby items).
PostGIS: They support far more complex geospatial operations, such as spatial modeling, 3D data support, and raster capabilities, and provide a stronger fit for highly GIS-intense applications, such as city planning or the analysis of environmental issues.

Using MongoDB Geospatial Operators in your System: MongoDB geospatial operators can be highly effective in use cases such as:

Mapping Events or Locations: In the current sports system, this means that if certain events are anchored to geographical coordinates like stadiums or certain cities,then query mechanisms would enable users to search for events within a given radius or a certain region in relationship to a given point.
User Proximity Searches: For example, fans could find events in their vicinity by using operators such as $near or $geoWithin.
Tracking Athlete Movements: If the system captures position or movement of an athlete during a game, location based query will be useful in analyzing the geospatial data.
2.    Comparing MongoDB TImeseries Operators with TimescaleDB from PostgreSQL
MongoDB TImeseries Operators: MongoDB 5.0 introduced native time series collections to handle time-series data efficiently. MongoDB’s time-series operators include:
●    $bucketAuto: Automatically groups data into dynamic buckets for aggregation based on time intervals.
●    $group: Used for grouping data by specific time periods (e.g. by day, week, month).
●    #match: Filters time-based data.
●    $sort: Orders data based on the timestamp.
●    $dateAdd, $dateDiff: Supports date arithmetic and querying.

MongoDB time series collections are designed for the insert – intensive operations and organize the sensor or event data over time.

●    TimescaleDB Operators: TimescaleDB, a time-series extension for PostgreSQL, is designed specifically for time-series workloads. Its operators include:
●    Time-based partitioning: Splits data automatically based on time intervals.
●    Continuous Aggregates: Precomputes and stores aggregated results over time windows for real-time querying.
●    Compression: Automatically compresses older time-series data to save storage space.
●    Custom Hypertables: Allows users to organize data into time-based tables for efficient querying and storage.

TimescaleDB also supports complex time-series operations, such as:
●    Gap-filling: Automatically fills in missing data points in a time-series.
●    Downsampling: Aggregates data over larger time intervals (e.g. averaging values per hour or day).

Comparison:
MongoDB: Offers only the most minimal time-series support while optimizing for efficient storage and retrieval of timestamped values. Using MongoDB makes most sense in applications with continuous data feeds and straightforward data summarizations.
TimescaleDB: Provides high-level TS analysis and optimizations like gap-filling, downsampling or compaction thus more appropriate for cases where fine-grained monitoring is done over a longer time span.

Using MongoDB Timeseries Operators in your System:
Tracking Sports Events Over Time: Time-series collections could be used with event durations for events you are looking to analyze, such as ticket sales or number of athletes and other statistics regarding performances in sports events.
Real-Time Monitoring: For example in athlete tracking or sports performance analysis, you can follow $bucketAuto and $group to segment data and $match for time range selection.
Performance Analysis:  I believe that MongoDB’s $dateDiff and $dateAdd could find application in measuring differences for time frames between sports events or athlete activities.
3.    Issues Importing from MongoDB or JSON to Neo4j (Using APOC Plugins)
Common Issues when Importing from MongoDB to Neo4j:
1.    Schema Differences:
MongoDB: Documents within a collection can be assigned various fields, which is devoid of schema, and may cause issues with the formation of graph structure in Neo4j.
Neo4j: Need for more explicit schema to nodes and relationships; hence, when the structures used in MongoDB are inconsistent or complicated, it becomes challenging.
Issue: Data from MongoDB collections may not necessarily conform to a consistent graph structure; some documents can lack particular fields.

2.    Nested or Complex Data Structures:
MongoDB: Also it supports deeply nested documents and arrays. These nested structures can contain embedded documents and lists, and direct conversion of into Neo4j nodes and relationships is therefore difficult.
Neo4j: llustrates information with different points connected through a series of relations forming a flat structure.
Issue: MongoDB documents might be nested and can be translated into Neo4j nodes and relationships, which can be done only through logic implementation.

3.    Differing Data Types:
MongoDB: Supports a number of data formats such as arrays, objects (documents), as well as binary data.
Neo4j: Specialises mostly on nodes and edges, does not natively support some of the MongoDB data types (such as arrays of documents).
Issue: Mapping MongoDB data types to Neo4j, specifically one-to-one, more often than not results in inconveniences (for instance, mapping an array of deeply embedded documents to Neo4j). For instance, it is mandatory to map an array into several nodes and documents within this array may turn into linked nodes.

4.    Loss of Relationships:
MongoDB: This does not support direct relationships between documents (as would be done in a SQL join ) & often links have to be done manually through reference fields such as ObjectIds.
Neo4j: Meant for graph relations, so when collections are imported, it may not easily deduce meaningful relation on nodes.
Issue: The absence of standard or developed relationships in MongoDB may result in Neo4j having no way of deducing the connections of the nodes; relations have to be created during the importation process.

5.    Performance and Scalability:
MongoDB: High throughput, base unit of horizontal scalability guaranteed.
Neo4j: Though Neo4j excels in graph traversal, every large amount of data, say millions of documents from MongoDB, and integrating into Neo4j can be complex considering different ways of storing and traversing data.
Issue: Large MongoDB datasets may call for heavy prestaging import that puts off Neo4j’s performance, and there is a need for optimization tools like APOC to enable iteration through and transform.


    Using APOC Plugins:
APOC is essentially a toolbox for adding procedures on Cypher which include procedures for importing data from mongoDB. APOC helps with tasks like:
Unwinding arrays: Discussion on how to handle nested or array data in MongoDB.
Transforming documents: Inline with the disk usage and access strategy, this entails mapping the MongoDB documents into the appropriate node/relationship model in Neo4j.

References:

Angles, R., & Gutierrez, C. (2019). The property graph database model. In Lecture Notes in Computer Science (pp. 206-220). Springer. https://doi.org/10.1007/978-3-030-14099-6_15
Bank, J., & Guttman, D. (2021). Mastering MongoDB 4.x: Harness the power of MongoDB 4.x to build and deploy scalable, secure, and reliable applications (2nd ed.). Packt Publishing.
Chodorow, K. (2013). MongoDB: The definitive guide (2nd ed.). O'Reilly Media.
Dominguez, A., & Zambrano, F. (2020). An overview of MongoDB and Neo4j for unstructured and graph data models in modern applications. Journal of Data Science and Engineering, 2(4), 345-356. https://doi.org/10.1007/s42022-020-00076-9
Geva, A., & Brezavscek, A. (2019). Geospatial data analysis using MongoDB and PostGIS: Applications and performance comparison. Springer.
Halpin, T. (2018). Using MongoDB for time-series data in IoT applications. IEEE Internet of Things Journal, 5(4), 2608-2614. https://doi.org/10.1109/JIOT.2018.2792652
Kiltz, S. (2020). Practical examples of Analysis of Competing Hypotheses (ACH). Intelligence and National Security, 35(5), 730-749. https://doi.org/10.1080/02684527.2020.1717256
Nagpal, S., & Sharma, P. (2022). Practical Neo4j: From beginner to expert (1st ed.). Apress.
Neo4j. (2021). APOC procedures user guide. Retrieved from https://neo4j.com/docs/apoc/current/
Robinson, I., Webber, J., & Eifrem, E. (2015). Graph databases: New opportunities for connected data (2nd ed.). O'Reilly Media.
Timescale. (2022). Introduction to TimescaleDB: A time-series extension to PostgreSQL for IoT and analytics applications. TimescaleDB Documentation. https://www.timescale.com/docs/
White, J. (2018). Introduction to geospatial databases: Using PostGIS and MongoDB for location-based services. O'Reilly Media.

Advanced Database Design and Implementation

Are you confident that you will achieve the grade? Our best Expert will help you improve your grade

Order Now


Best Universities In Australia

Best In Countries

Upload your requirements and see your grades improving.

10K+ Satisfied Students. Order Now

Disclaimer: The reference papers given by DigiAssignmentHelp.com serve as model papers for students and are not to be presented as it is. These papers are intended to be used for reference & research purposes only.
Copyright © 2025 DigiAssignmentHelp.com. All rights reserved.
Powered by Vide Technologies

100% Secure Payment

paypal