David Price

Initial set up of DPR2 as DailyProductionReport using DPR-tables

1 -# Saved by TopBraid on Wed Oct 12 19:50:38 BST 2011 1 +# baseURI: http://www.reportinghub.no/ep/spin/dpr-tables
2 -# baseURI: http://www.reportinghub.no/ep/spin/dpr-tables 2 +# imports: http://spinrdf.org/spin
3 -# imports: http://www.reportinghub.no/ep/schema/1.0/production 3 +# imports: http://www.reportinghub.no/ep/schema/1.0/production
4 -# imports: http://spinrdf.org/spin 4 +# imports: http://www.reportinghub.no/spin/rh
5 -# imports: http://www.reportinghub.no/spin/rh 5 +
6 - 6 +@prefix dpr-tables: <http://www.reportinghub.no/ep/spin/dpr-tables#> .
7 -@prefix dpr-tables: <http://www.reportinghub.no/ep/spin/dpr-tables#> . 7 +@prefix owl: <http://www.w3.org/2002/07/owl#> .
8 -@prefix owl: <http://www.w3.org/2002/07/owl#> . 8 +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
9 -@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . 9 +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
10 -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 10 +@prefix rhspin: <http://www.reportinghub.no/spin/rh#> .
11 -@prefix rhspin: <http://www.reportinghub.no/spin/rh#> . 11 +@prefix sp: <http://spinrdf.org/sp#> .
12 -@prefix sp: <http://spinrdf.org/sp#> . 12 +@prefix spin: <http://spinrdf.org/spin#> .
13 -@prefix spin: <http://spinrdf.org/spin#> . 13 +@prefix spl: <http://spinrdf.org/spl#> .
14 -@prefix spl: <http://spinrdf.org/spl#> . 14 +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
15 -@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . 15 +
16 - 16 +<http://www.reportinghub.no/ep/spin/dpr-tables>
17 -<http://www.reportinghub.no/ep/spin/dpr-tables> 17 + rdf:type owl:Ontology ;
18 - rdf:type owl:Ontology ; 18 + owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/production> , <http://www.reportinghub.no/spin/rh> ;
19 - owl:imports <http://www.reportinghub.no/ep/schema/1.0/production> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/spin/rh> ; 19 + owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
20 - owl:versionInfo "Created with TopBraid Composer"^^xsd:string . 20 +
21 - 21 +dpr-tables:PersonnelInformation
22 -dpr-tables:WellInformation 22 + rdf:type rhspin:TableTemplate ;
23 - rdf:type rhspin:TableTemplate ; 23 + rdfs:label "Personnel Information"^^xsd:string ;
24 - rdfs:subClassOf rhspin:TableTemplates ; 24 + rdfs:subClassOf rhspin:DPRTableTemplates ;
25 - spin:body 25 + spin:body
26 - [ rdf:type sp:Select ; 26 + [ rdf:type sp:Select ;
27 - sp:resultVariables ([ sp:varName "description"^^xsd:string 27 + sp:orderBy ([ sp:varName "facilityName"^^xsd:string
28 - ] _:b1 [ sp:varName "choke"^^xsd:string 28 + ]) ;
29 - ] [ sp:varName "prod"^^xsd:string 29 + sp:resultVariables ([ sp:varName "facilityName"^^xsd:string
30 - ]) ; 30 + ] [ sp:varName "beds"^^xsd:string
31 - sp:where ([ sp:object _:b2 ; 31 + ] [ sp:varName "crewNumber"^^xsd:string
32 - sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ; 32 + ] [ sp:varName "crewTypename"^^xsd:string
33 - sp:subject 33 + ]) ;
34 - [ sp:varName "report"^^xsd:string 34 + sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
35 - ] 35 + sp:predicate rdf:type ;
36 - ] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyProductionActivity> ; 36 + sp:subject
37 - sp:predicate rdf:type ; 37 + [ sp:varName "productionReport"^^xsd:string
38 - sp:subject _:b2 38 + ]
39 - ] [ sp:object _:b3 ; 39 + ] [ sp:object
40 - sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ; 40 + [ sp:varName "productionReport"^^xsd:string
41 - sp:subject _:b2 41 + ] ;
42 - ] [ sp:object <http://www.reportinghub.no/ep/schema/production-activity#ProductionOperationsActivity> ; 42 + sp:predicate <http://www.reportinghub.no/ep/schema/core#partOf> ;
43 - sp:predicate rdf:type ; 43 + sp:subject
44 - sp:subject _:b3 44 + [ sp:varName "productionOperationReport"^^xsd:string
45 - ] [ rdf:type sp:Optional ; 45 + ]
46 - sp:elements ([ sp:object _:b1 ; 46 + ] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionOperationReport> ;
47 - sp:predicate <http://www.reportinghub.no/ep/schema/production-facility#numberOfOwnCrew> ; 47 + sp:predicate rdf:type ;
48 - sp:subject 48 + sp:subject
49 - [ sp:varName "act"^^xsd:string 49 + [ sp:varName "productionOperationReport"^^xsd:string
50 - ] 50 + ]
51 - ]) 51 + ] [ sp:object
52 - ]) 52 + [ sp:varName "temporalPartOfFacility"^^xsd:string
53 - ] ; 53 + ] ;
54 - rhspin:tableHeaders ("Description"^^xsd:string "Oil Net m3"^^xsd:string "Choke %"^^xsd:string "Prod Hours"^^xsd:string) . 54 + sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
55 - 55 + sp:subject
56 -_:b2 sp:varName "dailyProductionActivity"^^xsd:string . 56 + [ sp:varName "productionOperationReport"^^xsd:string
57 - 57 + ]
58 -_:b3 sp:varName "productionOperationsActivity"^^xsd:string . 58 + ] [ sp:object
59 - 59 + [ sp:varName "productionFacility"^^xsd:string
60 -_:b1 sp:varName "oilNet"^^xsd:string . 60 + ] ;
61 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
62 + sp:subject
63 + [ sp:varName "temporalPartOfFacility"^^xsd:string
64 + ]
65 + ] [ sp:object <http://www.reportinghub.no/ep/schema/facility#Field> ;
66 + sp:predicate rdf:type ;
67 + sp:subject
68 + [ sp:varName "productionFacility"^^xsd:string
69 + ]
70 + ] [ sp:object
71 + [ sp:varName "facilityName"^^xsd:string
72 + ] ;
73 + sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
74 + sp:subject
75 + [ sp:varName "productionFacility"^^xsd:string
76 + ]
77 + ] [ sp:object
78 + [ sp:varName "productionOperationReport"^^xsd:string
79 + ] ;
80 + sp:predicate <http://www.reportinghub.no/ep/schema/core#partOf> ;
81 + sp:subject
82 + [ sp:varName "productionOperationInstallationReport"^^xsd:string
83 + ]
84 + ] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionOperationInstallationReport> ;
85 + sp:predicate rdf:type ;
86 + sp:subject
87 + [ sp:varName "productionOperationInstallationReport"^^xsd:string
88 + ]
89 + ] [ sp:object
90 + [ sp:varName "installationPart"^^xsd:string
91 + ] ;
92 + sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
93 + sp:subject
94 + [ sp:varName "productionOperationInstallationReport"^^xsd:string
95 + ]
96 + ] [ sp:object
97 + [ sp:varName "beds"^^xsd:string
98 + ] ;
99 + sp:predicate <http://www.reportinghub.no/ep/schema/production-facility#numberOfBedsAvailable> ;
100 + sp:subject
101 + [ sp:varName "installationPart"^^xsd:string
102 + ]
103 + ] [ rdf:type sp:Optional ;
104 + sp:elements ([ sp:object
105 + [ sp:varName "crew"^^xsd:string
106 + ] ;
107 + sp:predicate <http://www.reportinghub.no/ep/schema/organization#hasCrew> ;
108 + sp:subject
109 + [ sp:varName "installationPart"^^xsd:string
110 + ]
111 + ] [ sp:object
112 + [ sp:varName "crewNumber"^^xsd:string
113 + ] ;
114 + sp:predicate <http://www.reportinghub.no/ep/schema/organization#numberInCrew> ;
115 + sp:subject
116 + [ sp:varName "crew"^^xsd:string
117 + ]
118 + ] [ sp:object
119 + [ sp:varName "crewType"^^xsd:string
120 + ] ;
121 + sp:predicate rdf:type ;
122 + sp:subject
123 + [ sp:varName "crew"^^xsd:string
124 + ]
125 + ] [ sp:object <http://www.reportinghub.no/ep/schema/organization#CrewType> ;
126 + sp:predicate rdf:type ;
127 + sp:subject
128 + [ sp:varName "crewType"^^xsd:string
129 + ]
130 + ] [ sp:object
131 + [ sp:varName "crewTypename"^^xsd:string
132 + ] ;
133 + sp:predicate rdfs:label ;
134 + sp:subject
135 + [ sp:varName "crewType"^^xsd:string
136 + ]
137 + ])
138 + ])
139 + ] ;
140 + rhspin:tableHeaders ("Facility"^^xsd:string "Beds"^^xsd:string "Crew"^^xsd:string "Crew Type"^^xsd:string) .
141 +
142 +dpr-tables:WellInformation
143 + rdf:type rhspin:TableTemplate ;
144 + rdfs:subClassOf rhspin:DPRTableTemplates ;
145 + spin:body
146 + [ rdf:type sp:Select ;
147 + sp:resultVariables ([ sp:varName "description"^^xsd:string
148 + ] _:b1 [ sp:varName "choke"^^xsd:string
149 + ] [ sp:varName "prod"^^xsd:string
150 + ]) ;
151 + sp:where ([ sp:object _:b2 ;
152 + sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
153 + sp:subject
154 + [ sp:varName "report"^^xsd:string
155 + ]
156 + ] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyProductionActivity> ;
157 + sp:predicate rdf:type ;
158 + sp:subject _:b2
159 + ] [ sp:object _:b3 ;
160 + sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
161 + sp:subject _:b2
162 + ] [ sp:object <http://www.reportinghub.no/ep/schema/production-activity#ProductionOperationsActivity> ;
163 + sp:predicate rdf:type ;
164 + sp:subject _:b3
165 + ] [ rdf:type sp:Optional ;
166 + sp:elements ([ sp:object _:b1 ;
167 + sp:predicate <http://www.reportinghub.no/ep/schema/production-facility#numberOfOwnCrew> ;
168 + sp:subject
169 + [ sp:varName "act"^^xsd:string
170 + ]
171 + ])
172 + ])
173 + ] ;
174 + rhspin:tableHeaders ("Description"^^xsd:string "Oil Net m3"^^xsd:string "Choke %"^^xsd:string "Prod Hours"^^xsd:string) .
175 +
176 +_:b2 sp:varName "dailyProductionActivity"^^xsd:string .
177 +
178 +_:b1 sp:varName "oilNet"^^xsd:string .
179 +
180 +_:b3 sp:varName "productionOperationsActivity"^^xsd:string .
......
1 -# Saved by TopBraid on Wed Oct 12 19:50:38 BST 2011
2 # baseURI: null 1 # baseURI: null
3 2
4 @prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> . 3 @prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> .
......
1 -<ui:group 1 +<ui:group
2 - let:report="{# SELECT ?report WHERE {?report a ep-report:DailyProductionReport }}" 2 +let:report="{# SELECT ?report WHERE { ?report a ep-report:ProductionReport . } }"
3 - let:mainAct="{# SELECT ?mainAct WHERE {?report a ep-report:DailyProductionReport . ?report ep-report:reportOn ?mainAct}}" 3 +
4 - let:mainFac="{# SELECT ?mainFac WHERE {?report a ep-report:DailyProductionReport . ?report ep-report:reportOn ?mainAct . ?mainAct ep-prodact:involvement ?epMainFacTempPart . ?mainFac ep-core:hasTemporalPart ?epMainFacTempPart}}" 4 +let:reportedFieldName="{# SELECT ?reportedFieldName
5 - let:opCo="{# SELECT ?opCo WHERE {?report a ep-prodreport:DailyProductionReport . ?report ep-report:reportOn ?mainAct . ?mainFac ep-fac:facilityOperator ?opCo}}" 5 +WHERE {
6 - > 6 + ?report a ep-report:ProductionReport .
7 - <center> 7 +
8 - <h1>{# SELECT ?mfName WHERE {?mainFac rdfs:label ?mfName}}</h1> 8 + ?report ep-report:reportOn ?partOfFacility .
9 - <h2>{# SELECT ?ocName WHERE {?opCo rdfs:label ?ocName}}</h2> 9 + ?partOfFacility ep-core:temporalPartOf ?reportedField .
10 - <h2>{# SELECT ?docName WHERE {?report rdfs:label ?docName}}</h2> 10 + ?reportedField npd:name ?reportedFieldName .
11 - <h2>Report date: {# SELECT ?docDate WHERE {?report ep-report:dateCoveredByReport ?docDate}}</h2> 11 +}}"
12 - <h2>Issue date: {# SELECT ?createDate WHERE {?report ep-report:createdAt ?createDate}}</h2> 12 +
13 - </center> 13 +>
14 - <hr /> 14 +
15 +<h1>Daily Production Report : {= ?reportedFieldName } Field {# SELECT ?day WHERE { ?partOfFacility ep-activity:existsThroughout ?day . } }</h1>
16 +<h2>Report title : {# SELECT ?title WHERE { ?report a ep-report:ProductionReport . ?report ep-core:name ?title . } }</h2>
17 +<h2>Submitted by : {# SELECT ?submittingFieldName WHERE
18 +{
19 +
20 +?report a ep-report:ProductionReport .
21 +?report ep-report:reportSubmittedFrom ?submittingFieldState .
22 +?submittingFieldState ep-core:temporalPartOf ?submittingField .
23 +?submittingField npd:name ?submittingFieldName .
24 +
25 +} }</h2>
15 26
16 <dprswp:Table arg:report="{= ?report }" arg:template="dpr-tables:WellInformation" /> 27 <dprswp:Table arg:report="{= ?report }" arg:template="dpr-tables:WellInformation" />
28 + <dprswp:Table arg:report="{= ?report }" arg:template="dpr-tables:PersonnelInformation" />
17 29
18 </ui:group> 30 </ui:group>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -28,7 +28,7 @@ arg:template ...@@ -28,7 +28,7 @@ arg:template
28 rdfs:label "template"^^xsd:string ; 28 rdfs:label "template"^^xsd:string ;
29 rdfs:subPropertyOf sp:arg . 29 rdfs:subPropertyOf sp:arg .
30 30
31 -<http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport> 31 +<http://www.reportinghub.no/ep/schema/report#ProductionReport>
32 ui:instanceView 32 ui:instanceView
33 [ rdf:type dprswp:DailyProductionReportView ; 33 [ rdf:type dprswp:DailyProductionReportView ;
34 arg:report spin:_this 34 arg:report spin:_this
...@@ -47,7 +47,7 @@ dprswp:DailyProductionReportView ...@@ -47,7 +47,7 @@ dprswp:DailyProductionReportView
47 [ rdf:type spl:Argument ; 47 [ rdf:type spl:Argument ;
48 rdfs:comment "The report to display."^^xsd:string ; 48 rdfs:comment "The report to display."^^xsd:string ;
49 spl:predicate arg:report ; 49 spl:predicate arg:report ;
50 - spl:valueType <http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport> 50 + spl:valueType <http://www.reportinghub.no/ep/schema/report#ProductionReport>
51 ] ; 51 ] ;
52 ui:headIncludes 52 ui:headIncludes
53 [ rdf:type html:Link ; 53 [ rdf:type html:Link ;
...@@ -67,7 +67,7 @@ dprswp:Table ...@@ -67,7 +67,7 @@ dprswp:Table
67 rdfs:comment "The report that serves as root of the template."^^xsd:string ; 67 rdfs:comment "The report that serves as root of the template."^^xsd:string ;
68 spl:optional "true"^^xsd:boolean ; 68 spl:optional "true"^^xsd:boolean ;
69 spl:predicate arg:report ; 69 spl:predicate arg:report ;
70 - spl:valueType <http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport> 70 + spl:valueType <http://www.reportinghub.no/ep/schema/report#ProductionReport>
71 ] ; 71 ] ;
72 spin:constraint 72 spin:constraint
73 [ rdf:type spl:Argument ; 73 [ rdf:type spl:Argument ;
......