Data Model

Acces to the Land Library Linked Open Data Model documentation

SPARQL Query examples

The Land Library provides a machine interface that can enable the creation of apps based on the library data.
This interface is a SPARQL endpoint: all data can be retrieved by querying the SPARQL endpoint http://landportal.info/sparql which supports SPARQL 1.1 (http://www.w3.org/TR/sparql11-query/).
 
The Land Library data are in the graph http://library.landportal.info
 
You can either write your own query or copy one of the sample queries and execute it.


 

Query results

 

 

 

Query examples

 
 

1. List all LandVoc Concepts (URI and label)

Get the list of all concepts of LandVoc, ordered alphabetically and case-insensitive.

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bibo: <http://purl.org/ontology/bibo/>
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT DISTINCT ?conceptURI ?label
FROM <http://landvoc.landportal.info>
WHERE {
  ?conceptURI a skos:Concept .
  ?conceptURI skos:prefLabel ?label .
  FILTER (lang(?label) = 'en')
} ORDER BY (fn:lower-case(str(?label)))

2. Get basic information (title, author, date) for each resource under the concept "land reform"

You can adjust this query for any of the other concepts of LandVoc by replacing the URI in the last line of the query with the URI of the concept.
http://aims.fao.org/aos/agrovoc/c_4178 is the URI of the concept "land reform".

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX bibo: <http://purl.org/ontology/bibo/>
SELECT DISTINCT ?title ?author ?date
FROM <http://library.landportal.info>
WHERE {
 ?doc a bibo:Document .
 ?doc dct:title ?title . 
 ?doc dc:contributor ?author .
 ?doc dct:issued ?date .
 ?doc dct:subject <http://aims.fao.org/aos/agrovoc/c_4178> .
}

3. List all countries (URI and name)

Get the list of all countries, ordered by ISO 3 code.

PREFIX dct: <http://purl.org/dc/terms/>
SELECT DISTINCT ?countryURI ?name ?iso3code
FROM <http://countries.landportal.info>
WHERE {
 ?countryURI a <http://purl.org/weso/landbook/ontology#Country> . 
 ?countryURI dct:title ?name .
 ?countryURI skos:notation ?iso3code .
} ORDER BY ?iso3code

4. Get basic information (title, author, year) for each resource related to "Kenya"

You can adjust this query for any of the other countries by replacing the URI in the last line of the query with the URI of the country (see query n.3 to get all the countries with corresponding URIs).
http://data.landportal.info/geo/KEN is the URI of the country "Kenya"

PREFIX dct: <http://purl.org/dc/terms/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX bibo: <http://purl.org/ontology/bibo/>
SELECT DISTINCT ?title ?author ?date
FROM <http://library.landportal.info>
WHERE {
  ?doc a bibo:Document .
  ?doc dct:title ?title .
  ?doc dc:contributor ?author .
  ?doc dct:issued ?date .
  ?doc dct:spatial <http://data.landportal.info/geo/KEN> .
}

Licenses

All of the content on the Land Library is published as open metadata. However, each resource has its own copyright and license restrictions, so please be sure to check the license of the actual resource before you re-use any of the information that is not included in the metadata.

Wordpress plugin for LandPortal Data reuse

A wordpress plugin for querying data from an SPARQL endpoint into Wordpress (developed by Open Development Mekong)

Some working examples: