Examples

The GCIS provides a RESTful interface and a SPARQL interface for getting data. Each has various capabilities for viewing individual resources and querying for lists of resources. The RESTful interface is more practical for building applications and examining individual resources. The SPARQL interfaces is more advanced, and better suited for complex queries, possibly related to other external semantic information

RESTful interface

The GCIS provides JSON and YAML representations of resources, which can be accessed using command line tools such as curl.

See the structure of the third national climate assessment.

$ curl https://data.globalchange.gov/report/nca3.yaml

Get a list of chapters in the third national climate assessment.

$ curl https://data.globalchange.gov/report/nca3/chapter.json

Requests can be made either using the suffix or using content negotiation.

Get the first 20 figures in the third national climate assessment.

$ curl -H 'Accept: application/json' https://data.globalchange.gov/report/nca3/figure

For the complete list of endpoints, as well as the valid Accept headers, please refer to the api reference.

SPARQL interface

The GCIS API exposes a SPARQL endpoint at https://data.globalchange.gov/sparql. Try your own queries in the SPARQL Query Editor or run some of the ones below.

The GCIS ontology formally defines the concepts used in the gcis namespace.

List URLs for 10 figures.

select * FROM <https://data.globalchange.gov>
where { ?s a gcis:Figure }
limit 10

Find all articles cited by both the Third National Climate Assessment and the Human Health Assessment.

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX cito: <http://purl.org/spar/cito/>
PREFIX dbpprop: <http://dbpedia.org/property/>

select ?s FROM <https://data.globalchange.gov> where {
   ?s a gcis:AcademicArticle .
   ?s cito:isCitedBy ?nca3 .
   ?nca3 dcterms:identifier "nca3" .
   ?s cito:isCitedBy ?health_assessment .
   ?health_assessment dcterms:identifier "usgcrp-climate-human-health-assessment-2016"
}

Identify the year of the earliest publication cited in the Third National Climate Assessment.

PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX cito: <http://purl.org/spar/cito/>
PREFIX dbpprop: <http://dbpedia.org/property/>

select min(?pubYear as ?Publication_Year) FROM <https://data.globalchange.gov> where { 
   ?s cito:isCitedBy ?nca3 .
   ?nca3 dcterms:identifier "nca3" .
   ?s dbpprop:pubYear ?pubYear
}

List 10 figures and datasets from which they were derived.

select ?figure ?dataset FROM <https://data.globalchange.gov>
where {
 ?figure gcis:hasImage ?img .
 ?img prov:wasDerivedFrom ?dataset
}
limit 10

Other semantic resources

Yasgui is a modern SPARQL query editor.

LOD live is a tool for visually exploring semantic relationships.

Applications

The website for the Third National Climate Assessment, http://nca2014.globalchange.gov, uses JQuery to call the GCIS API for the figure and image metadata.

The USGCRP webpage http://www.globalchange.gov uses GCIS data on the server side.