# Saved by TopBraid on Mon Mar 24 12:36:57 PDT 2008 # baseURI: http://sparqlmotion.org/examples/GeonamesService # imports: http://www.geonames.org/ontology # imports: http://www.topbraidcomposer.org/owl/2006/07/tbcgeo.owl # imports: http://topbraid.org/sparqlmotionlib @prefix : . @prefix concept: . @prefix sm: . @prefix foaf: . @prefix sml: . @prefix geonames: . @prefix concept1: . @prefix rdfs: . @prefix concept3: . @prefix concept2: . @prefix concept5: . @prefix concept4: . @prefix xsd: . @prefix owl: . @prefix rdf: . a owl:Ontology ; rdfs:comment "This example demonstrates how to define your own subclass to access a web service. Here, we create a subclass of sml:ImportRDFFromURL." ; owl:imports , , ; owl:versionInfo "Created with TopBraid Composer"^^xsd:string . :DisplayOnMap a sml:CreateMap ; rdfs:label "Display on map"^^xsd:string ; sml:selectQuery """SELECT ?place WHERE { ?place geo:lat ?lat }"""^^xsd:string . :GetLocationFromGeonames a owl:Class ; rdfs:comment "This subclass of sml:ImportRDFFromURL uses the string input variable ?placeName and inserts it into a URL template to call the geonames web service. The result will be the best matching geo resource with this name." ; rdfs:label "Get location from geonames"^^xsd:string ; rdfs:subClassOf sml:ImportRDFFromURL ; rdfs:subClassOf [ a owl:Restriction ; owl:hasValue "http://ws.geonames.org/search?type=rdf&maxRows=1&name_equals={?placeName}"^^xsd:string ; owl:onProperty sml:url ] ; rdfs:subClassOf [ a owl:Restriction ; owl:cardinality "1"^^xsd:int ; owl:onProperty :placeName ] . :GetPlaceCoordinates a :GetLocationFromGeonames ; rdfs:label "Get place coordinates from Geonames"^^xsd:string ; sm:next :DisplayOnMap . :GetPlaceName a sml:BindWithParameter ; rdfs:label "Get place name"^^xsd:string ; sm:next :GetPlaceCoordinates ; sm:outputVariable "placeName"^^xsd:string ; sm:range xsd:string . :placeName a owl:DatatypeProperty ; rdfs:label "placeName"^^xsd:string ; rdfs:range xsd:string .