Skip to content

Instantly share code, notes, and snippets.

View jmcanterafonseca's full-sized avatar
🎯
Focusing

Jose M. Cantera jmcanterafonseca

🎯
Focusing
View GitHub Profile
{
"id": "daoiz-velarde-1-5-main",
"type": "ParkingGroup",
"category": ["onstreet", "blueZone", "shortTerm"],
"allowedVehicleType": "car",
"chargeType": ["temporaryFee"],
"refParkingSite": "daoiz-velarde-1-5",
"totalSpotNumber": 4,
"availableSpotNumber": 1,
"requiredPermit": "blueZonePermit"
{
"id": "santander:daoiz_velarde_1_5",
"type": "OnStreetParking",
"category": ["blueZone", "shortTerm"],
"specialZone": ["forDisabled"],
"allowedVehicleType": "car",
"chargeType": ["temporaryFee"],
"requiredPermit": ["blueZonePermit", "disabledPermit"],
"permitActiveHours": {
@jmcanterafonseca
jmcanterafonseca / urbo-distritotelefonica-parking.json
Last active September 21, 2016 15:42
FIWARE Device Simulator configuration file for Urbo's parking management at Distrito Telefónica
{
"domain": {
"service": "service",
"subservice": "/subservice"
},
"contextBroker": {
"protocol": "http",
"host": "1.2.3.4",
"port": 1026,
"ngsiVersion": "1.0"
@jmcanterafonseca
jmcanterafonseca / urbo-distritotelefonica-waste-management.json
Last active September 21, 2016 15:25
FIWARE Device Simulator configuration file for Urbo's waste management at Distrito Telefónica
{
"domain": {
"service": "service",
"subservice": "/subservice"
},
"contextBroker": {
"protocol": "http",
"host": "1.2.3.4",
"port": 1026,
"ngsiVersion": "1.0"
@jmcanterafonseca
jmcanterafonseca / schema-definition-gsma.html
Last active August 29, 2015 14:22
Schema definition example - GSMA IDE Project
<div typeof="rdfs:Class" resource="http://data.gsma.org/Incident">
<span class="h" property="rdfs:label">Incident</span>
<span property="rdfs:comment">A generic incident</span>
</div>
<div typeof="rdfs:Class" resource="http://data.gsma.org/TrafficIncident">
<span class="h" property="rdfs:label">Traffic Incident</span>
<span>Subclass of: <a property="rdfs:subClassOf" href="http://data.gsma.org/Incident">Incident</a></span>
<span property="rdfs:comment">Traffic Incident</span>
</div>
@jmcanterafonseca
jmcanterafonseca / UoMs.json
Last active August 29, 2015 14:22
FIWARE-NGSI-GSMA
{
"id": "LON-1234",
"name": "Ostler's Hug",
"type": "Room",
"temperature": {
"value": 25.2,
"metadata": {
"unitCode": "CEL"
}
}
@jmcanterafonseca
jmcanterafonseca / queryContext.js
Last active August 29, 2015 14:21
FIWARE - Query Context Data from Web Browser
// Don't forget to start Orion with the -corsOrigin option
// See also
var ORION_URL = 'http://130.206.83.68:1026/v1';
var QUERY_CONTEXT = ORION_URL + '/' + 'contextEntities'
function queryContext(entityId) {
return new Promise(function(resolve, reject) {
var xhr = new XMLHttpRequest();
xhr.open('GET', QUERY_CONTEXT + '/' + entityId, true);
Promise.sequential = function(runnables) {
return new Promise(function(resolve, reject) {
var results = [];
runnables.reduce(function(sequence, aRunnable) {
return sequence.then(function() {
return aRunnable.run();
}).then(function(data) {
results.push(data);
if (results.length === runnables.length) {