Introduction

In global change, concerns about biodiversity and ecosystem functions are increasing1. The most abundant metazoan in soil are nematodes, including free-living and parasitic nematodes. These organisms are typically categorized into four trophic groups based on feeding characteristics: bacterivorous, fungivorous, plant parasitic nematodes, and omnivorous predatory nematodes2. Each group is crucial in regulating soil food webs and ecosystem functions3,4. Bacterivorous nematodes primarily consume bacteria, while fungivorous nematodes target saprophytic, pathogenic, and mycorrhizal fungi. Plant parasitic nematodes, feeding mainly on plant roots or root exudates, are categorized into ectoparasitism, where nematodes attach externally and feed through head penetration, and endoparasitism. External parasitism involves nematodes attaching to the outside of plant roots and feeding through their heads. Internal parasitism occurs when nematodes penetrate plant roots, parasitize within the root tissues, and feed by locating suitable cells or tissues within the plant body. Omnivores eat a range of foods while predatory nematodes consume prey, positioning them at the top of the food chain in the nutritional structure of nematodes5 (Fig. 1).

Figure 1
figure 1

Schematic diagram of ecological functions of soil nematodes. Soil nematodes play multiple roles in the ecosystem, such as consumers, parasites, and predators, and therefore occupy a core position in the soil micro-food web. Soil nematodes play an important role in ecosystem functions by directly or indirectly participating in a variety of soil ecological processes. Its main ecological functions are: (1) The role of soil nematodes in the carbon cycle. Although the biomass of a single nematode is small, due to the large number, total biomass of soil nematodes is considerable, their respiration releases carbon and decomposes litter. (2) The role of soil nematodes in nutrient cycling. Bacterivorous, fungivorous, and predatory-omnivorous nematodes affect nutrient cycling by affecting the diversity, structure, and activity of microbial communities. (3) The role of soil nematodes in plant growth and health. Plant parasitic nematodes have both positive and negative effects on plant growth.

Nematodes play a pivotal role in the biogeochemical carbon (C) cycle, with their respiration contributing up to 15% of global emissions from soil fossil fuel use4. Moreover, their influence on soil bacterial and fungal community structures and activities significantly surpasses their contribution to carbon dioxide emissions6. Due to their high sensitivity to resource inputs and disturbances, nematodes are crucial indicators of soil food web responses and ecosystem functional shifts in response to global changes, such as increased carbon dioxide and nitrogen deposition7,8. Factors like soil moisture9, nutrient content10, and pH levels11 readily regulate the nematode community. Furthermore, agronomic practices, including tillage and fertilization, alter soil environmental conditions, impacting the nematode community.

Nitrogen (N) influences nematode communities1. However, the impacts of N on these communities display considerable variability across studies, rendering predictions challenging12. Generally, N enrichment tends to suppress the community composition of soil nematodes13. It usually diminishes soil nematode abundance and biodiversity, while the effects vary depending on the structural group14. In grassland ecosystems, plant-parasitic, fungivorous, and omnivorous predatory nematodes decrease with the N gradients rise, whereas bacterivorous numbers increase with the N gradients rise15. Soil acidification varies with increased N supply and may be a factor in the decrease in soil nematode populations14. Other studies have identified a negative correlation between the levels of nitrate N and ammonium N and the populations of fungivorous and plant-parasitic nematodes13,15, suggesting a direct impact of N fertilization on these communities. Moreover, the composition of the soil nematode community is not only affected by the soil’s physical and chemical properties, but the plant community composition also indirectly affects the community structure of soil nematodes16, which plays a certain role in explaining changes in the composition of the soil nematode community. Compared to N fertilization, In comparison to N fertilization, P fertilization led to higher numbers, diversity, and maturity of soil nematodes, whereas N fertilization notably enhanced the populations of bacterivorous and fungivorous nematodes17,18. Therefore, the application of nitrogen fertilizer becomes crucial when investigating the response of soil nematode community structure to nitrogen addition in alfalfa grassland on the Loess Plateau. The long-term (seven years) sampling aims to observe the enduring effects of nitrogen addition on the structural characteristics of soil nematode communities, thereby assessing the stability and sustainability of soil ecosystems. Nitrogen addition alters soil nutrient dynamics and influences nematode community structure19. Long-term studies indicate that these effects can persist for several years, impacting soil biodiversity and ecosystem functions20. Moreover, the extended sampling interval of seven years was chosen to capture the cumulative effects of nitrogen fertilizer on soil nematode communities. Such prolonged observations are crucial for evaluating the resilience of soil nematode communities in vulnerable ecosystems like the Loess Plateau21, offering valuable insights into land management strategies aimed at preserving soil health and productivity in semi-arid regions of the Loess Plateau.

