Metadatos geográficos (2): Empleándolos en ficheros HTML, XHTML y RDF.
Por Gonzalo, Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogpost.php on line 100 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 lunes 1 agosto 2005 a las Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogpost.php on line 100 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 14:04 :: Aplicaciones prácticas :: #25 :: rss
En el post anterior, vimos como obtener metadatos geográficos. Ahora veremos cómo se pueden usar estos metadatos en tres situaciones distintas: mediante perfiles y esquemas (para ficheros HTML ó XHTML) y en ficheros RDF.
Utilizando metadatos definidos mediante un perfil en HTML ó XHTML.
Esta es la forma de generar metadatos por defecto en la aplicación Geo Tag Generator. Pero en vez de HTML, utilizaremos XHTML, para no repetir el código del post anterior:
[..]<head profile="http://geotags.com/geo">[..]<meta name="geo.position" content="40.4172;-3.6844" /> <meta name="geo.region" content="ES-M" /> <meta name="geo.placename" content="Lago del Parque del Retiro de Madrid." />[..]<head>[..]
La dirección indicada en el profile, es un documento donde aparecen definidas todos los elementos "geo", así como los tipos de valores que admiten.
La desventaja de este método, es que sólo permite un perfil (profile). Si por ejemplo, queremos usar metadatos de DublinCore y geo, deberemos optar por el siguiente método.
Utilizando metadatos mediante esquemas en HTML ó XHTML.
Este método, como ya hemos comentado antes, nos permite utilizar más de un "perfil", aunque aquí se utilizan en forma de esquemas (schema). Veamos nuestro ejemplo, pero añadiendo un esquema para incluir un metadato de DublinCore, y así demostrar esta ventaja frente al ejemplo anterior (de nuevo, usamos XHTML):
[..]<head>[..]<link rel="schema.geo" href="http://geotags.com/geo" /> <meta name="geo.position" content="40.4172;-3.6844" /> <meta name="geo.region" content="ES-M" /> <meta name="geo.placename" content="Lago del Parque del Retiro de Madrid." /> <link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" /> <meta name="DC.creator" content="http:/www.webposible.com/autor.html" />[..]<head>[..]
Mediante el vínculo relacional (link rel), utilizamos un esquema (schema), con la dirección donde están definidos los elementos http://geotags.com/geo, y que llamamos, de forma abreviada "geo". Así, cuando en un metadato, el nombre (name), comienze por "geo", sabemos que ese metadato está definido en el esquema correspondiente. Debajo usamos también un metadato de DublinCore, creator, es decir, el autor, tras haber vinculado previamente su esquema.
Metadatos en ficheros RDF.
Como ya sabemos, los ficheros RDF (que podemos traducir por Infraestructura para la Descripción de Recursos), es un tipo de fichero que utilizando la sintáxis de XML, sirve para describir recursos.
Para vincular un fichero RDF desde un documento HTML ó XHTML, en nuestro ejemplo http://www.ejemplo.org/lago_retiro.html, basta con usar una etiqueta similar a la siguiente:
[..]<head>[..]<link rel="meta" type="application/rdf+xml" href="http://www.example.org/lago_retiro.rdf" />[..]<head>[..]
Y un ejemplo del contenido del fichero RDF llamado lago_retiro.rdf, al que hacemos referencia, sería:
<?xml version="1.0" encoding="utf-8"?>
<rdf:RDF xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:geo="http://geotags.com/geo"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/">
<rdf:Description
rdf:about="http://www.ejemplo.org/lago_retiro.html">
<dc:title>
Fichero que describe la situación geográfica
del Lago del Parque de Retiro de Madrid.
</dc:title>
<dc:language>es</dc:language>
<dc:creator>
http://www.webposible.com/autor.html
</dc:creator>
<geo:region>ES-M</geo:region>
<geo:placename>
Lago del Parque del Retiro de Madrid.
</geo:placename>
<geo:position>40.4172;-3.6844</geo:position>
</rdf:Description>
</rdf:RDF>
En este fichero, además de incluir una etiqueta de DublinCore que ya habíamos utilizado, dc:creator, también empleamos un par de etiquetas adicionales para ampliar la información, una para el idioma (dc:language) y otra para el título (dc:title).




Comentarios
El Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogcomment.php on line 90 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 lunes 1 agosto 2005 a Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogcomment.php on line 90 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 07:58, por Emmanuelle :: email :: sitio :: #
El Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogcomment.php on line 90 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 lunes 1 agosto 2005 a Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogcomment.php on line 90 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 08:39, por Gonzalo :: email :: sitio :: #
El Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogcomment.php on line 90 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 lunes 1 agosto 2005 a Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/classes/class.blogcomment.php on line 90 Warning: strftime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'America/New_York' for 'EDT/-4.0/DST' instead in /home/virtual/site1/fst/var/www/html/wshoy/inc/libs/lib.date.php on line 33 13:51, por inkel :: email :: sitio :: #
Añadir un comentario