geosparql:skosMatch Extensions functions to SPARQL

62 Copyright © 2015 Open Geospatial Consortium. prefix geosparql-ext: http:www.opengis.nettestbed11deffunctiongeosparql . prefix skos: http:www.w3.org200402skoscore . prefix ems: http:www.opengis.nettaxonomyems . hswg:MarineIncident a http:www.opengis.netontemergencyincidentIncidentTheme , http:www.w3.org200207owlThing , skos:Concept ; rdfs:label Marine incidenthttp:www.w3.org2001XMLSchemastring ; skos:closeMatch ems:ems.incident.marine ; skos:definition An event involving a boat or ship resulting in damage, bodily injury, death, or the disruption of transportation service.http:www.w3.org2001XMLSchemastring ; skos:exactMatch ems:ems.incident.marine ; skos:inScheme hswg:Incident ; skos:narrowMatch ems:ems.incident.marine.marineSecurity , ems:ems.incident.marine.portClosure , ems:ems.incident.marine.specialMarine ; skos:narrower ems:ems.incident.marine.marineSecurity , ems:ems.incident.marine.portClosure , ems:ems.incident.marine.specialMarine , hswg:MarineAccident , hswg:MarineHijacking ; skos:narrowerTransitive ems:ems.incident.marine.marineSecurity , ems:ems.incident.marine.portClosure , ems:ems.incident.marine.specialMarine , hswg:MarineAccident , hswg:MarineHijacking ; skos:note An event involving a boat or ship resulting in damage, bodily injury, death, or the disruption of transportation service.http:www.w3.org2001XMLSchemastring ; skos:prefLabel Marine incidenthttp:www.w3.org2001XMLSchemastring ; skos:semanticRelation hswg:MarineAccident , hswg:MarineHijacking ; skos:topConceptOf hswg:Incident . Example2: List all the matching of EMS concepts to HSWG taxonomy callled hswg:Incident PREFIX symbol: http:www.opengis.netontportrayalsymbol PREFIX style: http:www.opengis.netontportrayalstyle PREFIX geosparql-ext: http:www.opengis.nettestbed11deffunctiongeosparql PREFIX ems: http:www.opengis.nettaxonomyems PREFIX hswg: http:www.fgdc.govHSWGtaxonomyincidents PREFIX geosparql: http:www.opengis.netontgeosparql PREFIX skos : http:www.w3.org200402skoscore Copyright © 2015 Open Geospatial Consortium. 63 SELECT ?srcConcept ? match WHERE { ?srcConcept a skos :Concept. ?srcConcept skos :inScheme ems:EMSIncidentTaxonomy. BIND geosparql-ext: skosMatch ?srcConcept, hswg:Incident AS ? match } The following result is returned: { head: { vars: [ srcConcept , match ] } , results: { bindings: [ { srcConcept: { type: uri , value: http:www.opengis.nettaxonomyemsems.incident.civil.civilDemonstration } , match: { type: uri , value: http:www.fgdc.govHSWGtaxonomyincidentsCivilDemonstrations } } , { srcConcept: { type: uri , value: http:www.opengis.nettaxonomyemsems.incident.civil.civilDisplacedPopulation } , match: { type: uri , value: http:www.fgdc.govHSWGtaxonomyincidentsCivilDisplacedPopulation } } , { srcConcept: { type: uri , value: http:www.opengis.nettaxonomyemsems.incident.civil.civilEmergency } , match: { type: uri , value: http:www.fgdc.govHSWGtaxonomyincidentsCivilDisturbanceIncident } } , { srcConcept: { type: uri , value: http:www.opengis.nettaxonomyemsems.incident.civil.civilRioting } , match: { type: uri , value: http:www.fgdc.govHSWGtaxonomyincidentsCivilRioting } } , { srcConcept: { type: uri , value: http:www.opengis.nettaxonomyemsems.incident.crime.illigalImmigrant } , match: { type: uri , value: http:www.fgdc.govHSWGtaxonomyincidentsCriminalActivityIncident } 64 Copyright © 2015 Open Geospatial Consortium. } , ….. truncated ] } } This function comes handy to perform ontology alignment using mapping when some property uses different taxonomies. It makes it easier to write the transformation mapping using SPARQL.

11.6.2 geosparql:eval

SPARQL engines that supports SPARQL Extension Ontology must provide a built-in SPARQL function geosparql:eval that can be used to evaluate a expression or query at execution time. This makes it possible to define higher level functions that take other function calls and queries as arguments. For example, it is possible to place an expression as an argument into a template. The body of the template can then reference the expression as a pre-bound variable and evaluate it. geosparql:eval takes any odd number of arguments. The first argument must be a reference to a expression e.g., instance of a SPARQL function or a Select or a Ask. The other arguments must come in pairs, so that the first one is a property and the second is a value that shall be pre-bound in the evaluation of the expression. In the following example, an expression bound to a variable ?expression is executed, with the variable ?arg3 bound to the literal value. The result of the function will be assigned to ?result. BIND geosparql:eval?expression, sp:arg3, value AS ?result If the expression argument is a Select, then the result will be the first binding of the first result variable. If the expression argument is an Ask, then a typed boolean literal will be returned. 12 Implementations

12.1 Image Matters Semantic Mediation Service

The Semantic Mediation Service SMS is a new service introduced during this testbed. The service addresses the first task to perform the mediation of the information represented by the symbology. The SMS can be reused for different contexts when alignment from one ontology to another one is needed. For example, SMS can be used Copyright © 2015 Open Geospatial Consortium. 65 for search information expressed in one ontology to find information expressed in a different one. Future extensions may support SPARQL rewriting for a given alignment.

12.1.1 Architecture

We designed the SMS to be RESTful and to use Linked Data standards. The service is composed of two graph stores. The first one contains the definition of the alignments and mapping definitions. The second store contains the definition of the functions and mapping types. The mapping engine is used to perform the transformation from one Linked Data Model to another one. The mapping engine leverages the GeoSPARQL engine that is augmented with the plugins functions and rules. The service exposed a REST API to access the concepts from the knowledge stores using a Linked Data API. The service also provides a Mediation REST API that performs the mediation work for a specific alignment. Finally, the service provides a GeoSPARQL endpoint capable to query the Alignment database. Figure 12 Semantic Mediation Service Architecture

12.1.2 REST API Overview

Table 25 summarizes the REST API implemented for the SMS for this testbed. Table 25 Semantic Mediation Service REST API Summary Endpoint Method Description Format