As a N-fixing legume, alfalfa (Medicago sativa L.) enhances soil fertility and C sequestration capacity22,23. Evidence suggests that alfalfa improves soil's physical, chemical, and biological characteristics and bolsters resistance to ecosystem disturbances24. Several studies indicate that N-fixing plants positively influence soil nematode communities; for instance, legumes have been observed to increase bacterivorous nematode populations in northern Swedish grasslands25. Furthermore, N-rich legumes are decomposed faster by soil microorganisms, and this effect can regulate high nutrient levels through bottom-up effects, increasing the complexity of the soil food web26. Through multiple strategies, legumes can improve the quantity, quality, and type of food supply and habitat for soil organisms27. Specifically, the input of root exudates and litter from legumes enhances soil biota diversity and composition by increasing nutrient availability, such as carbon (C). Legume cultivation and management result in less nitrogen runoff and leaching compared to chemical nitrogen fertilizers, making them more environmentally friendly. As mentioned earlier, both nitrogen fertilizer addition and nitrogen fixation by legumes significantly impact soil biota. Given the critical role of soil organisms in nitrogen cycling, a comprehensive understanding of how soil biota respond to nitrogen fertilizers and nitrogen inputs from legumes is crucial for developing effective agricultural strategies. Therefore, this study aimed to investigate the effects of nitrogen fertilization on the soil nematode community in alfalfa cultivation. The hypothesis was that nitrogen fertilization affects soil nematode density, diversity, community structure, and metabolic activity during alfalfa cultivation on the Loess Plateau. To test this hypothesis, the study examined various metrics of nematode community characteristics (diversity index, ecological function index, metabolic activity) in response to nitrogen application, based on a long-term field experiment in a semi-arid rain-fed area of the Loess Plateau. This research provides a theoretical foundation for the sustainable management of alfalfa grasslands on the Loess Plateau.

Result

Soil nematode community analysis

This study identified 6346 soil nematodes across 12 samples, exhibiting an average density of 528.83 nematodes per 100 g of dry soil. The nematodes were further classified into 27 genera and 19 families (Fig. 2a). The distribution of dominant (> 10%), common (1–10%), and rare (< 1%) genera varied among treatments. The genus Helicotylenchus was universally dominant across all treatments, representing 19.00–40.00% of the population. Additionally, the CK soil's dominant genera were Filenchus (13.33%) and Aprutides (14.00%), whereas Acrobeloides (13.33%) prevailed in the N50. In the N100, Aprutides (13.67%) was predominant, and in the N150, Mesorhabditis (11.67%) was the dominant genus. The relative abundance of different trophic groups differed between treatments by analyzing the radar chart (Fig. 2b). Bacterivorous and omnivorous/predatory nematodes were more abundant in the N50, plant parasitic nematodes in the N150, and fungivorous nematodes in the CK. Furthermore, a Venn diagram analysis (Fig. 2c) of genera symbiosis between treatments showed 11 genera shared across CK, N50, N100, and N150, with 4 unique genera identified in the N50 treatment and none unique to the others.

Figure 2
figure 2

Analysis of soil nematode community composition and trophic groups at the genus level. (a) Utilization of a random forests model for analysis: A higher average Gini index reduction value signifies greater importance of the genus in the random forest model classification. The color bar on the right denotes abundance changes, ranging from blue (low abundance) to red (high abundance). Nematode genera are ranked based on the average Gini index reduction value, with larger values indicating greater importance. (b) Examination of the trophic group relative abundance: Treatments are color-coded: red for CK, green for N50, blue for N100, and purple for N150. Each point represents the relative proportion of a trophic group under a specific treatment. Points farther from the center indicate higher proportions of the trophic group under that treatment.BF: Bacterivorous nematodes, FF: Fungivorous nematodes, PP: Plant parasitic nematodes, OP: Omnivorous/predatory nematodes. (c) Venn diagram analysis: The Venn diagram shows the common and unique nematode genera under different treatments. Each color corresponds to a different treatment: blue for CK, red for N50, yellow for N100, and purple for N150. Numbers indicate the count of nematode genera that are either unique to or shared among treatments. CK No nitrogen fertilizer added, N50 Nitrogen addition amount 50 kg/ha2, N100 Nitrogen addition amount 100 kg/ha2, N150 Nitrogen addition amount 150 kg/ha2. *Dominant genera with a relative abundance exceeding 10%.

