## 3 Materials and Methods  
### Framework and System Architecture  
In the previous sections, the importance of UAV trajectory reconstruction using geotagged photos taken during missions (flights) was discussed. To the best of our knowledge, a free and open-source framework that implements the reconstruction, semantic modeling, and enrichment of UAV trajectories does not exist. To fill this gap, we have extended the functionality of MovingPandas, a free, open-source, and widely used trajectory analytics and visualization tool, developing a new framework called ReconTraj4 Drones. Our framework extends MovingPandas with additional modules regarding trajectory reconstruction using geo-tagged photos, trajectory enrichment with weather and POI data, trajectory segmentation based on specific criteria (altitude variations, time intervals, distance), trajectory interactive visualization using OpenStreetMap, trajectory semantic annotation using our Onto4 drone ontology ([[https://github.com/KotiSK/onto4](https://github.com/KotiSK/onto4) drone]([https://github.com/KotiSK/onto4](https://github.com/KotiSK/onto4) drone), accessed on 30 December 2022), and finally, trajectory semantic analytics using SPARQL queries. The workflow of the proposed processes (Figure 2), from geo-tagged images to semantic trajectories, does not follow a predefined sequence of modules' execution. Starting from the reconstruction of the raw trajectory from geo-tagged images and their enrichment with external data, the enriched trajectory can be segmented based on specific criteria, visualized, or semantically annotated using the Onto4 drone ontology. The latter can also be executed after the Interactive Visualization and Segmentation modules. Moreover, after the Enrichment process, the stops of the UAV can be detected in the trajectory using the corresponding functionality of MovingPandas. Finally, after the Semantic Annotation module, the drone's semantic trajectory is created (in RDF), and the Semantic Analytics can be executed using SPARQL queries. Figure 2 depicts the overall workflow. The extracted metadata from geo-tagged photos are used as input in the trajectory construction module of MovingPandas to create the raw trajectory. The provided functionality of the original framework, such as visualization, stop detection, trajectory smoothing, trajectory splitting, and trajectory generalization, can be applied in the reconstructed trajectory. Then, the reconstructed raw trajectory can be enriched with external data (weather data, POIs) using the Trajectory Enrichment module. The Trajectory Segmentation module segments the enriched trajectory based on a flight's altitude variations, time intervals, or the distance between two consecutive recording points (geo-tagged images). The Trajectory Stop Detection module extends the corresponding functionality of MovingPandas, not only to detect stops in a trajectory, but also to detect the number of recording points (geo-tagged photos) included in each stop. The Interactive Trajectory Visualization module is used to interactively visualize not only the drone's trajectory in a simple line, but also to depict additional information that the trajectory contains. Such information includes starting and ending points, segments, stops, weather, and POI data. The Semantic Annotation module is used for the annotation of the enriched trajectories using the Onto4 drone ontology to ensure a high-level abstraction of the represented data, creating the drone's semantic trajectory,  
Figure 2: Workflow of the trajectory reconstruction, semantic annotation, and analytics. which can eventually be exported in RDF. The Semantic Trajectory Analytics module is used for the analytics of the reconstructed semantic trajectories using SPARQL queries. Figure 3 depicts the high-level architectural design of the modules of ReconTraj4 Drones, integrated in MovingPandas. Geo-tagged photos, external data (weather data, POIs), and the Onto4 drone ontology constitute the input data of the framework.