Revision as of 01:41, 1 November 2007 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Using based near

From FoafExamples, showing how to use the foaf:based_near property.

The foaf:based_near relationship links a "spatial thing" (anything that can be somewhere) to a point in space, typically specified using the geo:lat / geo:long geo-positioning vocabulary (see GeoInfo in the W3C semweb wiki for details).

Here we show it relating a person to a point:

Taking sample data from http://www.jasoncook.com/foaf.rdf and replacing the geo markup there, since that namespace doesn't seem to exist:

<?xml version="1.0" encoding="UTF-8"?> 
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
        xmlns:foaf="http://xmlns.com/foaf/0.1/" 
        xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
        xmlns:dc="http://purl.org/dc/elements/1.1/"> 
  <foaf:Person rdf:ID="Jason">
    <foaf:name>Jason Cook</foaf:name>
    <foaf:title>Mr</foaf:title>
    <foaf:based_near>
      <geo:Point geo:lat="41.8833" geo:long="12.5"/>
    </foaf:based_near>
  </foaf:Person>
</rdf:RDF>

Note that this same markup could be applied to other spatial things, such as shops, artifacts etc.

We do not say much about what 'near' means in this context; it is a 'rough and ready' concept. For a more precise treatment, see the GeoOnion vocab design discussions.


CategoryTutorial