Substantial variations in soil nematode abundance and richness were evident among the experimental treatments (Fig. 3). Notably, CK and N50 treatments exhibited a significantly elevated total nematode abundance and heightened abundances within the cp1-2 and cp3-5 groups, in stark contrast to the N100 and N150 treatments (P < 0.05). Moreover, the N50 treatment demonstrated a noteworthy increase in nematode richness compared to the other treatments (P < 0.05). The application of Principal Component Analysis (PCA), as depicted in Fig. 4, brought to light discernible distinctions within soil nematode trophic groups, Colonizer-Persister (c-p) groups, and the overarching nematode community across varying N supply levels. Notably, the ANOSIM test underscored the statistically significant impact of N addition on plant parasitic nematodes, cp3-5 taxa, and the overall nematode communities.

Figure 3
figure 3

Soil nematode richness and abundance. Different letters indicate significant differences between treatments (P < 0.05).

Figure 4
figure 4

PCA analysis of soil nematode trophic groups, cp groups and total nematode community. The P and R values, derived from the ANOSIM test, indicate significance and difference, respectively, with P < 0.05 denoting significant differences and R > 0 suggesting differences. In the graphical representation, red, green, blue, and purple line segments connect replicate samples within the CK, N50, N100, and N150, respectively. BF bacterivorous nematodes, FF fungivorous nematodes, PP plant parasitic nematodes, OP omnivorous/predatory nematodes.

Soil nematode ecological function index

An analysis of the ecological function index of the soil nematode community (Fig. 5) revealed significant differences between treatments (P < 0.05). The N50 exhibited significantly higher values for the nematode diversity index (\(\mathbf{H}\)), nematode channel ratio (NCR), Wasilewska index (WI), and trophic diversity index (TD) compared to other treatments (P < 0.05). Additionally, the ratio of plant-parasitic nematodes to free-living nematodes maturity index (PPI/MI) and dominance index (λ) in the N50 were significantly lower than in other treatments (P < 0.05).

Figure 5
figure 5

Ecological function index of soil nematode community. Different letters indicate significant differences between treatments (P < 0.05).

Metabolic footprint and flora analysis of soil nematodes

Considerable disparities emerged in the metabolic footprint of each nematode trophic group in response to varying N application levels (Fig. 6). In the N50 treatment, the metabolic footprints of bacterivorous, plant parasitic, omnivorous/predatory, and the aggregate of total nematodes exhibited a notably higher magnitude than alternative treatments (P < 0.05). Besides the CK, fungivorous nematodes within the N100 treatment manifested a significantly elevated metabolic footprint compared to their counterparts in other treatments (P < 0.05). The floral analysis (Fig. 7) revealed distinct distribution patterns of soil nematodes. In the CK and N50 treatments, nematodes predominantly occupied quadrants B and C, while in the N100 and N150 treatments, a prevailing occupation of quadrant B was observed. The functional footprint of soil nematodes, represented by the diamond area, exhibited a higher magnitude in the N50 treatment than in others. Notably, the soil nematode enrichment index (ordinate of the diamond centre) demonstrated an increment with N application, while the structural index (abscissa of the diamond centre) exhibited a decrease.

Figure 6
figure 6

Soil nematode metabolic footprint. Different letters indicate significant differences between treatments (P < 0.05). BFMF bacterivorous metabolic footprint, FFMF fungivorous metabolic footprint, PPMF plant parasitic metabolic footprint, OPMF omnivorous/predatory metabolic footprint, TNMF total nematode metabolic footprint.

Figure 7
figure 7

Flora analysis of soil nematode communities. The functional metabolic footprint is depicted by the sequentially joining points: (SI − 0.5sfoot/k, EI); (SI + 0.5sfoot/k, EI); (SI, EI − 0.5efoot/k); (SI, EI + 0.5efoot/k). The adjusted k value is 16. The nematode functional metabolic footprint is the total area of the two functional (structure and enrichment) footprints.

Analysis of the energy flow channel (Fig. 8) of the soil nematode communities in alfalfa fields with different nitrogen addition levels revealed distinct variations. Specifically, the bacterial, predatory, and plant channels in the N50 treatment exhibited significantly higher energy flows than other treatments. Conversely, the plant, predatory, and fungal channels in the N150 treatment demonstrated significantly lower energy flows than other treatments. Moreover, the biomass of bacterivorous, plant parasitic and omnivorous/predatory nematodes in the N50 treatment was markedly greater than in other treatments. In contrast, the biomass of fungivorous nematodes in the N150 treatment surpassed that in other treatments.

