Commit e36a13c9 authored by Andrei Popescu's avatar Andrei Popescu
Browse files

correcting addition of classes

parent feea73db
Pipeline #54999 passed with stage
in 42 seconds
......@@ -20,14 +20,18 @@
vann:preferredNamespaceUri "https://w3id.org/sdm/terms/alerts#".
<https://w3id.org/sdm/terms/> dcterms:creator <https://pietercolpaert.be/#me>, <https://www.linkedin.com/in/andrei-popescu/>.
gbfs:times rdf:type rdf:Property;
rdfs:range gbfs:Times;
rdfs:label "Array of objects indicating when the alert is in effect."@en.
rdfs:range gbfs:Times.
gbfs:Times rdf:type rdfs:Class.
gbfs:times rdfs:label "Array of objects indicating when the alert is in effect."@en.
gbfs:properties rdf:type rdf:Property;
rdfs:range gbfs:Properties;
rdfs:label "Array of objects indicating when the alert is in effect."@en.
rdfs:range gbfs:Properties.
gbfs:Properties rdf:type rdfs:Class.
gbfs:properties rdfs:label "Array of objects indicating when the alert is in effect."@en.
gbfs:station_ids rdf:type rdf:Property;
rdfs:range gbfs:Station_ids;
rdfs:label "Array of identifiers of the stations for which this alert applies."@en.
rdfs:range gbfs:Station_ids.
gbfs:Station_ids rdf:type rdfs:Class.
gbfs:station_ids rdfs:label "Array of identifiers of the stations for which this alert applies."@en.
gbfs:region_ids rdf:type rdf:Property;
rdfs:range gbfs:Region_ids;
rdfs:label "Array of identifiers of the regions for which this alert applies."@en.
rdfs:range gbfs:Region_ids.
gbfs:Region_ids rdf:type rdfs:Class.
gbfs:region_ids rdfs:label "Array of identifiers of the regions for which this alert applies."@en.
......@@ -28,13 +28,16 @@ gbfs:price rdfs:range xsd:integer;
gbfs:is_taxable rdfs:range xsd:boolean;
rdfs:label "Will additional tax be added to the base price?"@en.
gbfs:per_km_pricing rdf:type rdf:Property;
rdfs:range gbfs:Per_km_pricing;
rdfs:label "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2)."@en.
rdfs:range gbfs:Per_km_pricing.
gbfs:Per_km_pricing rdf:type rdfs:Class.
gbfs:per_km_pricing rdfs:label "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2)."@en.
gbfs:required rdf:type rdf:Property;
rdfs:range gbfs:Required;
rdfs:label "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2)."@en.
rdfs:range gbfs:Required.
gbfs:Required rdf:type rdfs:Class.
gbfs:required rdfs:label "Array of segments when the price is a function of distance travelled, displayed in kilometers (added in v2.1-RC2)."@en.
gbfs:per_min_pricing rdf:type rdf:Property;
rdfs:range gbfs:Per_min_pricing;
rdfs:label "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2)."@en.
rdfs:range gbfs:Per_min_pricing.
gbfs:Per_min_pricing rdf:type rdfs:Class.
gbfs:per_min_pricing rdfs:label "Array of segments when the price is a function of time travelled, displayed in minutes (added in v2.1-RC2)."@en.
gbfs:surge_pricing rdfs:range xsd:boolean;
rdfs:label "Is there currently an increase in price in response to increased demand in this pricing plan? (added in v2.1-RC2)"@en.
......@@ -20,11 +20,13 @@
vann:preferredNamespaceUri "https://w3id.org/sdm/terms/rental_hours#".
<https://w3id.org/sdm/terms/> dcterms:creator <https://pietercolpaert.be/#me>, <https://www.linkedin.com/in/andrei-popescu/>.
gbfs:user_types rdf:type rdf:Property;
rdfs:range gbfs:User_types;
rdfs:label "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only."@en.
rdfs:range gbfs:User_types.
gbfs:User_types rdf:type rdfs:Class.
gbfs:user_types rdfs:label "Array of member and nonmember value(s) indicating that this set of rental hours applies to either members or non-members only."@en.
gbfs:days rdf:type rdf:Property;
rdfs:range gbfs:Days;
rdfs:label "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies."@en.
rdfs:range gbfs:Days.
gbfs:Days rdf:type rdfs:Class.
gbfs:days rdfs:label "An array of abbreviations (first 3 letters) of English names of the days of the week for which this object applies."@en.
gbfs:start_time rdfs:range xsd:string;
rdfs:label "Start time for the hours of operation of the system."@en.
gbfs:end_time rdfs:range xsd:string;
......
......@@ -22,38 +22,48 @@
gbfs:address rdfs:range xsd:string;
rdfs:label "Address where station is located."@en.
gbfs:rental_methods rdf:type rdf:Property;
rdfs:range gbfs:Rental_methods;
rdfs:label "Payment methods accepted at this station."@en.
rdfs:range gbfs:Rental_methods.
gbfs:Rental_methods rdf:type rdfs:Class.
gbfs:rental_methods rdfs:label "Payment methods accepted at this station."@en.
gbfs:enum rdf:type rdf:Property;
rdfs:range gbfs:Enum;
rdfs:label "Payment methods accepted at this station."@en.
rdfs:range gbfs:Enum.
gbfs:Enum rdf:type rdfs:Class.
gbfs:enum rdfs:label "Payment methods accepted at this station."@en.
gbfs:is_virtual_station rdfs:range xsd:boolean;
rdfs:label "Is this station a location with or without physical infrastructure? (added in v2.1-RC)"@en.
gbfs:station_area rdf:type rdf:Property;
rdfs:range gbfs:Station_area;
rdfs:label "A multipolygon that describes the area of a virtual station (added in v2.1-RC)."@en.
rdfs:range gbfs:Station_area.
gbfs:Station_area rdf:type rdfs:Class.
gbfs:station_area rdfs:label "A multipolygon that describes the area of a virtual station (added in v2.1-RC)."@en.
gbfs:coordinates rdf:type rdf:Property;
rdfs:range gbfs:Coordinates;
rdfs:label "A multipolygon that describes the area of a virtual station (added in v2.1-RC)."@en.
rdfs:range gbfs:Coordinates.
gbfs:Coordinates rdf:type rdfs:Class.
gbfs:coordinates rdfs:label "A multipolygon that describes the area of a virtual station (added in v2.1-RC)."@en.
gbfs:vehicle_capacity rdf:type rdf:Property;
rdfs:range gbfs:Vehicle_capacity;
rdfs:label "An object where each key is a vehicle_type_id and the value is a number presenting the total number of vehicles of this type that can park within the station_area (added in v2.1-RC)."@en.
rdfs:range gbfs:Vehicle_capacity.
gbfs:Vehicle_capacity rdf:type rdfs:Class.
gbfs:vehicle_capacity rdfs:label "An object where each key is a vehicle_type_id and the value is a number presenting the total number of vehicles of this type that can park within the station_area (added in v2.1-RC)."@en.
gbfs:is_valet_station rdfs:range xsd:boolean;
rdfs:label "Are valet services provided at this station? (added in v2.1-RC)"@en.
gbfs:is_charging_station rdfs:range xsd:boolean;
rdfs:label "Does the station support charging of electric vehicles? (added in v2.3-RC)"@en.
gbfs:rental_uris rdf:type rdf:Property;
rdfs:range gbfs:Rental_uris;
rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
rdfs:range gbfs:Rental_uris.
gbfs:Rental_uris rdf:type rdfs:Class.
gbfs:rental_uris rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
gbfs:android rdf:type rdf:Property;
rdfs:range gbfs:Android;
rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
rdfs:range gbfs:Android.
gbfs:Android rdf:type rdfs:Class.
gbfs:android rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
gbfs:ios rdf:type rdf:Property;
rdfs:range gbfs:Ios;
rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
rdfs:range gbfs:Ios.
gbfs:Ios rdf:type rdfs:Class.
gbfs:ios rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
gbfs:web rdf:type rdf:Property;
rdfs:range gbfs:Web;
rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
rdfs:range gbfs:Web.
gbfs:Web rdf:type rdfs:Class.
gbfs:web rdfs:label "Contains rental uris for Android, iOS, and web in the android, ios, and web fields (added in v1.1)."@en.
gbfs:vehicle_type_capacity rdf:type rdf:Property;
rdfs:range gbfs:Vehicle_type_capacity;
rdfs:label "An object where each key is a vehicle_type_id and the value is a number representing the total docking points installed at this station for each vehicle type (added in v2.1-RC)."@en.
rdfs:range gbfs:Vehicle_type_capacity.
gbfs:Vehicle_type_capacity rdf:type rdfs:Class.
gbfs:vehicle_type_capacity rdfs:label "An object where each key is a vehicle_type_id and the value is a number representing the total docking points installed at this station for each vehicle type (added in v2.1-RC)."@en.
......@@ -28,23 +28,30 @@ gbfs:max_range_meters rdfs:range xsd:integer;
gbfs:default_reserve_time rdfs:range xsd:integer;
rdfs:label "Maximum time in minutes that a vehicle can be reserved before a rental begins added in v2.3-RC."@en.
gbfs:return_type rdf:type rdf:Property;
rdfs:range gbfs:Return_type;
rdfs:label "The conditions for returning the vehicle at the end of the trip added in v2.3-RC."@en.
rdfs:range gbfs:Return_type.
gbfs:Return_type rdf:type rdfs:Class.
gbfs:return_type rdfs:label "The conditions for returning the vehicle at the end of the trip added in v2.3-RC."@en.
gbfs:vehicle_assets rdf:type rdf:Property;
rdfs:range gbfs:Vehicle_assets;
rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
rdfs:range gbfs:Vehicle_assets.
gbfs:Vehicle_assets rdf:type rdfs:Class.
gbfs:vehicle_assets rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
gbfs:icon_url rdf:type rdf:Property;
rdfs:range gbfs:Icon_url;
rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
rdfs:range gbfs:Icon_url.
gbfs:Icon_url rdf:type rdfs:Class.
gbfs:icon_url rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
gbfs:icon_url_dark rdf:type rdf:Property;
rdfs:range gbfs:Icon_url_dark;
rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
rdfs:range gbfs:Icon_url_dark.
gbfs:Icon_url_dark rdf:type rdfs:Class.
gbfs:icon_url_dark rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
gbfs:icon_last_modified rdf:type rdf:Property;
rdfs:range gbfs:Icon_last_modified;
rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
rdfs:range gbfs:Icon_last_modified.
gbfs:Icon_last_modified rdf:type rdfs:Class.
gbfs:icon_last_modified rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
gbfs:default_pricing_plan_id rdf:type rdf:Property;
rdfs:range gbfs:Default_pricing_plan_id;
rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
rdfs:range gbfs:Default_pricing_plan_id.
gbfs:Default_pricing_plan_id rdf:type rdfs:Class.
gbfs:default_pricing_plan_id rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
gbfs:pricing_plan_ids rdf:type rdf:Property;
rdfs:range gbfs:Pricing_plan_ids;
rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
rdfs:range gbfs:Pricing_plan_ids.
gbfs:Pricing_plan_ids rdf:type rdfs:Class.
gbfs:pricing_plan_ids rdfs:label "An object where each key defines one of the items listed below added in v2.3-RC."@en.
......@@ -239,11 +239,14 @@ var JsonProcessor = /** @class */ (function () {
}
// Recursive step
if (propType == 'object' || propType == 'array') {
var newClassName = void 0;
if (this.termMap.has(prop) == false) {
this.termMap.set(prop, this.prefix + ':' + prop);
this.writer.addQuad(rdfTools_1.RDFTools.node_node_node(this.prefix + ':' + prop, 'rdf:type', 'rdf:Property')); // Add the property and its label
var newClassName = rdfTools_1.RDFTools.capitalizeFirstLetter(prop); // Since it is an object/array, we give it a new class as a range
newClassName = rdfTools_1.RDFTools.capitalizeFirstLetter(prop); // Since it is an object/array, we give it a new class as a range
this.writer.addQuad(rdfTools_1.RDFTools.node_node_node(this.prefix + ':' + prop, 'rdfs:range', this.prefix + ':' + newClassName));
// the new class becomes the mainobject
this.writer.addQuad(rdfTools_1.RDFTools.node_node_node(this.prefix + ':' + newClassName, 'rdf:type', 'rdfs:Class'));
if (propDescription != undefined) {
this.writer.addQuad(rdfTools_1.RDFTools.node_node_literal(this.prefix + ':' + prop, 'rdfs:label', propDescription.toString()));
}
......@@ -272,7 +275,7 @@ var JsonProcessor = /** @class */ (function () {
}
depth += 1;
//mainJsonObject = JsonProcessor.getJsonObject(this.prefix+':'+ RDFTools.capitalizeFirstLetter(prop));
mainJsonObject = JsonProcessor.getJsonObject(this.prefix + ':' + rdfTools_1.RDFTools.capitalizeFirstLetter(prop));
mainJsonObject = JsonProcessor.getJsonObject(this.prefix + ':' + newClassName);
// An object can have sub properties
if (subProperties != undefined) {
for (var prop_1 in subProperties) {
......
......@@ -276,11 +276,17 @@ export class JsonProcessor {
// Recursive step
if(propType == 'object' || propType =='array'){
let newClassName;
if (this.termMap.has(prop) == false) {
this.termMap.set(prop, this.prefix+':'+prop);
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+prop, 'rdf:type', 'rdf:Property')); // Add the property and its label
const newClassName = RDFTools.capitalizeFirstLetter(prop); // Since it is an object/array, we give it a new class as a range
newClassName = RDFTools.capitalizeFirstLetter(prop); // Since it is an object/array, we give it a new class as a range
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+prop, 'rdfs:range', this.prefix+':'+newClassName));
// the new class becomes the mainobject
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+newClassName, 'rdf:type', 'rdfs:Class'));
if(propDescription != undefined ){
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+prop, 'rdfs:label', propDescription.toString()));
}
......@@ -310,7 +316,7 @@ export class JsonProcessor {
//mainJsonObject = JsonProcessor.getJsonObject(this.prefix+':'+ RDFTools.capitalizeFirstLetter(prop));
mainJsonObject = JsonProcessor.getJsonObject(this.prefix+':'+ RDFTools.capitalizeFirstLetter(prop));
mainJsonObject = JsonProcessor.getJsonObject(this.prefix+':'+ newClassName);
// An object can have sub properties
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment