Data Exploration of Avengers: Endgame

Avengers: Endgame arrived on April 27th, and shows no signs of stopping its box-office gains anytime soon. This latest installement in the Marvel Cinematic Universe (MCU) serves as the final climax of the past 10 years of MCU fims; now known as the Infinity Saga. I've wanted to make this post since the films inital release, but chose to hold off given the spoilers that any projects or writeups about it will entail.

(Intro To Be Continued)

Inserting Dataset:

We begin by adding some data about the the film's events and characters:

SPARQL
CLEAR GRAPH ;

SPARQL
PREFIX endgame: <#>
INSERT INTO GRAPH <urn:mcu:endgame>
 {
<#ironman>
schema:name "Iron Man";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#warmachine>
schema:name "War Machine";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#nebula>
schema:name "Nebula";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#blackwidow>
schema:name "Black Widow";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#hulk>
schema:name "Hulk";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#hawkeye>
schema:name "Hawkeye";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#rocket>
schema:name "Rocket";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#captainamerica>
schema:name "Captain America";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#thor>
schema:name "Thor";
schema:image ;
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#antman>
schema:name "Ant-Man";
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#captainmarvel>
schema:name "Captain Marvel";
schema:memberOf <#theavengers>;
endgame:survivedDecimation "true"^^xsd:boolean.

<#bucky>
schema:name "Bucky";
endgame:survivedDecimation "false"^^xsd:boolean.

<#blackpanther>
schema:name "Black Panther";
endgame:survivedDecimation "false"^^xsd:boolean.

<#falcon>
schema:name "Falcon";
schema:memberOf <#theavengers>;
endgame:survivedDecimation "false"^^xsd:boolean.

<#scarletwitch>
schema:name "Scarlet Witch";
endgame:survivedDecimation "false"^^xsd:boolean.

<#starlord>
schema:name "Starlord";
endgame:survivedDecimation "false"^^xsd:boolean.

<#mantis>
schema:name "Mantis";
endgame:survivedDecimation "false"^^xsd:boolean.

<#drax>
schema:name "Drax";
endgame:survivedDecimation "false"^^xsd:boolean.

<#drstrange>
schema:name "Doctor Strange";
endgame:survivedDecimation "false"^^xsd:boolean.

<#thewasp>
schema:name "The Wasp";
endgame:survivedDecimation "false"^^xsd:boolean.

<#hankpym>
schema:name "Hank Pym";
endgame:survivedDecimation "false"^^xsd:boolean.

<#janetvandyne>
schema:name "Janet van Dyne";
endgame:survivedDecimation "false"^^xsd:boolean.

<#thanos>
a endgame:Villain;
schema:name "Thanos";
endgame:survivedDecimation "true"^^xsd:boolean.


<#ThanosFight1>
a endgame:Battle;
schema:name "Fight With Thanos (Post Snap)";
endgame:heroes <#captainmarvel>,
        <#captainamerica>,
        <#thor>,
        <#rocket>,
        <#warmachine>,
        <#nebula>,
        <#blackwidow>;
endgame:villains
        <#thanos>.


#Infinity Stones

<#powerstone>
a endgame:InfinityStone;
schema:name "Power Stone";
endgame:casedIn <#orb>;
schema:image .

<#spacestone>
a endgame:InfinityStone;
schema:name "Space Stone";
endgame:casedIn <#tesseract>;
schema:image .


<#mindstone>
a endgame:InfinityStone;
schema:name "Mind Stone";
endgame:casedIn <#scepter>;
schema:image .

<#soulstone>
a endgame:InfinityStone;
schema:name "Soul Stone";
schema:image .

<#timestone>
a endgame:InfinityStone;
schema:name "Time Stone";
endgame:casedIn <#eyeofagomotto>;
schema:image .

<#realitystone>
a endgame:InfinityStone;
schema:name "Reality Stone";
endgame:casedIn <#ather>;
schema:image .


#Heists

<#powerstoneheist>
a endgame:Event;
schema:name "Power Stone Heist";
endgame:location <#morag>;
endgame:year "2012";
endgame:pastFilm <#guardiansofthegalaxy>;
endgame:target <#powerstone>;
endgame:heistMembers <#nebula>, <#warmachine>;
endgame:heistSuccess "true"^^xsd:boolean.

<#spacestoneheist-1>
a endgame:Event;
schema:name "Space Stone Heist #1";
endgame:location <#nyc>;
endgame:year "2012";
endgame:pastFilm <#theavengers-film>;
endgame:target <#spacestone>;
endgame:heistMembers <#ironman>, <#antman>;
endgame:heistSuccess "false"^^xsd:boolean.

<#spacestoneheist-2>
a endgame:Event;
schema:name "Space Stone Heist #2";
endgame:location <#camplehigh>;
endgame:year "1970";
endgame:target <#spacestone>;
endgame:pastFilm <#theavengers-film>;
endgame:heistMembers <#ironman>, <#captainamerica>;
endgame:heistSuccess "true"^^xsd:boolean.

<#mindstoneheist>
a endgame:Event;
schema:name "Mind Stone Heist";
endgame:location <#nyc>;
endgame:year "2012";
endgame:pastFilm <#theavengers-film>;
endgame:target <#mindstone>;
endgame:heistMembers <#captainamerica>;
endgame:heistSuccess "true"^^xsd:boolean.

<#soulstoneheist>
a endgame:Event;
schema:name "Soul Stone Heist";
endgame:location <#vormir>;
endgame:year "2014";
endgame:pastFilm <#infinitywar>;
endgame:target <#soulstone>;
endgame:heistMembers <#hawkeye>,<#blackwidow>;
endgame:heistSuccess "true"^^xsd:boolean.

<#timestoneheist>
a endgame:Event;
schema:name "Time Stone Heist";
endgame:location <#nyc>;
endgame:year "2012";
endgame:pastFilm <#theavengers-film>;
endgame:target <#timestone>;
endgame:heistMembers <#hulk>;
endgame:heistSuccess "true"^^xsd:boolean.

<#realitystoneheist>
a endgame:Event;
schema:name "Reality Stone Heist";
endgame:location <#asgard>;
endgame:year "2013";
endgame:pastFilm <#thorthedarkworld>;
endgame:target <#realitystone>;
endgame:heistMembers <#thor>,<#rocket>;
endgame:heistSuccess "true"^^xsd:boolean.

#Locations

<#morag>
a schema:Place;
schema:name "Morag";
schema:image ;
schema:schema:filmTimeline <#guardiansofthegalaxy>.

<#nyc>
a schema:Place;
schema:name "New York City";
schema:image ;
schema:filmTimeline <#theavengers-film>.

<#asgard>
a schema:Place;
schema:name "Asgard";
schema:image ;
schema:filmTimeline <#thorthedarkworld>.

<#camplehigh>
a schema:Place;
schema:name "Camp Lehigh";
schema:image .

<#vormir>
a schema:Place;
schema:name "Vormir";
schema:image ;
schema:filmTimeline <#infinitywar>.

#Films
<#infinitywar>
a schema:Film;
schema:name "Avengers: Infinity War";
owl:sameAs .

#TEMPORARY ONTOLOGY PLACEMENT

#Classes

endgame:Avenger
a owl:Class;
schema:name "Avenger";
schema:description "A member of the Avengers group";
rdfs:subClassOf schema:Person.

endgame:Event
a owl:Class;
schema:name "Event";
schema:description "A significant occurrence during the film. ";
rdfs:subClassOf schema:Event.

endgame:Team
a owl:Class;
schema:name "The Avengers";
schema:description "A team of extraordinary individuals with super powers or other unique chatacteristics.";
rdfs:subClassOf schema:Person.

endgame:Battle
a owl:Class;
schema:name "Battle";
schema:description "An occured fight event between heroes and villans";
rdfs:subClassOf schema:Event.

#Properties
endgame:survivedDecimation
a rdf:Property;
a owl:DatatypeProperty;
schema:name "survivedDecimation";
schema:description "Confirms if somebody survived The Decimation";
schema:domainIncludes schema:Person;
schema:rangeIncludes xsd:boolean.

endgame:heroes
a rdf:Property;
a owl:ObjectProperty;
schema:name "heroes";
schema:description "Identifies superheroes and allies in a battle.";
schema:domainIncludes endgame:Battle;
schema:rangeIncludes schema:Person.

endgame:member
a rdf:Property;
a owl:ObjectProperty;
schema:name "member";
schema:description "Creates relation between a person and group";
schema:domainIncludes endgame:Character;
schema:rangeIncludes endgame:Team.

endgame:heistSuccess
a rdf:Property;
a owl:DatatypeProperty;
schema:name "heistSuccess";
schema:description "Answers if the Infinity Stone heist was successfull";
schema:domainIncludes endgame:Event;
schema:rangeIncludes xsd:Boolean.

endgame:heistMembers
a rdf:Property;
a owl:ObjectProperty;
schema:name "heistMembers";
schema:description "Answers if the Infinity Stone heist was successfull";
schema:domainIncludes endgame:Event;
schema:rangeIncludes schema:Person.

endgame:location
a rdf:Property;
a owl:ObjectProperty;
schema:name "location";
schema:description "defines a location";
schema:domainIncludes endgame:Event;
schema:rangeIncludes schema:Place.

endgame:year
a rdf:Property;
a owl:DataTypeProperty;
schema:name "year";
schema:description "defines a year";
schema:domainIncludes endgame:Event;
schema:rangeIncludes xsd:integer.

endgame:pastFilm
a rdf:Property;
a owl:ObjectProperty;
schema:name "pastFilm";
schema:description "defines a past film of reference";
schema:domainIncludes endgame:Event,
           schema:Person,
           endgame:InfinityStone;
schema:rangeIncludes schema:Movie.
};

