Skip to content

Commit

Permalink
Merge pull request #14 from julianrojas87/dev
Browse files Browse the repository at this point in the history
Merge predicates with "other" alternative
  • Loading branch information
julianrojas87 authored Nov 3, 2020
2 parents 8cd5240 + 15b3f5c commit 4c3f22c
Show file tree
Hide file tree
Showing 6 changed files with 763 additions and 739 deletions.
31 changes: 17 additions & 14 deletions mappings/skos-concepts.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
prefixes:
xsd: "http://www.w3.org/2001/XMLSchema#"
rdfs: "http://www.w3.org/2000/01/rdf-schema#"
skos: "http://www.w3.org/2004/02/skos/core#"
idlab-fn: "http://example.com/idlab/function/"
Expand All @@ -20,7 +21,7 @@ prefixes:
era-ic: "http://era.europa.eu/concepts/ice-conditions#"
era-cls: "http://era.europa.eu/concepts/contact-line-systems#"
era-ess: "http://era.europa.eu/concepts/energy-supply-systems#"
era-tph: "http://era.europa.eu/concepts/tsi-pantograph-heads#"
era-pth: "http://era.europa.eu/concepts/pantograph-heads#"
era-csm: "http://era.europa.eu/concepts/contact-strip-materials#"
era-ph: "http://era.europa.eu/concepts/platform-heights#"
era-gsmr: "http://era.europa.eu/concepts/gsmr-networks#"
Expand Down Expand Up @@ -199,7 +200,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.9.2'));
s: http://era.europa.eu/concepts/axle-monitoring#$(OtherURI)
po:
- [a, era-am:OtherAxleBearingMonitoring]
- [a, era-am:AxleBearingMonitoring]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -269,7 +270,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.6.5'));
s: http://era.europa.eu/concepts/rail-inclinations#$(OtherURI)
po:
- [a, era-ri:OtherRailInclination]
- [a, era-ri:RailInclination]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -313,7 +314,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.1.11'));
s: http://era.europa.eu/concepts/gauge-changeover-facilities#$(OtherURI)
po:
- [a, era-gcf:OtherGaugeChangeoverFacility]
- [a, era-gcf:GaugeChangeoverFacility]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -396,7 +397,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.3.3'));
s: http://era.europa.eu/concepts/ice-conditions#$(OtherURI)
po:
- [a, era-ic:OtherIceCondition]
- [a, era-ic:IceCondition]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -478,7 +479,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.10.1'));
s: http://era.europa.eu/concepts/energy-supply-systems#$(OtherURI)
po:
- [a, era-ess:OtherEnergySupplySystem]
- [a, era-ess:EnergySupplySystem]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand All @@ -495,10 +496,11 @@ mappings:
queryFormulation: *queryFormulation
referenceFormulation: *referenceFormulation
query: SELECT DISTINCT CONCAT((SELECT LookupValues.[Value] FROM RINF.dbo.LookupValues WHERE LookupValues.ID = TrackParameters.LookupValueID), TrackParameters.Value, '') AS ParameterValue, REPLACE(CONCAT((SELECT LookupValues.[Value] FROM RINF.dbo.LookupValues WHERE LookupValues.ID = TrackParameters.LookupValueID), TrackParameters.Value, ''), ' ', '_') AS UriName FROM RINF.dbo.TrackParameters, RINF.dbo.Parameters, RINF.dbo.SOLTracks, RINF.dbo.SectionOfLines WHERE SOLTracks.TrackID = TrackParameters.TrackID AND TrackParameters.ParameterId = Parameters.ID AND (TrackParameters.[Value] IS NOT NULL OR TrackParameters.LookupValueID IS NOT NULL) AND "Index" IN ('1.1.1.2.3.1') AND SOLTracks.SectionOfLineID = SectionOfLines.ID AND SOLTracks.VersionID = SectionOfLines.VersionID;
s: http://era.europa.eu/concepts/tsi-pantograph-heads#$(UriName)
s: era-pth:$(UriName)
po:
- [a, era-tph:TSIPantographHead]
- [a, era-pth:PantographHead]
- [skos:prefLabel, $(ParameterValue)]
- [era:tsiCompliant, "true", xsd:boolean]