Figure 8
figure 8

Energy structure within the soil nematode community in alfalfa fields with different nitrogen addition levels. Blue represents bacterivorous nematodes, green represents plant parasitic nematodes, red represents fungivorous nematodes, and orange represents omnivorous/predatory nematodes. Receiving energy from basal resources (R), the circles' numbers represent each trophic group's fresh biomass (ug/100 g dry soil). The numbers along the line between nodes represent the energy flow value (ug C 100 g−1 dry soil d−1).

Selectivity of soil nematode community species in different habitats

N fertilization displays discernible selectivity for distinct nematode trophic and Colonizer-Persister (c-p) groups (Table 1). In the N50 treatment, excluding fungivorous nematodes, the proportion of positively selective species surpassed that of negatively selective species. Remarkably, the N50 treatment exhibited the highest proportion of positively selective species. Conversely, for fungivorous nematodes in the N100 and N150 treatments, the proportion of negatively selective species exceeded that of positively selective species. Moreover, these treatments' proportion of positively selective species for all nematode types was zero. Furthermore, c-p group analysis highlighted that the N50 treatment had the highest proportion of positively selective species. Among the 27 identified species, 10 emerged as indicator species (Table 2). The CK treatment featured a solitary indicator species, Filenchus. In stark contrast, the N50 treatment showcased a notable abundance of nine indicator species, namely Aulolaimus, Acrobloides, Chiloplacus, Steinernema, Eucephalobus, Ditylenchus, Xiphinema, Laimydorus, and Aporcelaimellus. Notably, the N100 and N150 treatments lacked any indicator species.

Table 1 Proportion of nematode selective species (%).
Table 2 Soil nematode community indicator genera and species indicator values in different treatments.

Correlation between soil nematode community and soil physicochemical factors

The physicochemical properties of the soil are detailed in Table 3. N application has no significant effect on soil moisture (SM), total phosphorus (TP); however, it substantially increased the total N (TN) while significantly reducing soil pH (P < 0.05). Structural equation model analysis (Fig. 9) revealed a significant negative correlation between plant parasitic nematodes and TN (P < 0.05), and a significant positive correlation with TP (P < 0.05). Fungivorous nematodes positive correlation with pH (P < 0.05). While individual physicochemical factors did not significantly correlate with omnivorous/predatory nematodes, the data suggest that a combination of various soil physicochemical properties influences the community.

Table 3 Soil physicochemical properties under different nitrogen (N) addition level.
Figure 9
figure 9

Structural equation model (SEM) of the effects of different nitrogen addition levels on trophic groups of soil nematodes in alfalfa fields. The width of the arrows is proportional to the strength of the path coefficient. The continuous red and broken blue arrows represent positive and negative relationships. SEM shows environmental factors' direct and indirect effects on nematode communities.

Discussion

The results of this study show that long-term N application significantly impacts soil nematode abundance, diversity, richness, and community composition. This effect was attributed to alterations in soil physicochemical properties and the inherent species selectivity of different nematode communities, which show preferences or rejections, thereby leading to marked variations in community composition. Further analysis via ANOSIM testing confirmed that N application significantly impacts plant parasites, cp3-5 taxa, and the total nematode community, thus verifying the study's hypothesis. Only one indicator species was identified in the CK, whereas distinct species emerged following the N application. This suggests that long-term N application altered the specific soil environment, enabling nematodes to locate environments conducive to their survival and causing differences in the abundance of indicator species among various N addition levels. From the perspective of trophic group levels, N application resulted in a higher proportion of positively selected species across each nematode group than negatively selected species. Specifically, the N50 exhibited the most substantial proportion of positively selected bacterivorous, plant parasitic, and predatory/omnivorous nematodes, whereas the N100 and N150 had the smallest. This suggests that lower concentrations of N addition better support the survival of these nematodes, while higher concentrations are detrimental. The negative impact may stem from increased soil NH4+ concentration following N application, leading to an accumulation of ammonium, which exerts an inhibitory effect on the nematode population28. These toxic substances diminish soil nematode activity, slowing growth rates, reducing abundance, and weakening reproductive capabilities, potentially resulting in death29. Furthermore, N addition raises NO3− and NH4+ levels, enhancing soil nitrification and increasing H+ release, ultimately lowering soil pH.

