mapping.ttl 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  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. @prefix owl: <http://www.w3.org/2002/07/owl#> .
  8. @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
  9. @prefix dcterms: <http://purl.org/dc/terms/> .
  10. @prefix dc: <http://purl.org/dc/elements/1.1/> .
  11. @prefix vocab: <http://purl.org/vocab/vann/> .
  12. <#Class-ValidationRule-View>
  13. rr:sqlQuery """
  14. SELECT DISTINCT CATEGORY, DIMENSION, ERROR_DESCRIPTION, ORA_ERROR || 'ERROR' as ORA_ERROR_ID
  15. FROM VALIDATION_RULE inner join ORA_ERRORS on ORA_ERRORS.ERROR_ID=VALIDATION_RULE.ORA_ERROR;
  16. """;
  17. rr:sqlVersion rr:Oracle .
  18. <#OracleCategory>
  19. rr:logicalTable <#Class-ValidationRule-View> ;
  20. rr:subjectMap [
  21. rr:template "http://data.example.com/category/{CATEGORY}" ;
  22. rr:class rdfs:Class ;
  23. ] ;
  24. rr:predicateObjectMap [
  25. rr:predicate rdfs:label ;
  26. rr:objectMap [ rr:column "CATEGORY" ];
  27. ] ;
  28. rr:predicateObjectMap [
  29. rr:predicate rdfs:subClassOf ;
  30. rr:objectMap [ rr:constant daq:Category ] ;
  31. ] .
  32. <#TriplesMapForDimensionClass>
  33. rr:logicalTable <#Class-ValidationRule-View> ;
  34. rr:subjectMap [
  35. rr:template "http://data.example.com/dimension/{DIMENSION}";
  36. rr:class rdfs:Class ;
  37. ] ;
  38. rr:predicateObjectMap [
  39. rr:predicate rdfs:label ;
  40. rr:objectMap [ rr:column "DIMENSION" ];
  41. ] ;
  42. rr:predicateObjectMap [
  43. rr:predicate rdfs:subClassOf ;
  44. rr:objectMap [ rr:constant daq:Dimension ] ;
  45. ] .
  46. <#TriplesMapForDimensionProperty>
  47. rr:logicalTable <#Class-ValidationRule-View> ;
  48. rr:subjectMap [
  49. rr:template "http://data.example.com/dimension/has{DIMENSION}Dimension";
  50. rr:class rdf:Property ;
  51. ] ;
  52. rr:predicateObjectMap [
  53. rr:predicate rdfs:subPropertyOf ;
  54. rr:objectMap [ rr:constant daq:hasDimension ] ;
  55. ] ;
  56. rr:predicateObjectMap [
  57. rr:predicate rdfs:domain ;
  58. rr:objectMap [ rr:template "http://data.example.com/category/{CATEGORY}" ] ;
  59. ] ;
  60. rr:predicateObjectMap [
  61. rr:predicate rdfs:range ;
  62. rr:objectMap [ rr:template "http://data.example.com/dimension/{DIMENSION}" ] ;
  63. ] .
  64. <#TriplesMapForMetricClass>
  65. rr:logicalTable <#Class-ValidationRule-View> ;
  66. rr:subjectMap [
  67. rr:template "http://data.example.com/metric/{ORA_ERROR_ID}";
  68. rr:class rdfs:Class ;
  69. ] ;
  70. rr:predicateObjectMap [
  71. rr:predicate rdfs:label ;
  72. rr:objectMap [ rr:column "ORA_ERROR_ID" ];
  73. ] ;
  74. rr:predicateObjectMap [
  75. rr:predicate rdfs:subClassOf ;
  76. rr:objectMap [ rr:constant daq:Metric ] ;
  77. ] ;
  78. rr:predicateObjectMap [
  79. rr:predicate rdfs:comment ;
  80. rr:objectMap [ rr:column "ERROR_DESCRIPTION" ] ;
  81. ] ;
  82. rr:predicateObjectMap [
  83. rr:predicate daq:expectedDataType ;
  84. rr:objectMap [ rr:constant xsd:double ] ;
  85. ] .
  86. <#TriplesMapForMetricProperty>
  87. rr:logicalTable <#Class-ValidationRule-View> ;
  88. rr:subjectMap [
  89. rr:template "http://data.example.com/metric/has{ORA_ERROR_ID}Metric";
  90. rr:class rdf:Property ;
  91. ] ;
  92. rr:predicateObjectMap [
  93. rr:predicate rdfs:subPropertyOf ;
  94. rr:objectMap [ rr:constant daq:hasMetric ] ;
  95. ] ;
  96. rr:predicateObjectMap [
  97. rr:predicate rdfs:domain ;
  98. rr:objectMap [ rr:template "http://data.example.com/dimension/{DIMENSION}" ] ;
  99. ] ;
  100. rr:predicateObjectMap [
  101. rr:predicate rdfs:range ;
  102. rr:objectMap [ rr:template "http://data.example.com/metric/{ORA_ERROR_ID}" ] ;
  103. ] .