- From: Karl Dubost <karld@opera.com>
- Date: Mon, 10 Dec 2012 16:49:41 +0900
- To: Paul Groth <pgroth@gmail.com>
- Cc: "semantic-web@w3.org Web" <semantic-web@w3.org>
Let's take this markup which describes
Two places
with the name "Tsujido" and "Meguro
and their associated longitude and latitude.
<ul vocab="http://schema.org/">
<li typeof="Place">
<span property="name">Tsujido</span>
<div property="geo"
typeof="GeoCoordinates">
<meta property="latitude" content="35.336833"/>
<meta property="longitude" content="139.447083"/>
</div>
</li>
<li typeof="Place">
<span property="name">Meguro</span>
<div property="geo"
typeof="GeoCoordinates">
<meta property="latitude" content="35.633983"/>
<meta property="longitude" content="139.71600"/>
</div>
</li>
</ul>
I would love to be able to do something such as
"for each place return the longitude"
var places = document.getItems('http://schema.org/Place');
for (var i = places.length - 1; i >= 0; i--) {
longitude = places[i].properties['longitude']
console.log(longitude);
};
And then in the console:
139.71600
139.447083
--
Karl Dubost - http://dev.opera.com/
Developer Relations, Opera Software
Received on Monday, 10 December 2012 08:00:57 UTC