3.6. Semantic Mashup
This document describes the method and setting information for deploying Semantic Mashup.
3.6.1. Overview
Semantic mashup serves as a core part for establishing connectivity among semantic data, organized in graphs. Using SPARQL, three types of links has been generated among three different types of graphs: Parking Spots, Air-Quality and Weather, altogether, resulting as a semantic mashup of graphs. Here we consider a graph as one data source. In order to connect the graphs we use object property assertions that link the Named Individual assertions inside the graph, which contain common properties or attributes and are also relevant that can provide more information if get connected via object property assertions.

In this year’s implementation, based on current city hub data, two main types of mashup have been designed and implemented:
Between semantic data two different Parking Spots.
Between semantic data of Local Air-Quality and Weather Information
Figure 10 shows the visualization of the mashup example among four different graphs (here graph is referred to graph in virtuoso TDB), connected to each other through three types of properties. The top two graphs show the triple data for Parking Spot. The link between two Parking Spot Individuals (ParkingSpot_1 and ParkingSpot_58) is created using the Object Property rdfs:seeAlso, when the two parking spots are of same type (in this case “forDisabled”) and are located closer to each other. Similarly, mashup between graphs of Weather and Air-Quality observation (as shown between bottom two graphs in figure 10) can be created if they share similar locations as well as observation time stamps.
3.6.2. Semantic Mashup Usage
The Semantic Mashup is implemented as a Java Project, which can be executed manually, to create the semantic mashup, once the data is populate in the TDB.
The common dependency tools required for usage are JRE/JDK, Apache Maven and Java IDE (example: Eclipse, IntelliJ, etc.). After importing the setup Three Java classes should be configured for using the project:
ServerConfiguration.java : for setting up the TDB access point and the user credentials.
QueryGenerator.java : for configuring and manipulating the SPARQL queries as per implementation scope and requirements.
App.java : for executing the Semantic Mashup process.
In ServerConfiguration.java class, three variables should be configured. “TDB_BASE_URL” should be used to setup the JDBC access URL for Virtuoso TDB. “TDB_USER” and “TDB_PASS” should be used to setup the user name and password respectively, of the Virtuoso user account.
QueryGenerator.java defines all the SPARQL queries for creating the Mashups. They are defined in a “query_string” variable, and can be configured appropriately based on the URIs and the Properties used.
App.java is the Main class for executing the Semantic Mashup. It has all the function calls specified for executing the particular Mashup SPARQL query. In this class the required SPARQL query can be executed by specifying the corresponding function call, and the rest can be commented out.
3.6.2.1. Using A Wrapper class in place of App.java
The Wrapper class can be defined to execute the Mashup queries. In this case the function calls defined in App.java, can be defined in a Wrapper class and then be executed as per requirement and configuration as well as user application’s preference. In this way, this program can work as a component of an application covering Mashup functionalities for a larger scope of application domain.
3.6.3. User Guide
Semantic Mashup is a Java Maven project which can be imported and executed in compatible java IDE such as Eclipse and IntelliJ. Following are the dependencies required for deployment.
3.6.3.1. Dependencies
- Minimum version of Java Required: 1.5.
- Maven Dependencies: These are listed under <dependencies> tab in “pom.xml”, in main project directory.
- apache-jena-libs (version: 3.9.0)
- External Jar Files: These files are not available in maven repository and may need to add in the build path manually. These can be found in project/lib/
- virt_jena3.jar
- virtjdbc4.jar
- Connection with Virtuoso Triple Store: Three parameters are required to connect to the virtuoso: host URL, user name and password. In addition, it is required that the triple store is already populated with ontologies (vocabularies) and the Instance data/graphs, so that this application can be executed to generate the mashup.
3.6.3.2. ServerConfiguration
- The file is located at project/src/main/java/com/cityhub/semantics/InterfaceConfiguration.java, where Virtuoso triple store parameters can be configured.
- The parameters are described as follows:
Property | Sample | Description |
---|---|---|
TDB_BASE_URL | jdbc:virtuoso://localhost:1111 | Parameter to set host URL. This default value is set for localhost. However it can be changed to the specific ip address |
TDB_USER | dba | Default user name for virtuoso TDB. However, different user can be provided if created in virtuoso with appropriate permissions. |
TDB_PASS | dba | Default user password for virtuoso TDB. However, different user information can be provided if created in virtuoso with appropriate permissions. |
3.6.3.3. Important File Directories
- Following are the important directories for Semantic Mashup.
- Project java code files : project/src/main/java/com/cityhub/semantics/
- External Jar files : project/lib
- Maven Dependencies : project/pom.xml
3.6.4. Deployment Steps
NOTE: the installation instructions are based on eclipse IDE in windows, so it may vary for different IDEs and platforms.
3.6.4.1. Download Project
Download the project from github and choose "semantic mashup"
3.6.4.2. Import Project in IDE
In Eclipse, Go to File>Import>Maven>Existing Maven Projects
Locate the downloaded project and import.
3.6.4.3. Add external Jar dependencies
- The external jars to be added are located in the project at project/lib. If they are not already added, then must be added manually.
- In Eclipse, right click on project folder, go to Build Path > Configure Build Path > Java Build Path. Then go under the Libraries tab, which shows the current jars added to the build path.
- On the right side click “Add External Jars”.
- Locate the lib directory and select the files inside.
- Click “Apply and Close”
3.6.4.4. Application Deployment
The application can be executed using the class App.java, located at src/main/java/com/cityhub/semantics/App.java.
- Right click on App.java, select "Run As", select either "Java Application".
- Upon execution, the application will perform the following mashups:
- Mashup Between Parking Lot and Parking Spot
- Mashup Between Parking Lot and Air-Quality Observation
- Mashup Between Parking Lot and Air-Quality Estimation
- Mashup Between Parking Lot and Weather Observation
- Mashup Between Parking Lot and Weather Estimation
- Mashup Between Parking Spots Having same type and Close to each other
- Mashup Between Weather and Air-Quality Graph Having similar time and location values
- After the information is displayed: "Mashup Formation Completed Succesfully!", the console will stop displaying further information and the application will be closed after execution.