Long-term N addition contributes to soil acidification, characterized by cation loss and a rise in exchangeable acid ions like Al3+ and H+, thereby diminishing the availability of cations to soil nematodes. Increasing H+ content in the soil correlates with a reduction in soil nematode populations30. Specifically, for fungivorous nematodes, the N100 and N150 exhibit the lowest proportion of positively selected species and the highest proportion of negatively selected species. This pattern may arise from high N concentrations reducing soil fungi, the primary food source for fungivorous nematodes, consequently diminishing the proportion of fungivorous nematodes31. Soil nematode trophic groups show varied responses to physicochemical soil factors, with pH being the predominant factor influencing fungivorous nematodes. This variability stems from distinct habitat preferences, feeding behaviour, and ecological niches. For plant parasitic nematodes, the critical factors include TN and TP. High-concentration N addition lowers soil pH, indirectly reducing plant parasitic nematodes. Soil acidification typically diminishes the availability of mineral cations to plants, reducing plant biomass. The diminished biomass may, in turn, lower the abundance of plant parasitic nematodes32,33. Furthermore, high-concentration N additions prevent alfalfa growth and leaf photosynthesis, inhibiting N fixation in root nodules. Thus, high-concentration N additions adversely affect the growth of alfalfa root systems and the viability of plant parasitic nematodes34.

Variations in the ecological functions and metabolic footprints of soil nematodes predominantly stem from alterations in community structure due to prolonged N application. The soil nematode diversity index (\(H\)) in the N50 was significantly higher than in other treatments. In contrast, the N150 exhibited the lowest diversity, which is consistent with findings by Wei et al.14. This variation was attributed to the altered relative abundance of soil nematodes from different trophic groups under N application. The study demonstrated that low-concentration N additions enhance soil nematode community diversity, while high concentrations restrict it. Although soil nematodes do not directly utilize soil C, N, and P for nutrients, low-concentration N additions (C/N) substantially increased soil nematode diversity. Consequently, changes in the soil environment and microbial community, as indicated by stoichiometric ratios, indirectly influence the variety of resources available to soil nematodes35, affecting overall soil nematode diversity. This phenomenon is likely attributable to the biogeochemical cycling of soil C, N, and P, which significantly influences the biological groups within the soil food web. It profoundly impacts plant communities growth, reproduction, and activities, and soil organisms depend on plants for nutrients. The soil nematode dominance index (λ) in the N50 treatment was markedly lower compared to other treatments. The λ index was negatively correlated with the stability of the soil nematode community, indicating that low-concentration N addition makes the soil nematode community more stable. The Maturity Index (MI) served as a metric to assess soil environment stability, where higher values indicated greater stability and diminished susceptibility to external disturbances36. This study revealed that the N50 exhibits the highest MI, while the N150 showed the lowest, suggesting that low-concentration N addition enhanced soil environmental stability, potentially due to the adaptation of local organisms to the disturbances caused by long-term low-concentration N application. Conversely, high-concentration N addition exerted a detrimental toxic effect on nematodes. As a result, low-concentration N fertilizer increases the MI of soil nematodes, reflecting increased complexity in the soil food web and a trend toward ecological stability. Similarly, the N application significantly raised the Plant Parasitic Nematode Maturity Index (PPI). This elevation might stem from increased soil nutrients from N addition, promoting robust growth of above-ground plants and, consequently, a healthier root system. This environment supports the survival and reproduction of plant parasitic nematodes, leading to a higher PPI37, which indicates enhanced fitness of plant parasitic nematodes due to N application. Compared to the MI and PPI, the PPI/MI more effectively reflects the recovery status of the soil ecological environment post external disturbances. A higher PPI/MI value indicates increased disturbance within the nematode community's habitat38,39. This study demonstrated that the PPI/MI in the N50 was significantly lower compared to other treatments, suggesting that the low-concentration N addition significantly reduces disturbance to the soil nematode community. These results further confirm the increased complexity of the soil food web and the enhanced stability of the ecological environment.

