# Construct place triples with tm: vocabulary.

PREFIX rdfs:      <http://www.w3.org/2000/01/rdf-schema#>
PREFIX owl:       <http://www.w3.org/2002/07/owl#>
PREFIX schema:    <https://schema.org/>
PREFIX wgs84:     <http://www.w3.org/2003/01/geo/wgs84_pos#>
PREFIX tm:        <https://daniel.degu.cl/ontologies/theatre-migrants/>
PREFIX locationp: <http://example.org/migrants/location#>

CONSTRUCT {
  ?s a schema:Place .
  ?s owl:sameAs ?owlSameAs .
  ?s schema:sameAs ?sameAs .
  ?s wgs84:lat ?lat .
  ?s wgs84:long ?long .
  ?s tm:geoNamesID ?geoNamesID .
  ?s tm:continent ?continent .
  ?s tm:country ?country .
  ?s tm:state ?state .
  ?s tm:city ?city .
}
WHERE {
  ?s a schema:Place .
  OPTIONAL { ?s owl:sameAs ?owlSameAs }
  OPTIONAL { ?s schema:sameAs ?sameAs }
  OPTIONAL { ?s wgs84:lat ?lat }
  OPTIONAL { ?s wgs84:long ?long }
  OPTIONAL { ?s locationp:GeoNamesID ?geoNamesID }
  OPTIONAL { ?s locationp:Continent ?continent }
  OPTIONAL { ?s locationp:Country ?country }
  OPTIONAL { ?s locationp:State ?state }
  OPTIONAL { ?s locationp:City ?city }
}
