David Price

Initial set up of DPR2 as DailyProductionReport using DPR-tables

# Saved by TopBraid on Wed Oct 12 19:50:38 BST 2011
# baseURI: http://www.reportinghub.no/ep/spin/dpr-tables
# imports: http://www.reportinghub.no/ep/schema/1.0/production
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/spin/rh
@prefix dpr-tables: <http://www.reportinghub.no/ep/spin/dpr-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 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/dpr-tables>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/schema/1.0/production> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
dpr-tables:WellInformation
rdf:type rhspin:TableTemplate ;
rdfs:subClassOf rhspin:TableTemplates ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "description"^^xsd:string
] _:b1 [ sp:varName "choke"^^xsd:string
] [ sp:varName "prod"^^xsd:string
]) ;
sp:where ([ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyProductionActivity> ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object _:b3 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject _:b2
] [ sp:object <http://www.reportinghub.no/ep/schema/production-activity#ProductionOperationsActivity> ;
sp:predicate rdf:type ;
sp:subject _:b3
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-facility#numberOfOwnCrew> ;
sp:subject
[ sp:varName "act"^^xsd:string
]
])
])
] ;
rhspin:tableHeaders ("Description"^^xsd:string "Oil Net m3"^^xsd:string "Choke %"^^xsd:string "Prod Hours"^^xsd:string) .
_:b2 sp:varName "dailyProductionActivity"^^xsd:string .
_:b3 sp:varName "productionOperationsActivity"^^xsd:string .
_:b1 sp:varName "oilNet"^^xsd:string .
# baseURI: http://www.reportinghub.no/ep/spin/dpr-tables
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/production
# imports: http://www.reportinghub.no/spin/rh
@prefix dpr-tables: <http://www.reportinghub.no/ep/spin/dpr-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 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/dpr-tables>
rdf:type owl:Ontology ;
owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/production> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
dpr-tables:PersonnelInformation
rdf:type rhspin:TableTemplate ;
rdfs:label "Personnel Information"^^xsd:string ;
rdfs:subClassOf rhspin:DPRTableTemplates ;
spin:body
[ rdf:type sp:Select ;
sp:orderBy ([ sp:varName "facilityName"^^xsd:string
]) ;
sp:resultVariables ([ sp:varName "facilityName"^^xsd:string
] [ sp:varName "beds"^^xsd:string
] [ sp:varName "crewNumber"^^xsd:string
] [ sp:varName "crewTypename"^^xsd:string
]) ;
sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionReport"^^xsd:string
]
] [ sp:object
[ sp:varName "productionReport"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#partOf> ;
sp:subject
[ sp:varName "productionOperationReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionOperationReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionOperationReport"^^xsd:string
]
] [ sp:object
[ sp:varName "temporalPartOfFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "productionOperationReport"^^xsd:string
]
] [ sp:object
[ sp:varName "productionFacility"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "temporalPartOfFacility"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#Field> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
]
] [ sp:object
[ sp:varName "facilityName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
[ sp:varName "productionFacility"^^xsd:string
]
] [ sp:object
[ sp:varName "productionOperationReport"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#partOf> ;
sp:subject
[ sp:varName "productionOperationInstallationReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionOperationInstallationReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "productionOperationInstallationReport"^^xsd:string
]
] [ sp:object
[ sp:varName "installationPart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "productionOperationInstallationReport"^^xsd:string
]
] [ sp:object
[ sp:varName "beds"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-facility#numberOfBedsAvailable> ;
sp:subject
[ sp:varName "installationPart"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "crew"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/organization#hasCrew> ;
sp:subject
[ sp:varName "installationPart"^^xsd:string
]
] [ sp:object
[ sp:varName "crewNumber"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/organization#numberInCrew> ;
sp:subject
[ sp:varName "crew"^^xsd:string
]
] [ sp:object
[ sp:varName "crewType"^^xsd:string
] ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "crew"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/organization#CrewType> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "crewType"^^xsd:string
]
] [ sp:object
[ sp:varName "crewTypename"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject
[ sp:varName "crewType"^^xsd:string
]
])
])
] ;
rhspin:tableHeaders ("Facility"^^xsd:string "Beds"^^xsd:string "Crew"^^xsd:string "Crew Type"^^xsd:string) .
dpr-tables:WellInformation
rdf:type rhspin:TableTemplate ;
rdfs:subClassOf rhspin:DPRTableTemplates ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "description"^^xsd:string
] _:b1 [ sp:varName "choke"^^xsd:string
] [ sp:varName "prod"^^xsd:string
]) ;
sp:where ([ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyProductionActivity> ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object _:b3 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject _:b2
] [ sp:object <http://www.reportinghub.no/ep/schema/production-activity#ProductionOperationsActivity> ;
sp:predicate rdf:type ;
sp:subject _:b3
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/production-facility#numberOfOwnCrew> ;
sp:subject
[ sp:varName "act"^^xsd:string
]
])
])
] ;
rhspin:tableHeaders ("Description"^^xsd:string "Oil Net m3"^^xsd:string "Choke %"^^xsd:string "Prod Hours"^^xsd:string) .
_:b2 sp:varName "dailyProductionActivity"^^xsd:string .
_:b1 sp:varName "oilNet"^^xsd:string .
_:b3 sp:varName "productionOperationsActivity"^^xsd:string .
......
# Saved by TopBraid on Wed Oct 12 19:50:38 BST 2011
# baseURI: null
@prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> .
......
<ui:group
let:report="{# SELECT ?report WHERE {?report a ep-report:DailyProductionReport }}"
let:mainAct="{# SELECT ?mainAct WHERE {?report a ep-report:DailyProductionReport . ?report ep-report:reportOn ?mainAct}}"
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}}"
let:opCo="{# SELECT ?opCo WHERE {?report a ep-prodreport:DailyProductionReport . ?report ep-report:reportOn ?mainAct . ?mainFac ep-fac:facilityOperator ?opCo}}"
>
<center>
<h1>{# SELECT ?mfName WHERE {?mainFac rdfs:label ?mfName}}</h1>
<h2>{# SELECT ?ocName WHERE {?opCo rdfs:label ?ocName}}</h2>
<h2>{# SELECT ?docName WHERE {?report rdfs:label ?docName}}</h2>
<h2>Report date: {# SELECT ?docDate WHERE {?report ep-report:dateCoveredByReport ?docDate}}</h2>
<h2>Issue date: {# SELECT ?createDate WHERE {?report ep-report:createdAt ?createDate}}</h2>
</center>
<hr />
<ui:group
let:report="{# SELECT ?report WHERE { ?report a ep-report:ProductionReport . } }"
let:reportedFieldName="{# SELECT ?reportedFieldName
WHERE {
?report a ep-report:ProductionReport .
?report ep-report:reportOn ?partOfFacility .
?partOfFacility ep-core:temporalPartOf ?reportedField .
?reportedField npd:name ?reportedFieldName .
}}"
>
<h1>Daily Production Report : {= ?reportedFieldName } Field {# SELECT ?day WHERE { ?partOfFacility ep-activity:existsThroughout ?day . } }</h1>
<h2>Report title : {# SELECT ?title WHERE { ?report a ep-report:ProductionReport . ?report ep-core:name ?title . } }</h2>
<h2>Submitted by : {# SELECT ?submittingFieldName WHERE
{
?report a ep-report:ProductionReport .
?report ep-report:reportSubmittedFrom ?submittingFieldState .
?submittingFieldState ep-core:temporalPartOf ?submittingField .
?submittingField npd:name ?submittingFieldName .
} }</h2>
<dprswp:Table arg:report="{= ?report }" arg:template="dpr-tables:WellInformation" />
<dprswp:Table arg:report="{= ?report }" arg:template="dpr-tables:PersonnelInformation" />
</ui:group>
\ No newline at end of file
......
......@@ -28,7 +28,7 @@ arg:template
rdfs:label "template"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport>
<http://www.reportinghub.no/ep/schema/report#ProductionReport>
ui:instanceView
[ rdf:type dprswp:DailyProductionReportView ;
arg:report spin:_this
......@@ -47,7 +47,7 @@ dprswp:DailyProductionReportView
[ rdf:type spl:Argument ;
rdfs:comment "The report to display."^^xsd:string ;
spl:predicate arg:report ;
spl:valueType <http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport>
spl:valueType <http://www.reportinghub.no/ep/schema/report#ProductionReport>
] ;
ui:headIncludes
[ rdf:type html:Link ;
......@@ -67,7 +67,7 @@ dprswp:Table
rdfs:comment "The report that serves as root of the template."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:report ;
spl:valueType <http://www.reportinghub.no/ep/schema/production-report#DailyProductionReport>
spl:valueType <http://www.reportinghub.no/ep/schema/report#ProductionReport>
] ;
spin:constraint
[ rdf:type spl:Argument ;
......