other-pantograph-heads-rinf:
sources:
Expand All @@ -508,10 +510,11 @@ mappings:
queryFormulation: *queryFormulation
referenceFormulation: *referenceFormulation
query: SELECT DISTINCT CONCAT((SELECT LookupValues.[Value] FROM RINF.dbo.LookupValues WHERE LookupValues.ID = TrackParameters.LookupValueID), TrackParameters.Value, '') AS ParameterValue, REPLACE(CONCAT((SELECT LookupValues.[Value] FROM RINF.dbo.LookupValues WHERE LookupValues.ID = TrackParameters.LookupValueID), TrackParameters.Value, ''), ' ', '_') AS UriName FROM RINF.dbo.TrackParameters, RINF.dbo.Parameters, RINF.dbo.SOLTracks, RINF.dbo.SectionOfLines WHERE SOLTracks.TrackID = TrackParameters.TrackID AND TrackParameters.ParameterId = Parameters.ID AND (TrackParameters.[Value] IS NOT NULL OR TrackParameters.LookupValueID IS NOT NULL) AND "Index" IN ('1.1.1.2.3.2') AND SOLTracks.SectionOfLineID = SectionOfLines.ID AND SOLTracks.VersionID = SectionOfLines.VersionID;
s: http://era.europa.eu/concepts/tsi-pantograph-heads#$(UriName)
s: era-pth:$(UriName)
po:
- [a, era-tph:OtherPantographHead]
- [a, era-pth:PantographHead]
- [skos:prefLabel, $(ParameterValue)]
- [era:tsiCompliant, "false", xsd:boolean]

contact-strip-materials-eratv:
sources:
Expand Down Expand Up @@ -573,7 +576,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.10.10'));
s: http://era.europa.eu/concepts/contact-strip-materials#$(OtherURI)
po:
- [a, era-csm:OtherContactStripMaterial]
- [a, era-csm:ContactStripMaterial]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -642,7 +645,7 @@ mappings:
query: SELECT DISTINCT SUBSTRING(TRIM((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId)), 1, 3) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.12.3.1'));
s: http://era.europa.eu/concepts/platform-heights#$(OtherURI)
po:
- [a, era-ph:OtherPlatformHeight]
- [a, era-ph:PlatformHeight]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -712,7 +715,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.13.1.5'));
s: http://era.europa.eu/concepts/train-protection-legacy-systems#$(OtherURI)
po:
- [a, era-tpls:OtherTrainProtectionLegacySystem]
- [a, era-tpls:TrainProtectionLegacySystem]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down Expand Up @@ -795,7 +798,7 @@ mappings:
query: SELECT DISTINCT (SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId) AS ParameterValue, RegistrationParameters.OtherValue, REPLACE((SELECT "Name" FROM ERATV.dbo.ReferenceListValues WHERE ReferenceListValues.ID=RegistrationParameters.ReferenceListValueId), ' ', '_') AS ParameterURI, REPLACE(RegistrationParameters.OtherValue, ' ', '_') AS OtherURI FROM ERATV.dbo.VehicleTypes, ERATV.dbo.RegistrationParameters, ERATV.dbo.Parameters WHERE VehicleTypes.ID = RegistrationParameters.VehicleTypesId AND RegistrationParameters.ParametersId = Parameters.ID AND (Parameters.Code IN ('4.13.1.5'));
s: http://era.europa.eu/concepts/legacy-radio-systems#$(OtherURI)
po:
- [a, era-lrs:OtherLegacyRadioSystem]
- [a, era-lrs:LegacyRadioSystem]
- p: skos:prefLabel
o: $(OtherValue)
condition:
Expand Down
6 changes: 3 additions & 3 deletions mappings/sol-tracks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ prefixes:
era-ri: "http://era.europa.eu/concepts/rail-inclinations#"
era-cls: "http://era.europa.eu/concepts/contact-line-systems#"
era-ess: "http://era.europa.eu/concepts/energy-supply-systems#"
era-tph: "http://era.europa.eu/concepts/tsi-pantograph-heads#"
era-pth: "http://era.europa.eu/concepts/pantograph-heads#"
era-csm: "http://era.europa.eu/concepts/contact-strip-materials#"
era-esc: "http://era.europa.eu/concepts/etcs-system-compatibilities#"
era-gsmr: "http://era.europa.eu/concepts/gsmr-networks#"
Expand Down Expand Up @@ -876,7 +876,7 @@ mappings:
query: SELECT SectionOfLines.ID, SOLTracks.TrackID, SOLTracks.VersionID, REPLACE(CONCAT((SELECT LookupValues.[Value] FROM RINF.dbo.LookupValues WHERE LookupValues.ID = TrackParameters.LookupValueID), TrackParameters.Value, ''), ' ', '_') AS UriName FROM RINF.dbo.TrackParameters, RINF.dbo.Parameters, RINF.dbo.SOLTracks, RINF.dbo.SectionOfLines WHERE SOLTracks.TrackID = TrackParameters.TrackID AND TrackParameters.ParameterId = Parameters.ID AND (TrackParameters.[Value] IS NOT NULL OR TrackParameters.LookupValueID IS NOT NULL) AND "Index" IN ('1.1.1.2.3.1') AND SOLTracks.SectionOfLineID = SectionOfLines.ID AND SOLTracks.VersionID = SectionOfLines.VersionID;
s: http://era.europa.eu/implementation#T_$(ID)_$(VersionID)_$(TrackID)
po:
- [era:pantographHeadTSI, era-tph:$(UriName)~iri]
- [era:pantographHead, era-pth:$(UriName)~iri]

