October 26, 2026
Impact of News on the Stock Market Using Semantic Graphs
Rafael Leal Leoni; Edilson José Rodrigues
DOI: 10.22167/2675-6528-202603375
Article derived from a Course Conclusion Work (TCC), with content based on the student’s original work and adapted to the editorial format of the E&S Magazine with the support of the ResumeAI tool, an artificial intelligence solution developed by Instituto Pecege for textual synthesis and organization.
Summary
The applicability of semantic graphs in the analysis of the impact of corporate news on the Brazilian stock market was investigated. The objective was to analyze the utility of the OpenSPG platform in representing and analyzing the relationships between corporate news and companies listed on B3, through the construction and exploration of a knowledge graph to understand the informational impact on stock price behavior. The research was characterized as an applied, descriptive, and exploratory case study, using public data on news and stock prices of 5 companies (6 tickers) from B3, collected between 11/28/2024 and 11/28/2025. The information was processed and integrated into a semantic structure using OpenSPG, allowing for exploratory queries and analyses. The results indicated that certain companies and sectors acted as informational hubs, concentrating a larger volume of news. It was observed that there was no significant association between the volume of news and daily price volatility, and the impact of news tended to occur more sharply on days subsequent to publication, peaking on the third day. Companies in the same sector showed similar patterns of reaction to sectoral news. It was concluded that the use of semantic graphs, through OpenSPG, facilitated the understanding of the relationships between news information and the stock market, offering a structured and intuitive representation for financial exploratory analyses.
Keywords: Exploratory data analysis; Semantic graphs; Stock market; Corporate news; OpenSPG.
1. Introduction
The stock market is characterized by its high sensitivity to information, being constantly influenced by corporate news, economic events, and institutional decisions that affect investor expectations. The dissemination of information through digital media has significantly increased the speed and volume of available news, making it more complex to understand how this information relates to stock price behavior. In this context, the analysis of informational impact on the financial market has come to occupy a central position in academic studies and data analysis practices applied to finance.
The classic literature in finance sustains that asset prices reflect the information available in the market, as proposed by the Efficient Market Hypothesis (FAMA, 1970). However, later studies indicate that the assimilation of information does not always occur immediately or homogeneously, potentially generating differentiated reactions among companies and sectors (SHILLER, 1981; TETLOCK, 2007). Thus, the mere availability of information does not guarantee its instantaneous incorporation into prices, which opens space for investigations into the structure and dynamics of the informational flow. Furthermore, investor attention and exposure to news can directly influence buying and selling behavior (BARBER & ODEAN, 2008), while the uncertainty generated by political and economic news is directly linked to stock market volatility (BAKER et al., 2026). Recent studies even point to a delayed response in stock prices to certain news events, challenging the immediacy of assimilation (JONES, 2022).
In recent years, data science-based approaches have been widely used to analyze the relationship between news and the financial market. Many of these studies employ Natural Language Processing (NLP) and sentiment analysis techniques to extract textual information and relate it to stock price variations. Although effective in various contexts, these methodologies require complex models, high computational cost, and specific language adjustments, which can limit their applicability in exploratory or smaller-scale studies (ARIAS et al., 2022).
Alternatively, semantic graphs or knowledge graphs have stood out as a structured way to represent entities and their relationships, allowing the integration of heterogeneous data and the performance of more intuitive exploratory queries. According to Hogan et al. (2021), knowledge graphs enable an explicit representation of data semantics, favoring relational and contextual analyses. In the financial environment, this approach has been used to map connections between companies, sectors, events, and information sources, contributing to a more systemic view of the market (ZHANG et al., 2020). A comprehensive review of the topic confirms the growing importance and diverse applications of knowledge graphs in the financial environment (PRIYADARSHINI et al., 2025).
In this scenario, the OpenSPG (Open Semantic Platform for Graphs) platform emerges as an open-source tool focused on building and exploring semantic graphs, offering resources for ontology modeling, data ingestion, and structured queries. Its application in stock market studies allows for the investigation of how corporate news relates to companies and sectors, without the need for advanced text analysis techniques. Thus, the use of OpenSPG presents itself as a viable methodological alternative for exploratory analyses of informational impact in the financial market.
The relevance of this study is manifested in two main spheres: academic and practical. From an academic point of view, the work demonstrates, in an applied manner, how semantic graphs can assist in organizing and interpreting the relationships between news and the Brazilian stock market. Additionally, by using public data and an open-source tool, the study contributes to the dissemination of accessible and replicable approaches in the field of financial data analysis, presenting a methodology alternative to purely tabular models or those based on computationally expensive NLP techniques. In the practical sphere, the study aims to meet the demands of professionals and researchers in the area, demonstrating the utility of knowledge graphs for informational analysis, facilitating the understanding of relationships between news and stock prices, and providing a systemic view that can support risk monitoring activities, sector analysis, and exploratory studies on stock market behavior. Therefore, the general objective of this work is to investigate the applicability of the OpenSPG platform in the representation and analysis of relationships between corporate news and companies listed on the Brazilian stock market, through the construction and exploration of a semantic graph, evaluating its utility for understanding the informational impact on stock price behavior.
2. Material and Methods
The research was characterized as an applied case study, of a descriptive and exploratory nature, with a combined quantitative and qualitative methodological approach. The main focus of the study consisted of the practical application of semantic modeling and graph data analysis techniques, inserted in the context of the Brazilian stock market. Tools and concepts acquired throughout the specialization course were used, with the purpose of investigating the applicability of the OpenSPG platform in the representation and analysis of the relationships between corporate news and companies listed on B3.
The unit of analysis comprised corporate news and companies listed on the B3 (Brasil, Bolsa, Balcão). The study sample included five companies, represented by six distinct tickers, considering common and preferred shares. This set covered a total of 616 corporate news items and 1,494 daily price records. The composition of the database, detailing the tickers analyzed, the quantity of news, and the price records for each company, was organized for the study.
The analyzed data referred to the period between November 28, 2024, and November 28, 2025, totaling twelve months. This interval was selected because it encompasses different market conditions and a relevant volume of corporate news. Corporate news information was obtained from public digital sources of economic journalistic content, while stock price data was collected through public financial databases, containing daily trading records.
The data collection was structured in two automated fronts, developed in Python language. The extraction of journalistic articles was carried out through the RSS feed of Google News Brazil. To decode Google’s native shortened URLs and obtain the original addresses of the news portals, the `googlenewsdecoder` library was used. The extraction of the complete HTML content of each page was performed by combining the `curl_cffi` library with the `BeautifulSoup` parser.
Next, the raw text of the articles was sent to the OpenRouter AI API, which employed the Llama 3.3 language model to perform text cleaning and automatic identification of the tickers of the mentioned companies. Stock price data was extracted directly from B3 via the `yfinance` library, covering the analyzed trading period. To address the duplication of reports on the same event published in different portals, a deduplication algorithm was implemented in the preprocessing step.
The duplicate exclusion criterion was defined by the simultaneous equality between the news title, the publication link (URL), and the publication date. Identical news captured at overlapping times or feeds were automatically discarded from the raw database before ingestion into the graph. The sources used provided open and unrestricted access to the data, not involving confidential or proprietary information.
Initially, news and price data were collected and stored in a structured format. Subsequently, the data treatment and preparation step was carried out, which included the removal of duplicate records, standardization of dates, normalization of company names, and categorization of financial events. Adjustments were also made to ensure temporal alignment between news dates and stock price records, enabling comparative analyses over time.
The knowledge graph modeling was performed by defining a simple ontology, representing the main entities and relations relevant to the study. The modeled entities included Company, News, Financial Event, Stock, and Price Record. The semantic relations established links such as “company mentioned in news”, “company belongs to sector”, and “news associated with financial event”.
The OpenSPG (Open Semantic Platform for Graphs) platform was used for the construction, storage, and exploration of the semantic graph, following the guidelines of its official documentation and repository (OPENSPG, 2025). OpenSPG operates through two main layers: the Builder, responsible for ontology modeling and graph construction from raw data, and the Solver, which acts as a query and reasoning engine. The Builder transformed heterogeneous data into a coherent semantic structure, while the Solver allowed for efficient execution of complex queries, maintaining semantic context.
After the ontology definition, the prepared data were inserted into the OpenSPG platform. The platform allowed the creation of nodes and edges in a structured way, preserving the semantics of the defined relationships. The methodological flow, from collection and processing to the construction of the semantic graph, was structured in sequential steps to ensure data integrity and coherence.
The data analysis was conducted from exploratory queries to the knowledge graph, using native features of the OpenSPG platform. Frequency, centrality, and aggregation analyses were performed, with the objective of identifying the most mentioned companies, sectors with the highest concentration of news, and entities with a central role in the informational network.
Additionally, descriptive statistical metrics were calculated, such as the correlation between news volume, price percentage variations, and volatility. The temporal analysis considered different time windows to observe the occurrence of immediate and late effects after news publication, evaluating time windows subsequent to the publication date, such as days D+1, D+2, D+3, D+5, and D+7.
The research did not involve the direct or indirect participation of human beings, nor experimentation with animals or risks to the environment. All data used were in the public domain, non-sensitive, and treated in an aggregated manner, making it unnecessary to submit the project to the Research Ethics Committee, in accordance with current institutional guidelines.
3. Results and Discussion
The construction of the knowledge graph, a central stage of the research, resulted in a robust structure composed of 3,044 nodes and approximately 3,035 edges. The nodes were categorized as News, Action, Price Record, and Financial Event, while the edges represented the semantic relationships between these entities. This modeling allowed the integration of a heterogeneous dataset, which included 616 corporate news items, 6 analyzed stocks, 1,494 price records, and 925 financial events associated with the news. The OpenSPG platform proved effective in creating and storing this semantic structure, facilitating exploratory analyses and relational queries that would be complex in traditional tabular models.
The analysis of the frequency of mentions of companies in the news revealed an asymmetric distribution of informational exposure. The most frequently mentioned companies were PETR4, with 512 mentions, followed by ITUB4 (496), PETR3 (413), ABEV3 (406), MGLU3 (388), and VALE3 (368). In contrast, other companies, such as B3SA3 (6), ITUB3 (3), and BBAS3 (2), presented a significantly lower number of mentions. This informational concentration suggests that certain companies act as true “hubs” in the corporate news ecosystem, attracting greater attention from the media and, consequently, from investors.
The aggregation of news by economic sector corroborated the observation that some segments concentrate a larger volume of information. The Energy, Financial, Non-Cyclical Consumption, and Cyclical Consumption sectors were those that registered the highest number of corporate news, with 527, 487, 397, and 383 news items, respectively. This finding indicates that sectors with greater economic relevance or higher exposure to external factors tend to be more reported, which can influence the perception and behavior of market agents regarding the companies within them.
The first hypothesis (H1), which postulated a positive association between the volume of corporate news and the daily variation in stock prices, was refuted. The correlation coefficient calculated between these variables was -0.0042, indicating a null or insignificant correlation. This result suggests that the mere quantity of news, by itself, is not a direct predictor of stock price variation. The literature in data science frequently points out that the gross volume of information is a weak predictor, and that the quality and sentiment of the text are more relevant factors, as discussed by Tetlock (2007) and Arias et al. (2022).
Similarly, the second hypothesis (H2), which proposed that companies with a higher frequency of news would exhibit greater volatility in their stock prices, was also refuted. The observed correlation between news frequency and volatility (STDDEV) was -0.3920, characterizing a moderate negative correlation. This means that, in the analyzed period and for the studied sample, companies more frequently mentioned in the news tended to present lower volatility. However, this interpretation should be viewed with caution due to the exploratory scope of the study and the restricted number of companies and the 12-month period, which may limit generalization to the stock market as a whole.
The analysis of the types of financial events associated with the news revealed that some specific events generate more significant average percentage variations in stock prices. The “credit rating change” and “investment recommendation” events showed the largest variations, with 4.05% and 4.03%, respectively. The “interest rate decision” also demonstrated a relevant impact, with an average variation of 2.84%. Other events, such as regulatory changes, commodity price changes, mergers and acquisitions, and dividend announcements, although relevant, showed smaller percentage impacts.
The third hypothesis (H3), which predicted that the impact of news on stock prices would occur predominantly on the same day of its publication, was refuted. The temporal analysis indicated that the average peak of percentage variation in stock prices occurred on the third day after the news release, reaching approximately 2.2%. This finding suggests a delayed effect in the market’s absorption of information, indicating a temporary informational inefficiency. Such behavior challenges the immediacy of information assimilation, as pointed out by Jones (2022), and contradicts the premise of efficient markets by Fama (1970) in its strictest form.
The evaluation of the relationship between periods of high news concentration and general market instability did not reveal a significant association. The correlation calculated between news count and market volatility was -0.0151, characterizing an insignificant negative relationship. No specific periods were identified that simultaneously combined high news activity with a significant increase in market volatility. This reinforces the idea that news volume, in isolation, is not a determining factor for market instability, but rather the nature and content of this information.
In contrast, the fourth hypothesis (H4), which stated that companies belonging to the same economic sector would present similar patterns of reaction to sectoral news, was confirmed. The Energy and Non-Cyclical Consumer sectors, for example, showed high uniformity indices of reaction, with values of 0.9855 and 0.9759, respectively. This result validates the robustness of the semantic graph for identifying sectoral dependencies and demonstrates that informational contagion relations are more cohesive within specific economic niches, according to the relational structure of the knowledge graph, which allows navigating through the sector’s node hierarchy to correlated actions (Hogan et al., 2021).
The analysis of the knowledge graph structure also allowed the identification of companies that acted as informational hubs, characterized by a high number of connections with news and financial events. Petrobras, Itaú Unibanco, Ambev, Vale, and Magazine Luiza stood out for presenting the highest centrality values in the network. These companies, by concentrating a greater informational flow, occupy strategic positions in the graph’s structure, which makes them crucial points for the dissemination and impact of information in the stock market, influencing investors’ buying and selling behavior (Barber & Odean, 2008).
The results obtained demonstrate the applicability of the OpenSPG platform in representing and analyzing the relationships between corporate news and the Brazilian stock market. Although the mere frequency of news did not directly correlate with price variation or volatility, the semantic graph approach allowed the identification of patterns of delayed temporal impact and uniformity of sectoral reaction. The ability to integrate heterogeneous data and visualize relationships in a structured and intuitive way, without the need for advanced textual analysis techniques, validates OpenSPG as a promising tool for exploratory analyses in the financial context, offering a systemic view that can support risk monitoring and sectoral analysis.
4. Conclusion
This study investigated the applicability of the OpenSPG platform in representing and analyzing the relationships between corporate news and companies listed on the Brazilian stock market, through the construction and exploration of a semantic graph, evaluating its utility for understanding the informational impact on stock price behavior. It was found that the OpenSPG platform allowed the construction of a robust knowledge graph, integrating heterogeneous data from news, stocks, prices, and financial events, facilitating exploratory analyses. It was observed that certain companies and sectors acted as informational hubs, concentrating news flow, but the volume of news, in isolation, was not significantly associated with daily variation or stock price volatility. However, it was identified that the impact of news on prices tended to occur with a delay, peaking on the third day after publication, and that companies in the same sector exhibited similar patterns of reaction to sectoral news. The main contribution lies in demonstrating that semantic graphs offer a structured and intuitive representation, facilitating the understanding of complex informational relationships in the financial market, without the need for advanced text analysis techniques.
As limitations of the study include the restricted number of companies analyzed and the temporal period considered, in addition to the absence of advanced textual analysis techniques, such as sentiment analysis. These aspects, however, were aligned with the exploratory nature of the research and the proposal to evaluate the applicability of OpenSPG in a simplified and reproducible scenario. For future studies, it is suggested to expand the sample of companies, incorporate natural language processing methods, and compare the semantic model with traditional financial data analysis approaches. The knowledge graph approach, as demonstrated, constitutes a promising tool for financial analysts and researchers, supporting risk monitoring, sector analysis, and the identification of reaction patterns to news events, offering a valuable systemic view for financial intelligence and risk.
Bibliographic References
ARIAS et al., 2022 [Referência completa não encontrada no documento original]
BAKER, S. R. et al. Policy news and stock market volatility. NBER Working Paper Series, n. 25720, 2019 (revised May 2025). Disponível em: http://www.nber.org/papers/w25720. Acesso em: 03 ago. 2026.
BARBER, B. M.; ODEAN, T. All that glitters: the effect of attention and news on the buying behavior of individual and institutional investors. The Review of Financial Studies, v. 21, n. 2, p. 785-818, 2008. Disponível em: https://doi.org/10.1093/rfs/hhm079. Acesso em: 03 ago. 2026.
FAMA, Eugene F. Efficient capital markets: a review of theory and empirical work. The Journal of Finance, v. 25, n. 2, p. 383–417, 1970. Disponível em: https://doi.org/10.2307/2325486. Acesso em: 03 ago. 2026.
HOGAN, Aidan et al. Knowledge graphs. ACM Computing Surveys, v. 54, n. 4, p. 1–37, 2021. Disponível em: https://dl.acm.org/doi/10.1145/3447772. Acesso em: 03 ago. 2026.
JONES, 2022 [Referência completa não encontrada no documento original]
OPENSPG. Open Semantic Platform for Graphs – Repositório oficial. Disponível em: https://github.com/OpenSPG/openspg. Acesso em: 03 ago. 2026.
PRIYADARSHINI, Jeyaraman Brindha; DAI, Bing Tian; FANG, Yuan. A comprehensive review of financial knowledge graphs. World Scientific Annual Review of Artificial Intelligence, v. 3, p. 1–14, 2025. Disponível em: https://ink.library.smu.edu.sg/sis_research/10611. Acesso em: 03 ago. 2026.
SHILLER, 1981 [Referência completa não encontrada no documento original]
TETLOCK, Paul C. Giving content to investor sentiment: the role of media in the stock market. The Journal of Finance, v. 62, n. 3, p. 1139–1168, 2007. Disponível em: https://doi.org/10.1111/j.1540-6261.2007.01232.x. Acesso em: 03 ago. 2026.
ZHANG et al., 2020 [Full reference not found in the original document]
Article originating from the Final Course Project of the Specialization in Data Science and Analytics of the MBA USP/Esalq
To learn more about the course, click here and access the MBX Academy platform