# Saved by TopBraid on Fri Apr 17 13:05:49 PDT 2009 # baseURI: http://tests.sparqlmotion.topbraid.org/xmlprocessing/GeoNamesPostalCodes # imports: http://purl.org/dc/elements/1.1/ # imports: http://topbraid.org/sparqlmotionfunctions # imports: http://topbraid.org/sparqlmotionlib # imports: http://www.w3.org/2003/01/geo/wgs84_pos @prefix sp: . @prefix xsd: . @prefix sml: . @prefix smf: . @prefix sm: . @prefix rdfs: . @prefix my: . @prefix owl: . @prefix spin: . @prefix geo: . @prefix rdf: . @prefix : . my:Suburb a owl:Class ; rdfs:label "Suburb"^^xsd:string ; rdfs:subClassOf owl:Thing . a owl:Ontology ; owl:imports , , , ; owl:versionInfo "Created with TopBraid Composer"^^xsd:string . :BindLat a sml:BindByXPath ; rdfs:label "Bind lat"^^xsd:string ; sm:next :ConstructSuburb ; sm:nodeX 364 ; sm:nodeY 386 ; sm:outputVariable "lat"^^xsd:string ; sml:datatype xsd:string ; sml:xpath "lat/text()"^^xsd:string . :BindLong a sml:BindByXPath ; rdfs:label "Bind long"^^xsd:string ; sm:next :ConstructSuburb ; sm:nodeX 520 ; sm:nodeY 393 ; sm:outputVariable "long"^^xsd:string ; sml:datatype xsd:string ; sml:xpath "lng/text()"^^xsd:string . :BindName a sml:BindByXPath ; rdfs:label "Bind name"^^xsd:string ; sm:next :ConstructSuburb ; sm:nodeX 210 ; sm:nodeY 379 ; sm:outputVariable "name"^^xsd:string ; sml:xpath "name/text()"^^xsd:string . :CallWebService a sml:ImportXMLFromURL ; rdfs:label "Call web service"^^xsd:string ; sm:next :IterateOverXPath ; sm:nodeX 45 ; sm:nodeY 13 ; sm:outputVariable "xml" ; sml:url "http://ws.geonames.org/postalCodeSearch?postalcode=4879&country=AU&maxRows=500"^^xsd:string . :ConstructSuburb a sml:ApplyConstruct ; rdfs:label "Construct suburb"^^xsd:string ; sm:nodeX 309 ; sm:nodeY 540 ; sml:constructQuery [ a sp:Construct ; sp:templates ([ sp:object my:Suburb ; sp:predicate rdf:type ; sp:subject _:b1 ] [ sp:object [ sp:varName "name"^^xsd:string ] ; sp:predicate rdfs:label ; sp:subject _:b1 ] [ sp:object [ sp:varName "lat"^^xsd:string ] ; sp:predicate geo:lat ; sp:subject _:b1 ] [ sp:object [ sp:varName "long"^^xsd:string ] ; sp:predicate geo:long ; sp:subject _:b1 ]) ; sp:where ([ a sp:Let ; sp:expression [ a smf:buildURI ; sp:arg1 "" ] ; sp:variable _:b1 ]) ] . :IterateOverXPath a sml:IterateOverXPath ; rdfs:label "Iterate over XPath"^^xsd:string ; sm:body :Merge ; sm:nodeX 32 ; sm:nodeY 151 ; sm:outputVariable "xml"^^xsd:string ; sml:xpath "/geonames/code"^^xsd:string . :Merge a sml:Merge ; rdfs:label "Merge"^^xsd:string ; sm:next :BindName , :BindLong , :BindLat ; sm:nodeX 371 ; sm:nodeY 256 . _:b1 sp:varName "uri"^^xsd:string .