TRANSFORM_ddr-drillReport-v1.1.1.ttl 20.8 KB
# baseURI: http://www.reportinghub.no/ep/transform/1.1/ddr/drillReport
# imports: http://spinrdf.org/spin
# imports: http://www.energistics.org/schemas/abstract
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://www.reportinghub.no/ep/schema/1.0/activity-purpose
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/equipment
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://www.reportinghub.no/ep/spin/1.1/lib
# imports: http://www.witsml.org/schemas/1series

@prefix NPD_110721144611-valid:  <file:///Sandbox/NPD_110721144611-valid.xml#> .
@prefix arg:     <http://spinrdf.org/arg#> .
@prefix ddr:     <http://www.witsml.org/schemas/1series#> .
@prefix ep-spin-lib:  <http://www.reportinghub.no/ep/spin/lib#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rhspin:  <http://www.reportinghub.no/spin/rh#> .
@prefix sp:      <http://spinrdf.org/sp#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix spl:     <http://spinrdf.org/spl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://www.reportinghub.no/ep/transform/1.1/ddr/drillReport>
      rdf:type owl:Ontology ;
      owl:imports <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/spin/1.1/lib> , <http://www.witsml.org/schemas/1series> , <http://www.energistics.org/schemas/abstract> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/report> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

ddr:Obj_drillReport
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "STEP 106 Create Well Part"^^xsd:string ;
                sp:templates ([ sp:object _:b1 ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "well"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject _:b1
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b1
                          ] [ sp:object
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
                            sp:subject
                                    [ sp:varName "well"^^xsd:string
                                    ]
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "nameWellBore"^^xsd:string
                                    ] ;
                            sp:predicate ep-spin-lib:nameWellbore ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "nameWell"^^xsd:string
                                    ] ;
                            sp:predicate ep-spin-lib:nameWell ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "dTimStart"^^xsd:string
                                    ] ;
                            sp:predicate ddr:dTimStart ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ]
                          ] [ rdf:type sp:NamedGraph ;
                            sp:elements ([ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
                                        sp:predicate rdf:type ;
                                        sp:subject
                                                [ sp:varName "wellBore"^^xsd:string
                                                ]
                                      ] [ sp:object
                                                [ sp:varName "well"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
                                        sp:subject
                                                [ sp:varName "wellBore"^^xsd:string
                                                ]
                                      ]) ;
                            sp:graphNameNode <http://www.reportinghub.no/np/data/npd>
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedWellBoreName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
                                      sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "dTimStart"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment """STEP 103 Create DailyDrillingReport, DailyDrillingActivity, and TemporalPartOfAWellBore
Minimum data - createDate, dTimStart, dTimEnd, nameWellBore
Optional data - extendedReport
replaced for testing -  BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore) ."""^^xsd:string ;
                sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "dailyDrillingReport"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyDrillingActivity> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingReport"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "createDate"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingReport"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "dTimStart"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "dTimEnd"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWellBore> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object _:b2 ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesFollowingTheDailyReportingPeriod> ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/report#Report> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b2
                          ] [ sp:object
                                    [ sp:varName "extendedReportContent"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/report#hasContent> ;
                            sp:subject _:b2
                          ] [ sp:object
                                    [ sp:varName "dTimExtendedReport"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
                            sp:subject _:b2
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "nameWellBore"^^xsd:string
                                    ] ;
                            sp:predicate ep-spin-lib:nameWellbore ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "dTimStart"^^xsd:string
                                    ] ;
                            sp:predicate ddr:dTimStart ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "dTimEnd"^^xsd:string
                                    ] ;
                            sp:predicate ddr:dTimEnd ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "createDate"^^xsd:string
                                    ] ;
                            sp:predicate ddr:createDate ;
                            sp:subject spin:_this
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "extendedReport"^^xsd:string
                                                ] ;
                                        sp:predicate ddr:extendedReportRef ;
                                        sp:subject spin:_this
                                      ] [ sp:object
                                                [ sp:varName "extendedReportContent"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                                        sp:subject
                                                [ sp:varName "extendedReport"^^xsd:string
                                                ]
                                      ] [ rdf:type sp:Optional ;
                                        sp:elements ([ sp:object
                                                            [ sp:varName "dTimExtendedReport"^^xsd:string
                                                            ] ;
                                                    sp:predicate ddr:dTim ;
                                                    sp:subject
                                                            [ sp:varName "extendedReport"^^xsd:string
                                                            ]
                                                  ])
                                      ])
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedWellBoreName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
                                      sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "createDate"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "dailyDrillingReport"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
                                      sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "dTimStart"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:buildTemporalPartOfAWellBoreURI ;
                                      sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "dTimStart"^^xsd:string
                                              ] ;
                                      sp:arg3 [ sp:varName "dTimEnd"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type rhspin:wellBoreByName ;
                                      arg:wellBoreName
                                              [ rdf:type xsd:string ;
                                                sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
                                                        ]
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "wellBore"^^xsd:string
                                    ]
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment """STEP 105
Classify a DailyDrillingReport"""^^xsd:string ;
                sp:templates ([ sp:object
                                    [ sp:varName "dailyDrillingReportType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "dailyDrillingReport"^^xsd:string
                                    ]
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "nameWellBore"^^xsd:string
                                    ] ;
                            sp:predicate ep-spin-lib:nameWellbore ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "createDate"^^xsd:string
                                    ] ;
                            sp:predicate ddr:createDate ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "versionKind"^^xsd:string
                                    ] ;
                            sp:predicate ddr:versionKindRef ;
                            sp:subject spin:_this
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:selectDailyDrillingReportType ;
                                      sp:arg1 [ sp:varName "versionKind"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "dailyDrillingReportType"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedWellBoreName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
                                      sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "createDate"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "dailyDrillingReport"^^xsd:string
                                    ]
                          ])
              ] .