Question: When did the commonwealth, in which Madonna angered the public by rubbing the flag between her thighs, gain its independence from Spain?

full_context: Document 1: History of Puerto Rico: On August 10, 1815, the Royal Decree of Grace was issued, allowing foreigners to enter Puerto Rico (including French refugees from Hispaniola), and opening the port to trade with nations other than Spain. This was the beginning of agriculture-based economic growth, with sugar, tobacco, and coffee being the main products. The Decree also gave free land to anyone who swore their loyalty to the Spanish Crown and their allegiance to the Roman Catholic Church. Thousands of families from all regions of Spain (particularly Asturias, Catalonia, Majorca and Galicia), Germany, Corsica, Ireland, France, Portugal, the Canary Islands and other locations, escaping from harsh economic times in Europe and lured by the offer of free land, soon immigrated to Puerto Rico. However, these small gains in autonomy and rights were short lived. After the fall of Napoleon, absolute power returned to Spain, which revoked the Cádiz Constitution and reinstated Puerto Rico to its former condition as a colony, subject to the unrestricted power of the Spanish monarch.
Document 2: 51st state: Puerto Rico has been under U.S. sovereignty for over a century when it was ceded to the U.S. by Spain following the end of the Spanish–American War, and Puerto Ricans have been U.S. citizens since 1917. The island's ultimate status has not been determined as of 2012[update], its residents do not have voting representation in their federal government. Puerto Rico has limited representation in the U.S. Congress in the form of a Resident Commissioner, a delegate with limited no voting rights. Like the states, Puerto Rico has self-rule, a republican form of government organized pursuant to a constitution adopted by its people, and a bill of rights.
Document 3: Madonna (entertainer): In 1978, she dropped out of college and relocated to New York City. She had little money and worked as a waitress at Dunkin' Donuts and with modern dance troupes, taking classes at the Alvin Ailey American Dance Theater and eventually performing with Pear Lang Dance Theater. Madonna said of her move to New York, "It was the first time I'd ever taken a plane, the first time I'd ever gotten a taxi cab. I came here with $35 in my pocket. It was the bravest thing I'd ever done." She started to work as a backup dancer for other established artists. Madonna claimed that during a late night she was returning from a rehearsal, when a pair of men held her at knifepoint and forced her to perform fellatio. Madonna later commented that "the episode was a taste of my weakness, it showed me that I still could not save myself in spite of all the strong-girl show. I could never forget it."
Document 4: Madonna (entertainer): In September 1993, Madonna embarked on The Girlie Show World Tour, in which she dressed as a whip-cracking dominatrix surrounded by topless dancers. In Puerto Rico she rubbed the island's flag between her legs on stage, resulting in outrage among the audience. In March 1994, she appeared as a guest on the Late Show with David Letterman, using profanity that required censorship on television, and handing Letterman a pair of her panties and asking him to smell it. The releases of her sexually explicit films, albums and book, and the aggressive appearance on Letterman all made critics question Madonna as a sexual renegade. Critics and fans reacted negatively, who commented that "she had gone too far" and that her career was over.
Document 5: Madonna (entertainer): Academics noted that with her videos, Madonna was subtly reversing the usual role of male as the dominant sex. This symbolism and imagery was probably the most prevalent in the music video for "Like a Prayer". The video included scenes of an African-American church choir, Madonna being attracted to a statue of a black saint, and singing in front of burning crosses. This mix of the sacred and the profane upset the Vatican and resulted in the Pepsi commercial withdrawal. In 2003, MTV named her "The Greatest Music Video Star Ever" and said that "Madonna's innovation, creativity and contribution to the music video art form is what won her the award."
Document 6: Puerto Rico: Originally populated by the indigenous Taíno people, the island was claimed in 1493 by Christopher Columbus for Spain during his second voyage. Later it endured invasion attempts from the French, Dutch, and British. Four centuries of Spanish colonial government influenced the island's cultural landscapes with waves of African slaves, Canarian, and Andalusian settlers. In the Spanish Empire, Puerto Rico played a secondary, but strategic role when compared to wealthier colonies like Peru and the mainland parts of New Spain. Spain's distant administrative control continued up to the end of the 19th century, helping to produce a distinctive creole Hispanic culture and language that combined elements from the Native Americans, Africans, and Iberians. In 1898, following the Spanish -- American War, the United States acquired Puerto Rico under the terms of the Treaty of Paris. The treaty took effect on April 11, 1899.
Document 7: Madonna (entertainer): Madonna's use of sexual imagery has benefited her career and catalyzed public discourse on sexuality and feminism. As Roger Chapman documents in Culture Wars: An Encyclopedia of Issues, Viewpoints, and Voices, Volume 1 (2010), she has drawn frequent condemnation from religious organizations, social conservatives and parental watchdog groups for her use of explicit, sexual imagery and lyrics, religious symbolism, and otherwise "irreverent" behavior in her live performances. The Times wrote that she had "started a revolution amongst women in music ... Her attitudes and opinions on sex, nudity, style and sexuality forced the public to sit up and take notice." Professor John Fiske noted that the sense of empowerment that Madonna offers is inextricably connected with the pleasure of exerting some control over the meanings of self, of sexuality, and of one's social relations. In Doing Gender in Media, Art and Culture (2009), the authors noted that Madonna, as a female celebrity, performer, and pop icon, is able to unsettle standing feminist reflections and debates. According to lesbian feminist Sheila Jeffreys, Madonna represents woman's occupancy of what Monique Wittig calls the category of sex, as powerful, and appears to gleefully embrace the performance of the sexual corvée allotted to women. Professor Sut Jhally has referred to Madonna as "an almost sacred feminist icon."
Document 8: Puerto Rico: Originally populated by the indigenous Taíno people, the island was claimed in 1493 by Christopher Columbus for Spain during his second voyage. Later it endured invasion attempts from the French, Dutch, and British. Four centuries of Spanish colonial government influenced the island's cultural landscapes with waves of African slaves, Canarian, and Andalusian settlers. In the Spanish Empire, Puerto Rico played a secondary, but strategic role when compared to wealthier colonies like Peru and the mainland parts of New Spain. Spain's distant administrative control continued up to the end of the 19th century, helping to produce a distinctive creole Hispanic culture and language that combined elements from the Native Americans, Africans, and Iberians. In 1898, following the Spanish -- American War, the United States acquired Puerto Rico under the terms of the Treaty of Paris.
Document 9: La Isla Bonita: In the accompanying music video, Madonna portrayed two opposite characters – a young, pious Catholic woman and a glamorous, passionate Latina.  The Latin style and the flamenco red dress she wore became a trend later.  The song is one of the most performed live songs by Madonna, appearing in six of her world tours, the most recent being on the Rebel Heart Tour (2015–16). Madonna  has regularly performed the song in its Spanish form, sometimes with tribal or folk songs and remixes to accompany it. The song has been covered by various artists across the world, including Byanka (Mexico), Elvy Sukaesih (Indonesia) and Alizée (France).
Document 10: Madonna (entertainer): Madonna embarked on the Confessions Tour in May 2006, which had a global audience of 1.2 million and grossed over $193.7 million, becoming the highest-grossing tour to that date for a female artist. Madonna used religious symbols, such as the crucifix and Crown of Thorns, in the performance of "Live to Tell". It caused the Russian Orthodox Church and the Federation of Jewish Communities of Russia to urge all their members to boycott her concert. At the same time, the International Federation of the Phonographic Industry (IFPI) announced officially that Madonna had sold over 200 million copies for her albums alone worldwide.
Document 11: Madonna (entertainer): Following Die Another Day, Madonna collaborated with fashion photographer Steven Klein in 2003 for an exhibition installation named X-STaTIC Pro=CeSS. It included photography from a photo shoot in W magazine, and seven video segments. The installation ran from March to May in New York's Deitch Projects gallery. It traveled the world in an edited form. The same year, Madonna released her ninth studio album, American Life, which was based on her observations of American society; it received mixed reviews. She commented, "[American Life] was like a trip down memory lane, looking back at everything I've accomplished and all the things I once valued and all the things that were important to me." Larry Flick from The Advocate felt that "American Life is an album that is among her most adventurous and lyrically intelligent" while condemning it as "a lazy, half-arsed effort to sound and take her seriously." The title song peaked at number 37 on the Hot 100. Its original music video was canceled as Madonna thought that the video, featuring violence and war imagery, would be deemed unpatriotic since America was then at war with Iraq. With four million copies sold worldwide, American Life was the lowest-selling album of her career at that point.
Document 12: Independence movement in Puerto Rico: After four hundred years of colonial rule by the Spanish Empire, Puerto Rico finally received its sovereignty in 1897 through a Carta de Autonomía (Charter of Autonomy). It was signed by Spanish Prime Minister Práxedes Mateo Sagasta and ratified by the Spanish Cortes.
Document 13: Puerto Rico: Originally populated by the indigenous Taíno people, the island was claimed in 1493 by Christopher Columbus for the Crown of Castile during his second voyage. Later it endured invasion attempts from the French, Dutch, and British. Four centuries of Spanish colonial government transformed the island's ethnic, cultural and physical landscapes primarily with waves of African slaves, Canarian, and Andalusian settlers. In the Spanish imperial imagination, Puerto Rico played a secondary, but strategic role when compared to wealthier colonies like Peru and the mainland parts of New Spain. Spain's distant administrative control continued up to the end of the 19th century, helping to produce a distinctive creole Hispanic culture and language that combined elements from the Native Americans, Africans, and Iberians. In 1898, following the Spanish -- American War, the United States acquired Puerto Rico under the terms of the Treaty of Paris.
Document 14: Madonna (entertainer): Madonna entered mainstream films in February 1985, beginning with a brief appearance as a club singer in Vision Quest, a romantic drama film. Its soundtrack contained two new singles, her U.S. number-one single, "Crazy for You", and another track "Gambler". She also played the title role in the 1985 comedy Desperately Seeking Susan, a film which introduced the song "Into the Groove", her first number-one single in the UK. Her popularity relegated the film as a Madonna vehicle, despite not having lead actress billing. The New York Times film critic Vincent Canby named it one of the ten best films of 1985.Beginning in April 1985, Madonna embarked on her first concert tour in North America, The Virgin Tour, with the Beastie Boys as her opening act. She progressed from playing CBGB and the Mudd Club to playing large sporting arenas. The tour saw the peak of Madonna wannabe phenomenon, with lots of female attendees dressing like her. At that time, she released two more hits, "Angel" and "Dress You Up", making all four singles from the album peak inside the top five on the Hot 100 chart. In July, Penthouse and Playboy magazines published a number of nude photos of Madonna, taken in New York in 1978. She had posed for the photographs as she needed money at the time, and was paid as little as $25 a session. The publication of the photos caused a media uproar, but Madonna remained "unapologetic and defiant". The photographs were ultimately sold for up to $100,000. She referred to these events at the 1985 outdoor Live Aid charity concert, saying that she would not take her jacket off because "[the media] might hold it against me ten years from now."
Document 15: History of Puerto Rico: Located in the northeastern Caribbean, Puerto Rico formed a key part of the Spanish Empire from the early years of the exploration, conquest and colonization of the New World. The island was a major military post during many wars between Spain and other European powers for control of the region in the 16th, 17th and 18th centuries. The smallest of the Greater Antilles, Puerto Rico was a stepping - stone in the passage from Europe to Cuba, Mexico, Central America, and the northern territories of South America. Throughout most of the 19th century until the conclusion of the Spanish -- American War, Puerto Rico and Cuba were the last two Spanish colonies in the New World; they served as Spain's final outposts in a strategy to regain control of the American continents. Realizing that it was in danger of losing its two remaining Caribbean territories, the Spanish Crown revived the Royal Decree of Graces of 1815. The decree was printed in Spanish, English and French in order to attract Europeans, with the hope that the independence movements would lose their popularity and strength with the arrival of new settlers. Free land was offered to those who wanted to populate the islands on the condition that they swear their loyalty to the Spanish Crown and allegiance to the Roman Catholic Church.
ground_truth: 1897
sub_queries: In which country did Madonna rubbed the country's flag between her thighs that anger the public? Answer: Puerto Rico
when did Puerto Rico gain their independence from spain Answer: 1897