other-accepted-pantographs: # 1.1.1.2.3.2
sources:
Expand All @@ -888,7 +888,7 @@ mappings:
query: SELECT SectionOfLines.ID, SOLTracks.TrackID, SOLTracks.VersionID, REPLACE(CONCAT((SELECT LookupValues.[Value] FROM RINF.dbo.LookupValues WHERE LookupValues.ID = TrackParameters.LookupValueID), TrackParameters.Value, ''), ' ', '_') AS UriName FROM RINF.dbo.TrackParameters, RINF.dbo.Parameters, RINF.dbo.SOLTracks, RINF.dbo.SectionOfLines WHERE SOLTracks.TrackID = TrackParameters.TrackID AND TrackParameters.ParameterId = Parameters.ID AND (TrackParameters.[Value] IS NOT NULL OR TrackParameters.LookupValueID IS NOT NULL) AND "Index" IN ('1.1.1.2.3.2') AND SOLTracks.SectionOfLineID = SectionOfLines.ID AND SOLTracks.VersionID = SectionOfLines.VersionID;
s: http://era.europa.eu/implementation#T_$(ID)_$(VersionID)_$(TrackID)
po:
- [era:otherPantographHead, era-tph:$(UriName)~iri]
- [era:pantographHead, era-pth:$(UriName)~iri]

contact-strip-material: # 1.1.1.2.3.4
sources:
Expand Down
18 changes: 9 additions & 9 deletions mappings/vehicles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherAxleBearingConditionMonitoring
- p: era:axleBearingConditionMonitoring
o: era-am:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down Expand Up @@ -491,7 +491,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherRailInclination
- p: era:railInclination
o: era-ri:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down Expand Up @@ -542,7 +542,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherWheelSetGaugeChangeoverFacility
- p: era:wheelSetGaugeChangeoverFacility
o: era-gcf:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down Expand Up @@ -814,7 +814,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherSnowIceHailConditions
- p: era:snowIceHailConditions
o: era-ic:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand All @@ -841,7 +841,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherEnergySupplySystem
- p: era:energySupplySystem
o: era-ess:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down Expand Up @@ -996,7 +996,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherContactStripMaterial
- p: era:contactStripMaterial
o: era-csm:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down Expand Up @@ -1151,7 +1151,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherPlatformHeight
- p: era:platformHeight
o: era-ph:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down Expand Up @@ -1318,7 +1318,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherProtectionLegacySystem
- p: era:protectionLegacySystem
o: era-tpls:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand All @@ -1343,7 +1343,7 @@ mappings:
parameters:
- [grel:valueParameter, $(OtherURI)]
- [grel:valueParameter2, ""]
- p: era:otherLegacyRadioSystem
- p: era:legacyRadioSystem
o: era-tpls:$(OtherURI)~iri
condition:
function: idlab-fn:notEqual
Expand Down
Loading

0 comments on commit 4c3f22c

Please sign in to comment.