Integrating with Reegle

From Open Energy Information


OpenEI is engaged in an ongoing linked open data collaboration with Reegle[1]. This page serves to document a few of the initial integration techniques.

Reegle logo.png Integration Examples

For the purposes of this demonstration, we'll be working with the country of Brazil.

The following SPARQL query was used to detect if a country within OpenEI had a corresponding country profiles:

{{#sparql:
  PREFIX reegle: <http://reegle.info/schema#>
  PREFIX country: <http://reegle.info/countries/>
  PREFIX geonames: <http://www.geonames.org/ontology#>
  SELECT ?countryName ?profile
  WHERE {
    SERVICE <http://sparql.reegle.info/> {
      country:{{#var:Iso3166Alpha2}} geonames:name ?countryName .
      country:{{#var:Iso3166Alpha2}} reegle:profile ?profile .
    }
  }
}}

Which returns the following results:

Using that profile name we can now fetch the profile details:

{{#sparql:
  PREFIX reegle: <http://reegle.info/schema#>
  PREFIX country: <http://reegle.info/countries/>
  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  SELECT DISTINCT ?label, ?value
  WHERE {
    SERVICE <http://sparql.reegle.info/> {
      country:{{#var:Iso3166Alpha2}} reegle:profile ?profile .
      ?profile a <http://reegle.info/schema#CountryProfile> .
      ?profile ?property ?value .
      ?property rdfs:label ?label
    }
  }
  |format=template
  |template=LabelValuePair
}}


Which use the LabelValuePair template to display the results as they appear here.

References
  1. Reegle Clean Energy Datasets