TRANSFORM_ddr-wellAndWellBoreAlias-v1.1.1.ttl 11.8 KB
# baseURI: http://www.reportinghub.no/ep/transform/1.1/wellAndWellBoreAlias
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://www.reportinghub.no/ep/spin/1.1/lib
# imports: http://www.witsml.org/schemas/1series

@prefix :        <http://www.reportinghub.no/ep/transform/1.1/wellAndWellBoreAlias#> .
@prefix ddr:     <http://www.witsml.org/schemas/1series#> .
@prefix ep-activity:  <http://www.reportinghub.no/ep/schema/activity#> .
@prefix ep-core:  <http://www.reportinghub.no/ep/schema/core#> .
@prefix ep-spin-lib:  <http://www.reportinghub.no/ep/spin/lib#> .
@prefix fn:      <http://www.w3.org/2005/xpath-functions#> .
@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 smf:     <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sp:      <http://spinrdf.org/sp#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix spinmap:  <http://spinrdf.org/spinmap#> .
@prefix spl:     <http://spinrdf.org/spl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://www.reportinghub.no/ep/transform/1.1/wellAndWellBoreAlias>
      rdf:type owl:Ontology ;
      owl:imports <http://www.witsml.org/schemas/1series> , <http://www.reportinghub.no/ep/spin/1.1/lib> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://spinrdf.org/spin> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

ddr:Obj_drillReport
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "STEP 151 Transfer WellBore aliases"^^xsd:string ;
                sp:templates ([ sp:object
                                    [ sp:varName "name"^^xsd:string
                                    ] ;
                            sp:predicate
                                    [ sp:varName "labelOfSystem"^^xsd:string
                                    ] ;
                            sp:subject
                                    [ sp:varName "wellBore"^^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 "dTimStart"^^xsd:string
                                    ] ;
                            sp:predicate ddr:dTimStart ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "wellBoreAlias"^^xsd:string
                                    ] ;
                            sp:predicate ddr:wellboreAliasRef ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "name"^^xsd:string
                                    ] ;
                            sp:predicate ddr:name ;
                            sp:subject
                                    [ sp:varName "wellBoreAlias"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "namingSystem"^^xsd:string
                                    ] ;
                            sp:predicate ddr:namingSystemRef ;
                            sp:subject
                                    [ sp:varName "wellBoreAlias"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "temporalPartOfAWellBore"^^xsd:string
                                    ] ;
                            sp:predicate ep-activity:onWellBore ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:predicate ep-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: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
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:selectLabelOfSystem ;
                                      sp:arg1 [ sp:varName "namingSystem"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "labelOfSystem"^^xsd:string
                                    ]
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "STEP 150 Transfer Well aliases"^^xsd:string ;
                sp:templates ([ sp:object
                                    [ sp:varName "name"^^xsd:string
                                    ] ;
                            sp:predicate
                                    [ sp:varName "labelOfSystem"^^xsd:string
                                    ] ;
                            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 "dTimStart"^^xsd:string
                                    ] ;
                            sp:predicate ddr:dTimStart ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "wellAlias"^^xsd:string
                                    ] ;
                            sp:predicate ddr:wellAliasRef ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "name"^^xsd:string
                                    ] ;
                            sp:predicate ddr:name ;
                            sp:subject
                                    [ sp:varName "wellAlias"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "namingSystem"^^xsd:string
                                    ] ;
                            sp:predicate ddr:namingSystemRef ;
                            sp:subject
                                    [ sp:varName "wellAlias"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "temporalPartOfAWell"^^xsd:string
                                    ] ;
                            sp:predicate ep-activity:onWell ;
                            sp:subject
                                    [ sp:varName "dailyDrillingActivity"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "well"^^xsd:string
                                    ] ;
                            sp:predicate ep-core:temporalPartOf ;
                            sp:subject
                                    [ sp:varName "temporalPartOfAWell"^^xsd:string
                                    ]
                          ] [ rdf:type sp:NamedGraph ;
                            sp:elements ([ sp:object <http://www.reportinghub.no/ep/schema/well#Well> ;
                                        sp:predicate rdf:type ;
                                        sp:subject
                                                [ sp:varName "well"^^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
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:selectLabelOfSystem ;
                                      sp:arg1 [ sp:varName "namingSystem"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "labelOfSystem"^^xsd:string
                                    ]
                          ])
              ] .

[]    rdf:type sp:Modify .

[]    rdf:type fn:starts-with .

[]    rdf:type smf:trim .

[]    rdf:type smf:regex .

([]) .

([]) .

([] [] [ rdf:type sp:Filter
  ] [ rdf:type sp:Bind
  ]) .