title: Finding Longitude and Latitude using SPARQL
body: <p>I have an OWL ontology with quite a few places: cities, nations, states, districts, and specific sites such as a business or church. I want to use SPARQL to query some external data source (I assume a SPARQL endpoint), find the matching place and copy the long and lat data to my ontology. My ontology deals with the Covid pandemic and is called CODO. So I've tried things like:</p>
  <pre><code>    PREFIX owl: &lt;http://www.w3.org/2002/07/owl#&gt;
      PREFIX rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; 
      PREFIX rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt;
      PREFIX codo: &lt;http://www.isibang.ac.in/ns/codo#&gt;
      PREFIX geo: &lt;http://www.w3.org/2003/01/geo/wgs84_pos#&gt; 
      PREFIX dbo: &lt;http://live.dbpedia.org/&gt; 
      INSERT  {?c codo:long ?long.
               ?c  codo:lat ?lat.} 
       WHERE {?c a codo:City. 
              ?c rdfs:label ?l. 
              ?dbpc a dbo:City. 
              ?dbpc rdfs:label ?l.    
              ?dbpc geo:long ?long.
              ?dbpc geo:lat ?lat.}
  </code></pre>
  <p>I got those specific namespaces from examples I found on the web. I have no preference as to where I get the data, Geonames, DBpedia, doesn't matter. I think part of the problem is I'm not exactly clear about when/how to use the SERVICE and/or FROM keywords.</p>