SPIN_EP-DRILLING-tables-v1.0.spin.ttl 14.1 KB
# baseURI: http://www.reportinghub.no/ep/spin/drilling-tables
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/activity-purpose
# imports: http://www.reportinghub.no/ep/schema/1.0/drilling-equipment-type
# imports: http://www.reportinghub.no/spin/rh

@prefix arg:     <http://spinrdf.org/arg#> .
@prefix drilling-tables:  <http://www.reportinghub.no/ep/spin/drilling-tables#> .
@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 spif:    <http://spinrdf.org/spif#> .
@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/spin/drilling-tables>
      rdf:type owl:Ontology ;
      rdfs:comment "A collection of SELECT templates that can be used to assemble tables in DD reports."^^xsd:string ;
      owl:imports <http://www.reportinghub.no/ep/schema/1.0/drilling-equipment-type> , <http://www.reportinghub.no/spin/rh> , <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://spinrdf.org/spin> ;
      owl:versionInfo "0.1.0"^^xsd:string .

drilling-tables:DailyAndForecastComments
      rdf:type rhspin:TableTemplate ;
      rdfs:label "Daily and Forecast Comments"^^xsd:string ;
      rdfs:subClassOf rhspin:WDRTableTemplates ;
      spin:body
              [ rdf:type sp:Select ;
                sp:orderBy ([ sp:varName "day"^^xsd:string
                          ]) ;
                sp:resultVariables ([ sp:varName "day"^^xsd:string
                          ] [ sp:varName "dailySummary"^^xsd:string
                          ] [ sp:varName "nextDayForecast"^^xsd:string
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "startDate"^^xsd:string
                                    ] ;
                            sp:predicate rdf:first ;
                            sp:subject
                                    [ sp:varName "?0"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "?1"^^xsd:string
                                    ] ;
                            sp:predicate rdf:rest ;
                            sp:subject
                                    [ sp:varName "?0"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:predicate rdf:first ;
                            sp:subject
                                    [ sp:varName "?1"^^xsd:string
                                    ]
                          ] [ sp:object () ;
                            sp:predicate rdf:rest ;
                            sp:subject
                                    [ sp:varName "?1"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "ddr"^^xsd:string
                                    ] ;
                            sp:predicate rhspin:ddrOfWeek ;
                            sp:subject
                                    [ sp:varName "?0"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "dda"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
                            sp:subject
                                    [ sp:varName "ddr"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "ddats"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
                            sp:subject
                                    [ sp:varName "dda"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyDrillingActivityToStatus> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "ddats"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "startedAt"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
                            sp:subject
                                    [ sp:varName "ddats"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spif:dateFormat ;
                                      arg:date
                                              [ sp:varName "startedAt"^^xsd:string
                                              ] ;
                                      arg:pattern "yyyy-MM-dd"
                                    ] ;
                            sp:variable
                                    [ sp:varName "day"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "dailySummary"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesWithinTheDailyReportingPeriod> ;
                            sp:subject
                                    [ sp:varName "ddats"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "nextDayForecast"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesForecastForTheNextDailyReportingPeriod> ;
                            sp:subject
                                    [ sp:varName "ddats"^^xsd:string
                                    ]
                          ])
              ] ;
      rhspin:tableHeaders ("Day"^^xsd:string "Daily Summary"^^xsd:string "Next Day Forecast"^^xsd:string) .

drilling-tables:MissedProduction
      rdf:type rhspin:TableTemplate ;
      rdfs:label "Non Productive Time"^^xsd:string ;
      rdfs:subClassOf rhspin:WDRTableTemplates ;
      spin:body
              [ rdf:type sp:Select ;
                sp:orderBy ([ sp:varName "day"^^xsd:string
                          ]) ;
                sp:resultVariables ([ sp:varName "day"^^xsd:string
                          ] [ sp:varName "startTime"^^xsd:string
                          ] [ sp:varName "duration"^^xsd:string
                          ] [ sp:varName "comment"^^xsd:string
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "startDate"^^xsd:string
                                    ] ;
                            sp:predicate rdf:first ;
                            sp:subject
                                    [ sp:varName "?0"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "?1"^^xsd:string
                                    ] ;
                            sp:predicate rdf:rest ;
                            sp:subject
                                    [ sp:varName "?0"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:predicate rdf:first ;
                            sp:subject
                                    [ sp:varName "?1"^^xsd:string
                                    ]
                          ] [ sp:object () ;
                            sp:predicate rdf:rest ;
                            sp:subject
                                    [ sp:varName "?1"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "ddr"^^xsd:string
                                    ] ;
                            sp:predicate rhspin:ddrOfWeek ;
                            sp:subject
                                    [ sp:varName "?0"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "dda"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
                            sp:subject
                                    [ sp:varName "ddr"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "failure"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
                            sp:subject
                                    [ sp:varName "dda"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/activity#EquipmentFailureAndRepair> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "failure"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "timeOfFailure"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#timeOfFailure> ;
                            sp:subject
                                    [ sp:varName "failure"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spif:dateFormat ;
                                      arg:date
                                              [ sp:varName "timeOfFailure"^^xsd:string
                                              ] ;
                                      arg:pattern "yyyy-MM-dd"
                                    ] ;
                            sp:variable
                                    [ sp:varName "day"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "comment"^^xsd:string
                                    ] ;
                            sp:predicate rdfs:comment ;
                            sp:subject
                                    [ sp:varName "failure"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "mpt"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#missedProductionTime> ;
                            sp:subject
                                    [ sp:varName "failure"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "duration"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#minute> ;
                            sp:subject
                                    [ sp:varName "mpt"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spif:dateFormat ;
                                      arg:date
                                              [ sp:varName "timeOfFailure"^^xsd:string
                                              ] ;
                                      arg:pattern "HH:mm"
                                    ] ;
                            sp:variable
                                    [ sp:varName "startTime"^^xsd:string
                                    ]
                          ])
              ] ;
      rhspin:tableHeaders ("Day"^^xsd:string "Start Time"^^xsd:string "Duration Minutes"^^xsd:string "Comment"^^xsd:string) .

drilling-tables:Test
      rdf:type rhspin:TableTemplate ;
      rdfs:label "Test Table"^^xsd:string ;
      rdfs:subClassOf rhspin:WDRTableTemplates ;
      spin:body
              [ rdf:type sp:Select ;
                sp:resultVariables ([ sp:varName "a"^^xsd:string
                          ] [ sp:varName "b"^^xsd:string
                          ] [ sp:varName "c"^^xsd:string
                          ]) ;
                sp:where ([ rdf:type sp:Bind ;
                            sp:expression 42 ;
                            sp:variable
                                    [ sp:varName "a"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ sp:varName "startDate"^^xsd:string
                                    ] ;
                            sp:variable
                                    [ sp:varName "b"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ sp:varName "wellBore"^^xsd:string
                                    ] ;
                            sp:variable
                                    [ sp:varName "c"^^xsd:string
                                    ]
                          ])
              ] ;
      rhspin:tableHeaders ("Column 1"^^xsd:string "Column 2"^^xsd:string "Column 3"^^xsd:string) .