def uso_suelo(query, municipio) -> str: query = query.replace( "WHERE", " FROM " + Constants.grafo_uso_suelo() + " WHERE") query += ( Constants.municipio() + " <http://purl.org/linked-data/sdmx/2009/dimension#refArea> " + Constants.etiqueta() + " . ") query += (TemplatesAragon.create_bif_contains( municipio, Constants.etiqueta()) + " . ") answerpart = ( Constants.municipio() + " <http://opendata.aragon.es/def/iaest/dimension#corine-land-cover-2000-nivel-5-descripcion> " + Constants.aux1() + " . ") query += answerpart query += ("BIND(SUBSTR(STRDT(" + Constants.aux1() + ", xsd:string),80) as" + Constants.answer0() + ") . ") query += TemplatesAragon.selecting_max_year( Constants.grafo_uso_suelo(), answerpart) return query
def fincas_cultivo_lenoso_regadio_municipio(query, municipio) -> str: query += (Constants.comarca() + " " + Constants.aux0() + " ei2a:cultivo_lenoso . ") query += (Constants.comarca() + " <http://purl.org/dc/elements/1.1/title> " + Constants.answer0() + " . ") query += (Constants.comarca() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.location() + " . ") query += (Constants.location() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.aux1() + " . ") query += (Constants.aux1() + " ei2a:organizationName " + Constants.etiqueta() + " . ") query += (TemplatesAgriculture.create_bif_contains( municipio, Constants.etiqueta()) + " . ") query += (Constants.comarca() + " <http://opendata.aragon.es/def/ei2a#dryOrIrrigated> " + Constants.etiqueta2() + " . ") query += (TemplatesAgriculture.create_bif_contains( "Regadío", Constants.etiqueta2()) + " . ") return query
def tipo_superficie(query: str, tipo_superficie: str) -> str: query += ( Constants.municipio() + " <http://opendata.aragon.es/def/iaest/dimension#corine-land-cover-2000-nivel-1-descripcion> " + Constants.aux1() + " . ") query += TemplatesAragon.create_bif_contains(tipo_superficie, Constants.aux1()) return query
def sexo(query, sexo) -> str: sexo = sexo.lower() query = query.replace("SELECT DISTINCT ?answer0", "SELECT DISTINCT SUM(?answer0) as ?answer0") query += (Constants.municipio() + " <http://opendata.aragon.es/def/iaest/dimension#sexo> " + Constants.aux1() + " . ") if sexo == "mujeres" or sexo == "hombres": query += TemplatesAragon.create_bif_contains( sexo, Constants.aux1()) + " . " return query
def fax_municipio(query, municipio) -> str: # municipio = municipio.upper() # En el campo esta en mayusculas el municipio query += (Constants.municipio() + " " + Constants.aux0() + " ei2a:Ayuntamiento . ") query += (Constants.municipio() + " ei2a:organizationName " + Constants.etiqueta()) query += (TemplatesAragon.create_bif_contains( municipio, Constants.etiqueta()) + " . ") query += Constants.municipio() + " org:hasSite " + Constants.sede( ) + " . " query += Constants.sede() + " org:siteAddress " + Constants.aux1( ) + " . " query += Constants.aux1() + " vcard:Fax " + Constants.answer0() + " . " return query
def villas_municipio(query, municipio) -> str: query += (Constants.comarca() + " " + Constants.aux0() + " ei2a:villas_y_tierras . ") query += (Constants.comarca() + " ei2a:organizationName " + Constants.answer0() + " . ") query += (Constants.comarca() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.location() + " . ") query += (Constants.location() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.aux1() + " . ") query += (Constants.aux1() + " ei2a:organizationName " + Constants.etiqueta() + " . ") query += (TemplatesAgriculture.create_bif_contains( municipio, Constants.etiqueta()) + " . ") return query
def municipio_comarca_agraria(query, comarca_agraria) -> str: query += (Constants.comarca() + " " + Constants.aux0() + " ei2a:comarca_agraria . ") query += (Constants.comarca() + " ei2a:organizationName " + Constants.etiqueta() + " . ") query += (TemplatesAgriculture.create_bif_contains( comarca_agraria, Constants.etiqueta()) + " . ") query += (Constants.comarca() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.location() + " . ") query += (Constants.location() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.aux1() + " . ") query += (Constants.aux1() + " ei2a:organizationName " + Constants.answer0() + " . ") return query
def info_villa(query, villa) -> str: query = query.replace( Constants.answer0(), Constants.answer0() + " " + Constants.answer1() + " " + Constants.answer2() + " " + Constants.answer3(), ) query += (Constants.comarca() + " " + Constants.aux0() + " ei2a:villas_y_tierras . ") query += (Constants.comarca() + " ei2a:organizationName " + Constants.etiqueta() + " . ") query += (TemplatesAgriculture.create_bif_contains( villa, Constants.etiqueta()) + " . ") query += (Constants.comarca() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.location() + " . ") query += (Constants.location() + " <http://www.w3.org/2003/01/geo/wgs84_pos#location> " + Constants.aux1() + " . ") query += (Constants.aux1() + " ei2a:organizationName " + Constants.answer0() + " . ") query += (Constants.comarca() + " <http://opendata.aragon.es/def/ei2a#phone> " + Constants.answer1() + " . ") query += (Constants.comarca() + " <http://xmlns.com/foaf/0.1/mbox> " + Constants.answer2() + " . ") query += (Constants.comarca() + " <http://opendata.aragon.es/def/ei2a#CIF> " + Constants.answer3() + " . ") return query