The enrichment index (EI) for the N150 surpasses other treatments, while the N50 exhibits the opposite trend, suggesting that high-concentration N addition contributes more nutrients to soil nematodes than low-concentration N addition. This could be attributed to long-term N addition altering soil osmotic pressure and pH levels40. The structure index (SI) for the N50 was higher than other treatments, while the N150 exhibited a lower SI, suggesting that the SI decreases with increasing N addition levels. This phenomenon was likely due to N application resulting in a decline in omnivorous predatory nematodes with large c-p values, consequently diminishing the complexity of the soil food web, shortening the food chain, and reducing soil environment stability38. The nematode channel ratio (NCR) indirectly assesses the predominant pathway for soil organic matter degradation. A higher NCR indicates bacterial dominance in the degradation pathway, whereas a lower value suggests a predominance of fungal degradation pathway39. The NCR in the N50 exceeded that of the N100 and N150, suggesting that at lower N concentrations, the soil food web's decomposition pathway is primarily bacterial. In contrast, at higher concentrations, it shifts to a fungal-dominated decomposition pathway. This shift could be attributed to the proliferation of fungivorous nematodes following N addition41. The metabolic footprint of soil nematodes reflects the utilization of C in metabolic activities42. In the N50, the metabolic footprints of bacterivorous, plant parasitic, omnivorous/predatory, and total nematodes were significantly higher than those in other treatments. In contrast, the metabolic footprints of fungivorous nematodes in the N150 were significantly lower. These differences are associated with the impact of N addition on the size and abundance of nematodes. Some studies have reported that N addition can increase nematode size43 and concurrently significantly alter nematode abundance44. The functional metabolic footprint, represented by the enrichment and structural footprints, assesses the food web's capacity to regulate and sustain its metabolic balance. A larger value signifies a more robust ability of the nematode population to regulate the habitat's food web and to maintain a balanced metabolic relationship between predators and prey45. In the N50 treatment, the functional metabolic footprint of soil nematodes outperformed that of other treatments, indicating a superior C utilization rate and an enhanced capacity to regulate the food web, ensuring metabolic balance.

Conclusions

In the semi-arid Loess Plateau, plant parasitic nematodes dominate the alfalfa soil. Elevated N application levels contribute to SOC, TN, and AP improvements while concurrently reducing pH. These alterations influence the soil nematode community structure, ecological function indices, and metabolic footprint. With escalating N fertilizer levels, there was a noteworthy increase in the plant parasitic nematode maturity index (PPI) and nematode enrichment index (EI). In contrast, lower N concentrations lead to a significant augmentation in soil nematode richness, diversity index (H), structure index (SI), nematode channel ratio (NCR), and free-living nematode maturity index (MI). The functional metabolic footprint analysis elucidates that the N50 treatment surpasses other treatments, indicating a more efficient C utilization rate within the N50 soil nematode community. Consequently, an annual N application of 50 kg/ha2 fosters the development of a complex and stable soil food web, positively influencing the sustainable utilization of artificial alfalfa grasslands.

Materials and methods

Site description

This study carefully chose an experimental site within the Gansu Agricultural University Comprehensive Experimental Station for Dry Farming on the Loess Plateau in the northwestern region of China. It belongs to Dingxi City in the Gansu Province within N (35° 28′ N) and E (104° 44′ E) with an average altitude of 1970 m. The total sunshine hours are 2476.6 h, and the mean annual solar radiation is 592.9 kJ cm−2. The accumulated temperature reaches 2933.5 ℃ at ≥ 0 ℃ and 2239.1 ℃ at ≥ 10 ℃. The locale experiences a frost-free period of 140 days, an average annual temperature of 6.4 ℃, and annual precipitation of 390 mm. Additionally, the average annual evaporation rate is 1531 mm. The experimental site is a semi-arid middle temperate zone, a typical rainfed farming area with 1 crop per year.

Experimental design and soil sampling

The experiment began on April 6, 2014, with alfalfa drill sown at a rate of 22.5 kg/ha2 across 10 rows per plot and a row spacing of 30 cm. Four N addition treatments were established: 0 (CK), 50 kg/ha2 (N50), 100 kg/ha2 (N100), and 150 kg/ha2 (N150). Three plots were set up for each treatment to form 3 repetitions. A total of 12 plots were randomly arranged, and the plot areas were all 12 m2 (3 m × 4 m). N fertilizer was applied once a year. The fertilizer tested was urea (N46%). The experiment proceeded under exclusively rainfed conditions without irrigation.

Soil samples were collected during the first blooming period of alfalfa in June 2021. Five alfalfa plants were randomly selected from each plot, and soil from a 0–20 cm depth around their roots was extracted using a soil auger and combined into a single composite sample. Remove debris such as gravel and plant debris from the soil sample. Divide each soil sample into two parts; one was refrigerated at 4 °C for nematode extraction and identification, and the other was air-dried to determine the soil's physical and chemical properties.

Analysis of soil physicochemical properties

