Skip to content

Instantly share code, notes, and snippets.

@GUI
Created September 26, 2012 05:20
Show Gist options
  • Save GUI/3786256 to your computer and use it in GitHub Desktop.
Save GUI/3786256 to your computer and use it in GitHub Desktop.
API Metadata Schema Examples
{
"apis": [
{
"title": "Alternative Fuel Stations - List All",
"description": "Get all alternative fuel stations that match your query",
"keywords": ["alternative fuel", "transportation"],
"agency": "Department of Energy",
"dataDictionary": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1",
"accessURL": {
"absoluteURI": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1.{format}",
"methodName": "GET"
}
},
{
"title": "Alternative Fuel Stations - Show",
"description": "Get the alternative fuel station with the given ID",
"keywords": ["alternative fuel", "transportation"],
"agency": "Department of Energy",
"dataDictionary": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id",
"accessURL": {
"absoluteURI": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/{id}.{format}",
"methodName": "GET"
}
},
{
"title": "Alternative Fuel Stations - Create",
"description": "Create a new alternative fuel station",
"keywords": ["alternative fuel", "transportation"],
"agency": "Department of Energy",
"dataDictionary": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1",
"accessURL": {
"absoluteURI": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1.{format}",
"methodName": "POST"
}
},
{
"title": "Alternative Fuel Stations - Update",
"description": "Update an alternative fuel station",
"keywords": ["alternative fuel", "transportation"],
"agency": "Department of Energy",
"dataDictionary": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id",
"accessURL": {
"absoluteURI": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/{id}.{format}",
"methodName": "PUT"
}
}
]
}
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix http: <http://www.w3.org/2011/http#> .
:datasetGetAllStations
a dcat:Dataset;
dcterms:title "Alternative Fuel Stations - List All";
dcterms:description "Get all alternative fuel stations that match your query";
dcat:keyword "alternative fuel", "transportation";
datagov:agency "Department of Energy";
dcat:dataDictionary <http://developer.nrel.gov/doc/api/alt-fuel-stations/v1>;
dcat:accessURL [
a http:Request;
http:absoluteURI "http://developer.nrel.gov/api/alt-fuel-stations/v1.{format}";
http:methodName "GET";
]
.
:datasetGetStationById
a dcat:Dataset;
dcterms:title "Alternative Fuel Stations - Show";
dcterms:description "Get the alternative fuel station with the given ID";
dcat:keyword "alternative fuel", "transportation";
datagov:agency "Department of Energy";
dcat:dataDictionary <http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id>;
dcat:accessURL [
a http:Request;
http:absoluteURI "http://developer.nrel.gov/api/alt-fuel-stations/v1/{id}.{format}";
http:methodName "GET";
]
.
:datasetCreateStation
a dcat:Dataset;
dcterms:title "Alternative Fuel Stations - Create";
dcterms:description "Create a new alternative fuel station";
dcat:keyword "alternative fuel", "transportation";
datagov:agency "Department of Energy";
dcat:dataDictionary <http://developer.nrel.gov/doc/api/alt-fuel-stations/v1>;
dcat:accessURL [
a http:Request;
http:absoluteURI "http://developer.nrel.gov/api/alt-fuel-stations/v1.{format}";
http:methodName "POST";
]
.
:datasetUpdateStation
a dcat:Dataset;
dcterms:title "Alternative Fuel Stations - Update";
dcterms:description "Update an alternative fuel station";
dcat:keyword "alternative fuel", "transportation";
datagov:agency "Department of Energy";
dcat:dataDictionary <http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id/update>;
dcat:accessURL [
a http:Request;
http:absoluteURI "http://developer.nrel.gov/api/alt-fuel-stations/v1/{id}.{format}";
http:methodName "PUT";
]
.
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:http="http://www.w3.org/2011/http#">
<dcat:Dataset>
<dcterms:title>Alternative Fuel Stations - List All</dcterms:title>
<dcterms:description>Get all alternative fuel stations that match your query</dcterms:description>
<dcat:keyword>alternative fuel</dcat:keyword>
<dcat:keyword>transportation</dcat:keyword>
<datagov:agency>Department of Energy</datagov:agency>
<dcat:dataDicationary rdf:resource="http://developer.nrel.gov/doc/api/alt-fuel-stations/v1" />
<dcat:accessURL>
<http:Request>
<http:absoluteURI>http://developer.nrel.gov/api/alt-fuel-stations/v1.{format}</http:absoluteURI>
<http:methodName>GET</http:methodName>
</http:Request>
</dcat:accessURL>
</dcat:Dataset>
<dcat:Dataset>
<dcterms:title>Alternative Fuel Stations - Show</dcterms:title>
<dcterms:description>Get the alternative fuel station with the given ID</dcterms:description>
<dcat:keyword>alternative fuel</dcat:keyword>
<dcat:keyword>transportation</dcat:keyword>
<datagov:agency>Department of Energy</datagov:agency>
<dcat:dataDicationary rdf:resource="http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id" />
<dcat:accessURL>
<http:Request>
<http:absoluteURI>http://developer.nrel.gov/api/alt-fuel-stations/v1/{id}.{format}</http:absoluteURI>
<http:methodName>GET</http:methodName>
</http:Request>
</dcat:accessURL>
</dcat:Dataset>
<dcat:Dataset>
<dcterms:title>Alternative Fuel Stations - Create</dcterms:title>
<dcterms:description>Create a new alternative fuel station</dcterms:description>
<dcat:keyword>alternative fuel</dcat:keyword>
<dcat:keyword>transportation</dcat:keyword>
<datagov:agency>Department of Energy</datagov:agency>
<dcat:dataDicationary rdf:resource="http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/create" />
<dcat:accessURL>
<http:Request>
<http:absoluteURI>http://developer.nrel.gov/api/alt-fuel-stations/v1.{format}</http:absoluteURI>
<http:methodName>POST</http:methodName>
</http:Request>
</dcat:accessURL>
</dcat:Dataset>
<dcat:Dataset>
<dcterms:title>Alternative Fuel Stations - Update</dcterms:title>
<dcterms:description>Update an alternative fuel station</dcterms:description>
<dcat:keyword>alternative fuel</dcat:keyword>
<dcat:keyword>transportation</dcat:keyword>
<datagov:agency>Department of Energy</datagov:agency>
<dcat:dataDicationary rdf:resource="http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id/update" />
<dcat:accessURL>
<http:Request>
<http:absoluteURI>http://developer.nrel.gov/api/alt-fuel-stations/v1/{id}.{format}</http:absoluteURI>
<http:methodName>PUT</http:methodName>
</http:Request>
</dcat:accessURL>
</dcat:Dataset>
</rdf:RDF>
{
"apiVersion": "0.2",
"swaggerVersion": "1.1",
"basePath": "http://developer.nrel.gov/api",
"agency": "Department of Energy", # API.DATA.GOV CUSTOM ADDITION
"apis": [
{
"path": "/alt-fuel-stations/v1.{format}",
"description": "Operations on alternative fuel stations",
"tags": ["alternative fuel", "transportation"], # API.DATA.GOV CUSTOM ADDITION
"operations": [
{
"httpMethod": "GET",
"nickname": "getAllStations",
"summary": "Get all alternative fuel stations that match your query",
"documentationUri": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1" # API.DATA.GOV CUSTOM ADDITION
},
{
"httpMethod": "POST",
"nickname": "createStation",
"summary": "Create a new alternative fuel station"
"documentationUri": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/create" # API.DATA.GOV CUSTOM ADDITION
}
]
},
{
"path": "/alt-fuel-stations/v1/{id}.{format}",
"description": "Operations on a specific alternative fuel station",
"tags": ["alternative fuel", "transportation"], # API.DATA.GOV CUSTOM ADDITION
"operations": [
{
"httpMethod": "GET",
"nickname": "getStationById",
"summary": "Get the alternative fuel station with the given ID",
"documentationUri": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id" # API.DATA.GOV CUSTOM ADDITION
},
{
"httpMethod": "PUT",
"nickname": "updateStation",
"summary": "Update an alternative fuel station",
"documentationUri": "http://developer.nrel.gov/doc/api/alt-fuel-stations/v1/:id/update" # API.DATA.GOV CUSTOM ADDITION
}
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment