Commit 4242c172 authored by Andrei Popescu's avatar Andrei Popescu
Browse files

check existence in termMap

- added check of previous existence for primitive type properties, against a map defined in config
parent 9772d5ce
Pipeline #57125 passed with stage
in 26 seconds
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:alerts rdfs:range gbfs:Alerts.
......@@ -44,8 +42,6 @@ gbfs:summary rdf:type xsd:string;
rdfs:label "A short summary of this …played to the customer."@en.
gbfs:description rdf:type xsd:string;
rdfs:label "Detailed description of the alert."@en.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Indicates the last time the info for the alert was updated."@en.
gbfs:alerts rdfs:range gbfs:Alerts.
gbfs:Alerts rdfs:hasProperty (<alert_id> <type> <times> <station_ids> <region_ids> <url> <summary> <description> <last_updated>).
gbfs:data rdfs:range gbfs:Data.
......
......@@ -15,18 +15,12 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:bikes rdfs:range gbfs:Bikes.
gbfs:Bikes rdf:type rdfs:Class.
gbfs:bike_id rdf:type xsd:string;
rdfs:label "Rotating (as of v2.0) identifier of a vehicle."@en.
gbfs:lat rdf:type xsd:integer;
rdfs:label "The latitude of the vehicle."@en.
gbfs:lon rdf:type xsd:integer;
rdfs:label "The longitude of the vehicle."@en.
gbfs:bikes rdfs:range gbfs:Bikes.
gbfs:Bikes rdfs:hasProperty (<bike_id> <lat> <lon> <is_reserved> <is_disabled>).
gbfs:data rdfs:range gbfs:Data.
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......@@ -29,10 +27,6 @@ gbfs:name rdf:type xsd:string;
rdfs:label "Public name of the station."@en.
gbfs:short_name rdf:type xsd:string;
rdfs:label "Short name or other type of identifier."@en.
gbfs:lat rdf:type xsd:integer;
rdfs:label "The latitude of the station."@en.
gbfs:lon rdf:type xsd:integer;
rdfs:label "The longitude fo the station."@en.
gbfs:address rdf:type xsd:string;
rdfs:label "Address where station is located."@en.
gbfs:cross_street rdf:type xsd:string;
......@@ -53,8 +47,6 @@ gbfs:coordinates rdfs:range gbfs:Coordinates.
gbfs:Coordinates rdf:type rdfs:Class.
gbfs:station_area rdfs:range gbfs:Station_area.
gbfs:Station_area rdfs:hasProperty (<type> <coordinates>).
gbfs:capacity rdf:type xsd:integer;
rdfs:label "Number of total docking points installed at this station, both available and unavailable."@en.
gbfs:is_valet_station rdf:type xsd:boolean;
rdfs:label "Are valet services provided at this station? (added in v2.1-RC)"@en.
gbfs:is_charging_station rdf:type xsd:boolean;
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......
......@@ -15,8 +15,6 @@
@prefix vso: <http://purl.org/vso/ns#>.
@prefix dbpedia-owl: <http://dbpedia.org/ontology/>.
gbfs:last_updated rdf:type xsd:integer;
rdfs:label "Last time the data in the feed was updated in POSIX time."@en.
gbfs:ttl rdf:type xsd:integer;
rdfs:label "Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed)."@en.
gbfs:version rdf:type xsd:string;
......
......@@ -34,26 +34,21 @@ var RDFTools = /** @class */ (function () {
var oneOfValues = [];
for (var _i = 0, oneOf_1 = oneOf; _i < oneOf_1.length; _i++) {
var value = oneOf_1[_i];
console.log(RDFTools.inMap(value));
if (RDFTools.inMap(value) != false) {
console.log(RDFTools.inMap(value));
oneOfValues.push(namedNode(RDFTools.inMap(value)));
}
else {
console.log("false");
oneOfValues.push(namedNode(value.toString()));
}
//oneOfValues.push(namedNode(value.toString()));
}
var oneOfQuad = RDFTools.node_node_list(prefix + ':' + name, 'owl:oneOf', writer.list(oneOfValues));
return oneOfQuad;
};
// Write with the writer that is passed; fileName and fs have been set previously
RDFTools.writeTurtle = function (writer) {
// Write the content of the writer in the .ttl
var _this = this;
// Write the content of the writer in the .ttl
var filePath = ("build/" + this.fileName + ".ttl").replace(/:/g, '');
console.log(filePath);
writer.end(function (error, result) { return _this.fs.writeFile(filePath, result, function (err) {
// throws an error, you could also catch it here
if (err)
......
......@@ -28,18 +28,24 @@ var Traverse = /** @class */ (function () {
return parentKey;
}
if (schema.type === 'number') { // Base Case
this.writer.addQuad(RDFTools.node_node_node(this.prefix + ':' + parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix + ':' + parentKey, 'rdfs:label', schema.description));
if (!RDFTools.inMap(parentKey)) {
this.writer.addQuad(RDFTools.node_node_node(this.prefix + ':' + parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix + ':' + parentKey, 'rdfs:label', schema.description));
}
return parentKey;
}
if (schema.type === 'integer') { // Base Case
this.writer.addQuad(RDFTools.node_node_node(this.prefix + ':' + parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix + ':' + parentKey, 'rdfs:label', schema.description));
if (!RDFTools.inMap(parentKey)) {
this.writer.addQuad(RDFTools.node_node_node(this.prefix + ':' + parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix + ':' + parentKey, 'rdfs:label', schema.description));
}
return parentKey;
}
if (schema.type === 'boolean') { // Base Case
this.writer.addQuad(RDFTools.node_node_node(this.prefix + ':' + parentKey, 'rdf:type', 'xsd:boolean'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix + ':' + parentKey, 'rdfs:label', schema.description));
if (!RDFTools.inMap(parentKey)) {
this.writer.addQuad(RDFTools.node_node_node(this.prefix + ':' + parentKey, 'rdf:type', 'xsd:boolean'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix + ':' + parentKey, 'rdfs:label', schema.description));
}
return parentKey;
}
if (schema["enum"] != undefined) { // Base Case: schema.enum
......
......@@ -35,18 +35,24 @@ static traverse (parentKey, schema){
return parentKey;
}
if (schema.type === 'number') { // Base Case
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+parentKey, 'rdfs:label', schema.description));
if (!RDFTools.inMap(parentKey)){
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+parentKey, 'rdfs:label', schema.description));
}
return parentKey;
}
if (schema.type === 'integer') {// Base Case
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+parentKey, 'rdfs:label', schema.description));
if (!RDFTools.inMap(parentKey)){
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+parentKey, 'rdf:type', 'xsd:integer'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+parentKey, 'rdfs:label', schema.description));
}
return parentKey;
}
if (schema.type === 'boolean') {// Base Case
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+parentKey, 'rdf:type', 'xsd:boolean'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+parentKey, 'rdfs:label', schema.description));
if (!RDFTools.inMap(parentKey)){
this.writer.addQuad(RDFTools.node_node_node(this.prefix+':'+parentKey, 'rdf:type', 'xsd:boolean'));
this.writer.addQuad(RDFTools.node_node_literal(this.prefix+':'+parentKey, 'rdfs:label', schema.description));
}
return parentKey;
}
if (schema.enum != undefined){ // Base Case: schema.enum
......
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