iSQL

Done. -- 7 msec.


/sparql

Insert into <urn:mcu:endgame>, 66 (or less) triples -- done

Part 1: Who survived?

The movie starts with the dusting of Hawkeye's family, in addiiton to Iron Man and Nebula returning to Earth, with assistance from Captain Marvel. As Thanos's actions are explained to the group, we learn more about the Characters who are currently dusted or unnacounted for.

In order to find the characters who survived the snap, we will be querying for relations in the inserted dataset, that signify post-snap survival status.

Example Statement Expressed in RDF-TURTLE syntax:

<#ironman> endgame:survivedDecimation "true"

prefix endgame: <#>

SELECT *
FROM  <urn:mcu:endgame>
{
?character endgame:survivedDecimation "true"^^xsd:boolean;
schema:name ?name
}

Interactive Table

Click on the cell hyperlinks, to see more information about each Character

Character

Part 2: The First Battle

After seeing a giant radiation signal coming from a distant planet, the remaining Avengers decide to confront the Mad Titan and do whatever it takes to reverse the snap. 

Event Details Expressed in RDF-TURTLE syntax

<#ThanosFight1>

a endgame:Battle;

schema:name "Fight With Thanos (Post Snap)";

endgame:heroes <#captainmarvel>,
                             <#captainamerica>,
                             <#thor>,
                             <#rocket>,
                             <#warmachine>,
                             <#nebula>,
                             <#blackwidow>;

endgame:villains  <#thanos>.

PREFIX endgame: <#>

SELECT DISTINCT
?uri
?heroes
FROM <urn:mcu:endgame>
{
    ?uri schema:name ?heroes;
    ^endgame:heroes endgame:ThanosFight1.
}

Interactive Table

Click on the cell hyperlinks, to see more information about each Character

Characters

Part 3: The Time Heists

Thanos explains that he destroyed the Infinity Stones in order to keep the results of his work permanant. 5 Years after Thano's death by Thor, the remaining Avengers on Earth decide to time travel to past events in newly created alternate timelines; where the Infnity Stones are present. 

PREFIX endgame: <#>

SELECT DISTINCT
?heistURI
?hero
?name as ?avenger
?heist
?locationURI
?location
?year
?stone as ?stoneURI
?stoneName
?success
FROM
 {
 ?heistURI a endgame:Event;
 schema:name ?heist;
 endgame:location ?locationURI;
 endgame:year ?year;
 endgame:heistMembers ?hero;
 endgame:target ?stone;
 endgame:heistSuccess ?success.

 ?hero schema:name ?name.

 ?stone schema:name ?stoneName.
 
 ?locationURI schema:name ?location.

}

Character Heist Location Year Stone Success