# Semantic Traffic Sensor Data:
## 4 Data Annotation and Publishing
### Technological Choices  
In this section, the reasons for our choice of technological solutions (Karma, Virtuoso, and LodView) are justified. As explained in Section 4.2, Karma [62; 63] has been used to represent the traffic data provided by the sensors in Linked Data. Karma is a useful ETL tool that supports the publication of data in RDF format. Besides Karma, other alternatives could have been chosen to achieve this goal [75]. Thus, a variety of tools and languages can be used to convert from different data formats to RDF-like data formats, such as OpenRefine [76], RML [77], ShExML [78], YARRML [79], and SPARQL-Generate [79]. Any of these could have been used instead of Karma, without much impact on the work presented in this paper. The main reasons why Karma was chosen for this project are the following:  
* Karma allows to import data from a variety of sources other than a PostgreSQL database, and therefore our approach can be exploited even if the input data are available in other types of sources. * Karma allows to export the data model in R2 RML format, which can be applied to transform a huge amount of data in RDF. Besides, the model can be easily shared with other researchers interested in our mapping to make the same transformation; the model is independent of the data sources. In [75], Karma is compared to other tools and it is the only one that supports exporting models in R2 RML. * Karma enables importing multiple ontologies in the same project. This feature is crucial in our case since a unique ontology which includes all the classes and properties needed was not available. * Karma offers a batch mode procedure that can be exploited for automating the conversion process given the R2 RML model and a set of similar data sources. Furthermore, it is able to interact with  
Figure 11: SPARQL query showing information related to sensor “R001_SM3”. a Virtuoso instance and directly load the RDF data into the Virtuoso instance instead of using RDF files. Similarly, Virtuoso [66; 67] is being used as a SPARQL endpoint (see Section 4.3). Alternatives that could be considered include AllegroGraph [80] or RDF4] [81], as well as graph databases such as Neo4] [82], Titan [83], GraphDB [84], or Stardog [85], to cite some examples. A benchmarking framework to evaluate and compare different data management solutions for RDF and property graph data models, called LITMUS, has been proposed in [86]. Virtuoso is very popular in academia, which motivated our use in the project. Besides, according to the preliminary experimental evaluation presented in [86], where several solutions are compared (4 Store, Jena, Neo4], OrientDB, RDF3X, Sparksee, Tinker, and Virtuoso), Virtuoso achieves the best results overall (the best performance in terms of the loading time as well as regarding the cold cache execution time, and the second best one concerning the warm cache execution time). Some relevant benefits of Virtuoso include the following:  
Figure 12: GeoSPARQL query showing the vehicle count of some sensors located in the town square of Modena on 8 January 2019. * Virtuoso is a popular tool that exposes a SPARQL endpoint for performing SPARQL queries, thus covering our fundamental need. * Karma provides functionalities for operating with instances of Virtuoso. So, these two tools complement each other and can be easily used in conjunction. * Virtuoso provides an open source version that is constantly being updated and improved. * It features a backend authentication system which supports setting different privileges for different users. In this way, it is possible, for example, to block potential DELETE statements that can be sent from the Internet. In the end, as visualization tool for RDF, in this work LodView [65] has been used (see Section 4.3). Other possible alternatives include Rhizomer [87; 88], LODMilla [89; 90], and LODGVis [91; 92], to cite some examples. LodView was chosen because it provides a dereferenciation system that allows the users to easily explore the relation between different instances.