mappingQualitySchema.ttl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. @prefix rr: <http://www.w3.org/ns/r2rml#> .
  2. @prefix daq: <http://purl.org/eis/vocab/daq#> .
  3. @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
  4. @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
  5. @prefix ex: <http://example.com/ns#> .
  6. @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
  7. <#Class-ValidationRule-View>
  8. rr:sqlQuery """
  9. SELECT DISTINCT CATEGORY, DIMENSION,
  10. SUBSTR(VALIDATION_RULE, 0, INSTR(validation_rule, ' ') - 1) as VAL_RULE_ID,
  11. SUBSTR(VALIDATION_RULE, INSTR(validation_rule, ' ') + 1) as VAL_RULE_LABEL
  12. FROM VALIDATION_FEATURE2 inner join MAPPING2 on SUBSTR(VALIDATION_RULE, 0, INSTR(validation_rule, ' ') - 1) = MAPPING2.METRIC
  13. """;
  14. rr:sqlVersion rr:Oracle .
  15. <#OracleCategory>
  16. rr:logicalTable <#Class-ValidationRule-View> ;
  17. rr:subjectMap [
  18. rr:template "http://data.example.com/category/{CATEGORY}" ;
  19. rr:class rdfs:Class ;
  20. ] ;
  21. rr:predicateObjectMap [
  22. rr:predicate rdfs:label ;
  23. rr:objectMap [ rr:column "CATEGORY" ];
  24. ] ;
  25. rr:predicateObjectMap [
  26. rr:predicate rdfs:subClassOf ;
  27. rr:objectMap [ rr:constant daq:Category ] ;
  28. ] .
  29. <#TriplesMapForDimensionClass>
  30. rr:logicalTable <#Class-ValidationRule-View> ;
  31. rr:subjectMap [
  32. rr:template "http://data.example.com/dimension/{DIMENSION}";
  33. rr:class rdfs:Class ;
  34. ] ;
  35. rr:predicateObjectMap [
  36. rr:predicate rdfs:label ;
  37. rr:objectMap [ rr:column "DIMENSION" ];
  38. ] ;
  39. rr:predicateObjectMap [
  40. rr:predicate rdfs:subClassOf ;
  41. rr:objectMap [ rr:constant daq:Dimension ] ;
  42. ] .
  43. <#TriplesMapForDimensionProperty>
  44. rr:logicalTable <#Class-ValidationRule-View> ;
  45. rr:subjectMap [
  46. rr:template "http://data.example.com/dimension/has{DIMENSION}Dimension";
  47. rr:class rdf:Property ;
  48. ] ;
  49. rr:predicateObjectMap [
  50. rr:predicate rdfs:subPropertyOf ;
  51. rr:objectMap [ rr:constant daq:hasDimension ] ;
  52. ] ;
  53. rr:predicateObjectMap [
  54. rr:predicate rdfs:domain ;
  55. rr:objectMap [ rr:template "http://data.example.com/category/{CATEGORY}" ] ;
  56. ] ;
  57. rr:predicateObjectMap [
  58. rr:predicate rdfs:range ;
  59. rr:objectMap [ rr:template "http://data.example.com/dimension/{DIMENSION}" ] ;
  60. ] .
  61. <#TriplesMapForMetricClass>
  62. rr:logicalTable <#Class-ValidationRule-View> ;
  63. rr:subjectMap [
  64. rr:template "http://data.example.com/metric/{VAL_RULE_ID}";
  65. rr:class rdfs:Class ;
  66. ] ;
  67. rr:predicateObjectMap [
  68. rr:predicate rdfs:label ;
  69. rr:objectMap [ rr:column "VAL_RULE_ID" ];
  70. ] ;
  71. rr:predicateObjectMap [
  72. rr:predicate rdfs:subClassOf ;
  73. rr:objectMap [ rr:constant daq:Metric ] ;
  74. ] ;
  75. rr:predicateObjectMap [
  76. rr:predicate rdfs:comment ;
  77. rr:objectMap [ rr:column "VAL_RULE_LABEL" ] ;
  78. ] ;
  79. rr:predicateObjectMap [
  80. rr:predicate daq:expectedDataType ;
  81. rr:objectMap [ rr:constant xsd:double ] ;
  82. ] .
  83. <#TriplesMapForMetricProperty>
  84. rr:logicalTable <#Class-ValidationRule-View> ;
  85. rr:subjectMap [
  86. rr:template "http://data.example.com/metric/has{VAL_RULE_ID}Metric";
  87. rr:class rdf:Property ;
  88. ] ;
  89. rr:predicateObjectMap [
  90. rr:predicate rdfs:subPropertyOf ;
  91. rr:objectMap [ rr:constant daq:hasMetric ] ;
  92. ] ;
  93. rr:predicateObjectMap [
  94. rr:predicate rdfs:domain ;
  95. rr:objectMap [ rr:template "http://data.example.com/dimension/{DIMENSION}" ] ;
  96. ] ;
  97. rr:predicateObjectMap [
  98. rr:predicate rdfs:range ;
  99. rr:objectMap [ rr:template "http://data.example.com/metric/{VAL_RULE_ID}" ] ;
  100. ] .