In this study, selected soil properties were measured, including soil moisture (SM), pH, soil organic carbon (SOC), total N (TN), total phosphorus (TP) and available phosphorus (AP). Soil moisture content (SM) was measured by drying fresh soil samples at 105 °C to constant weight46. Soil pH was measured using a pH meter (Mettler Toledo, Switzerland) at a soil-to-water ratio of 1:2.5 extract. The dichromate oxidation method was employed to determine soil organic carbon47. Soil total N (TN) was determined using the Kjeldahl method48. The molybdenum blue method was used to determine soil total phosphorus (TP)49. The Olsen method determined soil-available phosphorus (AP)50.

Soil nematode community identification

The shallow dish method was employed to extract nematodes from soil samples. A 100.0 g fresh soil sample was placed on filter paper in a shallow plate, and tap water was slowly added along the plate's inner wall until a thin water film formed on the soil surface. The samples were then incubated at room temperature for 48 h and separated using a 500-mesh sieve with a 25-μm pore size. Post-extraction, nematodes were killed in a 60 °C water bath, fixed with 4% formalin solution, and stored in a prelabelled specimen bottle for subsequent identification51. Nematodes were enumerated using a stereo microscope and standardized to nematodes per 100 g of dry soil. Classification and identification of soil nematodes followed the methods outlined on the webpage established by Ferris at http://Nemaplex.ucdavis.edu. Genus-level identification was conducted under a microscope. Concurrently, the nematodes were classified into four trophic groups based on the morphological characteristics of their heads and feeding habits: bacterivorous, fungivorous, plant parasitic, and omnivorous/predatory. Additionally, based on life history strategies, nematodes were categorized into colonizers (opportunists, r-strategists) and persisters (competitors, K-strategists), each assigned varying c-p values ranging from 1 for extreme r-strategists to 5 for K-strategists, thereby dividing them into five categories5.

Calculation of nematode ecological function index and metabolic footprint

The nematode diversity was estimated by the Shannon–Wiener diversity index (\(\text{H}\)), Simpson dominance index (λ), trophic diversity index (TD), the free-living nematode maturity index (MI), plant-parasitic nematode maturity index (PPI), nematode channel ratio (NCR), and Wasilewska index (WI)52 as follows:

$$\text{H}=-\sum_{i=1}^{s}pi*lnpi$$
(1)
$$\uplambda =\sum {pi}^{2}$$
(2)
$$\text{TD}=1/\sum {p{i}{\prime}}^{2}$$
(3)
$$\text{MI}=\sum {v}_{i}{f}_{i}$$
(4)
$$\text{PPI}=\sum {v}_{i}{f}_{i}{\prime}$$
(5)
$$\text{NCR}=\frac{BF}{BF+FF}$$
(6)
$$\text{WI}=\frac{BF+FF}{pp}$$
(7)

where \(pi\) was the relative abundance of taxon \(i\) of the sample, \(S\) was the total number of nematode genera in the community,\(pi{\prime}\) represented the proportion of the nematode abundance of taxon \(i\) trophic group to the total nematode abundance, \({v}_{i}\) represented the cp value in the \(i\) taxon and \({f}_{i}\) denoted the proportion of free-living nematodes in the \(i\) taxon, \({f}_{i}{\prime}\) was the proportion of plant parasitic nematodes in the \(i\) taxon, \(BF, FF, \text{and }PP\) referred to bacterivorous, fungivorous, plant parasitic nematodes abundance, respectively.

The nematode metabolic footprint was calculated using the nematode biomass (fresh weight, W) listed in the "Nematode-Plant Expert Information System" (http://plpnemweb.ucdavis.edu/nemaplex).

$$F\hspace{0.17em}=\hspace{0.17em}\Sigma ({N}_{t}\times (0.1\hspace{0.17em}\times \hspace{0.17em}({W}_{t}\div {m}_{t})+0.273({W}_{t}^{0.75})$$
(8)

where \({N}_{t}\) referred to the abundance of \(t\)-type nematode group; \({m}_{t}\) referred to the c-p value of \(t\)-type nematode group; and \({W}_{t}\) referred to the biomass of \(t\)-type nematode group45.

The energy flux of nematodes (F, μg C 100 g−1 dry soil d−1) comprises both production and respiration components53. The duration of the soil nematode life cycle, expressed in days, can be estimated as twelve times the cp value2. By applying a coefficient of 0.058, one can calculate the daily carbon respiration (μg) as follows:

$$\text{F}=\sum [{N}_{t}(0.1\times \left(\frac{{w}_{t}}{{12m}_{t}}\right)+0.273\times 0.058\left({{w}_{t}}^{0.75}\right))]$$
(9)

where \({N}_{t}\) referred to the number of individuals of the t-th genus; \({m}_{t}\) referred to the c-p value of \(t\)-type nematode group; and \({w}_{t}\) referred to the biomass of \(t\)-type nematode group.

We posit that bacterivorous, fungivorous, and plant-parasitic nematodes derive their energy from specific resources, while omnivorous/predatory nematodes form a five-node food web based on the dietary habits of other trophic groups54. Initially, we determined the energy flux (\({F}_{o}\)) for omnivorous/predatory nematodes, noting that this assessment of energy metabolism excludes energy losses at higher trophic levels, thereby focusing on the energy needs of these nematodes. Subsequently, we quantified the energy flow (\({F}_{i}\)) among nodes representing different trophic groups. Calculated as follows:

$${F}_{i}=\frac{F+{D}_{io}+{F}_{o}}{{e}_{i}}$$
(10)

In the formula, F represents the energy flux calculated based on production and respiration, \({D}_{io}\) represents the predation preference of omnivorous/predatory nematodes on the i-th trophic group (allocated according to the abundance ratio), \({F}_{o}\) represents the energy flux of omnivorous/predatory nematodes, with the product of \({D}_{io}\) and \({F}_{o}\) representing the energy loss to higher trophic levels. \(e\) represents the assimilation efficiency between trophic levels, the assimilation efficiency of plant parasitic nematodes is 0.25, bacterivorous nematodes are 0.60, fungivorous nematodes are 0.38, and omnivorous/predatory nematodes are 0.555.

Nematode flora analysis assessed enrichment footprints (Fe) and structural footprints (Fs). Taking the coordinate point of (SI, EI) as the centre position, sequentially connecting (SI − 0.5Fs/k, EI), (SI + 0.5Fs/k, EI), (SI, EI − 0.5Fe/k), and (SI, EI + 0.5Fe/k), and the formed diamond area was the functional metabolic footprint of the nematode community42. The enrichment footprint (Fe) indicated the metabolic footprint of nematode populations that can respond swiftly to lower cp1-2 in resource accumulation. The structure footprint (Fs) reflected the metabolic footprint of nematode groups with higher cp3-545.

$${\text{EI}} = {\text{e}}/\left( {{\text{e}} + {\text{b}}} \right)*{1}00$$
(11)
$${\text{SI}} = {\text{S}}/\left( {{\text{S}} + {\text{b}}} \right)*{1}00$$
(12)

where, e was the enrichment component (BF1 and FF2), b was the basal food web component (BF2 and FF2), s was the structure component (BF3–BF5, FF3–FF5, OP3–OP5, and PP2–PP5), and BF, FF, OP, and PP refer to trophic groups, bacterivorous, fungivorous, plant-parasitic, and omnivorous predatory, respectively, with the associated numbers referring to particular cp values.

Nematode species selectivity

Nematode species selectivity was expressed as IndVal value, which is calculated according to the following formula56:

$$IndValij = Aij \times Bij$$
(13)

where \(Aij\) was the ratio of the average abundance (number of individuals) of the nematode group \(i\) in the plot group \(j\) to the sum of the average abundance of this nematode group in all plot groups, \(Bij\) was the plot where nematode group \(i\) exists in plot group \(j\). The ratio of the number to the number of all plots in the plot group. This study used the species indicator value analysis method to calculate the soil nematode indicator value based on nematode specificity and fidelity to the environment57. The Indicator Value (IndVal) was employed to identify selective species for various N fertilization treatments (typically species exclusive to treatments with or without N addition) and non-selective species (species present in both treatments). Species with an IndVal exceeding 0.6 were designated as N-selective, while those below this threshold were considered N-non-selective. Specifically, an IndVal above 0.6 in the N fertilization treatment indicated species positively influenced by fertilization, whereas the same value in the control (CK) treatment signified species negatively affected by fertilization.

Statistical analyses

Differences in nematode ecological function index, abundance, trophic groups, and physicochemical indicators were analyzed using SPSS 26.0 via one-way ANOVA and multiple comparisons (LSD method, P = 0.05). Principal component analysis (PCA) was conducted with the 'stats' package in R software to qualitatively assess similarities and variations in species composition between samples and identify potential principal components influencing these differences. To ascertain the statistical significance of group disparities, we performed ANOSIM analysis using the ‘vegan’ package in R, testing the significance of differences. Structural equation model analysis was executed using the 'piecewise SEM' package in R, analyzing correlations between nematode trophic groups and physicochemical factors. Histograms were created using Origin 2021 to analyze the metabolic footprint sizes of each trophic group, indicating nematode C utilization intensity. For graphical modifications, Adobe Illustrator CS6 (AI) software was utilized.