Holger Knublauch

SPIN templates for DDR tables

# baseURI: http://www.reportinghub.no/ep/spin/ddr-tables-v1.0
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/ddr
# imports: http://www.reportinghub.no/spin/rh
@prefix ddr-tables: <http://www.reportinghub.no/ep/spin/ddr-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#> .
ddr-tables:Operations
rdf:type rhspin:TableTemplate ;
rdfs:label "Operations"^^xsd:string ;
rdfs:subClassOf rhspin:DDRTableTemplates ;
spin:body
[ rdf:type sp:Select ;
sp:orderBy (_:b1) ;
sp:resultVariables (_:b1 _:b2 [ sp:varName "startDepth"^^xsd:string
] [ sp:varName "endDepth"^^xsd:string
] [ sp:varName "activity"^^xsd:string
] [ sp:varName "state"^^xsd:string
] [ sp:varName "remark"^^xsd:string
]) ;
sp:where ([ sp:object _:b3 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#reportOn> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object _:b4 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject _:b3
] [ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/ddr#dTimStart> ;
sp:subject _:b4
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/ddr#dTimEnd> ;
sp:subject _:b4
])
] ;
rhspin:tableHeaders ("Start Time"^^xsd:string "End Time"^^xsd:string "Start Depth mMD"^^xsd:string "End Depth mMD"^^xsd:string "Depth mMD"^^xsd:string "Main - Sub Activity"^^xsd:string "State"^^xsd:string "Remark"^^xsd:string) .
<http://www.reportinghub.no/ep/spin/ddr-tables-v1.0>
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/ddr> , <http://www.reportinghub.no/spin/rh> , <http://spinrdf.org/spin> ;
owl:versionInfo "0.1.0"^^xsd:string .
_:b2 sp:varName "endTime"^^xsd:string .
_:b1 sp:varName "startTime"^^xsd:string .
_:b4 sp:varName "part"^^xsd:string .
_:b3 sp:varName "reportOn"^^xsd:string .
# baseURI: null
@prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> .
@prefix forms: <http://www.topbraid.org/2007/01/forms.owl#> .
@prefix inference: <http://www.topbraid.org/2007/06/inference.owl#> .
@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 visual: <http://topbraid.org/visual#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
[] rdf:type inference:Configuration ;
composite:child
[ rdf:type <http://spinrdf.org/spin#TopSPIN> ;
composite:index "0"^^xsd:int
] .
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
......@@ -5,7 +5,7 @@
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/facility
# imports: http://www.reportinghub.no/ep/schema/1.0/organization
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/np/schema/1.0/npd
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
......@@ -35,6 +35,11 @@
rdfs:label "name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#report>
rdf:type rdf:Property ;
rdfs:label "report"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#resource>
rdf:type rdf:Property ;
rdfs:label "resource"^^xsd:string ;
......@@ -62,9 +67,21 @@ npdata:npd
<http://www.reportinghub.no/spin/rh>
rdf:type owl:Ontology ;
rdfs:comment "A collection of SPIN functions and templates to support working with the ReportingHub schemas."^^xsd:string ;
owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://topbraid.org/spin/spinmapl> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.linkedmodel.org/schema/dtype> ;
owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://topbraid.org/spin/spinmapl> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.linkedmodel.org/schema/dtype> ;
owl:versionInfo "0.1.0"^^xsd:string .
rhspin:DDRTableTemplates
rdf:type rhspin:TableTemplate ;
rdfs:label "DDRTable templates"^^xsd:string ;
rdfs:subClassOf rhspin:TableTemplates ;
spin:abstract "true"^^xsd:boolean ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR that serves as root of the query."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#report> ;
spl:valueType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
] .
rhspin:GetWellBoresOfWell
rdf:type spin:SelectTemplate ;
rdfs:comment "Gets an ordered list of well bores that belong to a given Well. Result variables are ?wellBoreId and ?wellBoreName."^^xsd:string ;
......@@ -97,6 +114,18 @@ rhspin:GetWellBoresOfWell
spl:valueType <http://www.reportinghub.no/ep/schema/well#Well>
] .
rhspin:TableTemplate
rdf:type rdfs:Class ;
rdfs:comment "A spin:Template for SELECT queries that are meant to be displayed as a table. The added feature compared to normal templates is the ability to specify headers for the result variables."^^xsd:string ;
rdfs:label "Table template"^^xsd:string ;
rdfs:subClassOf spin:SelectTemplate .
rhspin:TableTemplates
rdf:type rhspin:TableTemplate ;
rdfs:label "Table templates"^^xsd:string ;
rdfs:subClassOf spin:SelectTemplates ;
spin:abstract "true"^^xsd:boolean .
rhspin:baaById
rdf:type spin:Function ;
rdfs:label "baa by id"^^xsd:string ;
......@@ -243,15 +272,15 @@ rhspin:dtypeValue
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The predicate that points to the reified value."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType rdf:Property
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject of the value."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The predicate that points to the reified value."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType rdf:Property
] .
rhspin:facilityById
......@@ -483,6 +512,13 @@ rhspin:parentCompanyByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#WellBore> .
rhspin:tableHeaders
rdf:type owl:ObjectProperty ;
rdfs:comment "Points to an rdf:List of xsd:string literals, one for each result column of the associated template."^^xsd:string ;
rdfs:domain rhspin:TableTemplate ;
rdfs:label "table headers"^^xsd:string ;
rdfs:range rdf:List .
rhspin:tufById
rdf:type spin:Function ;
rdfs:label "tuf by id"^^xsd:string ;
......@@ -604,18 +640,6 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b10
sp:varName "value"^^xsd:string .
_:b11
sp:varName "reif"^^xsd:string .
_:b21
sp:varName "id"^^xsd:string .
_:b22
sp:varName "name"^^xsd:string .
_:b25
sp:varName "str"^^xsd:string .
......@@ -625,6 +649,12 @@ _:b24
_:b23
sp:varName "wellBore"^^xsd:string .
_:b22
sp:varName "name"^^xsd:string .
_:b21
sp:varName "id"^^xsd:string .
_:b20
sp:varName "t4"^^xsd:string .
......@@ -652,6 +682,12 @@ _:b13
_:b12
sp:varName "normalizedStr"^^xsd:string .
_:b11
sp:varName "reif"^^xsd:string .
_:b10
sp:varName "value"^^xsd:string .
_:b9 sp:varName "endDate"^^xsd:string .
_:b8 sp:varName "startDate"^^xsd:string .
......
<div>
<hr />
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/ddr-tables-v1.0&gt;">
<h2>{= ui:label(?template) }</h2>
</ui:setContext>
<table class="ddrTable">
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/ddr-tables-v1.0&gt;">
<tr class="ddrTR">
<ui:forEach ui:resultSet="{#
SELECT ?header
WHERE {
?template rhspin:tableHeaders ?list .
?list &lt;http://jena.hpl.hp.com/ARQ/list#member&gt; ?header .
}
}">
<th class="ddrTH">{= ?header }</th>
</ui:forEach>
</tr>
</ui:setContext>
<ui:call ui:template="{= ?template }" arg:report="{= ?report }">
<ui:forEach ui:resultSet="{# SELECT ?row ?rowIndex WHERE { ?rs spr:rowIndices ?rowIndex } }">
<tr class="ddrTR">
<ui:forEach ui:resultSet="{# SELECT ?cell WHERE { (?rs ?rowIndex) spr:rowCells (?cell ?cellIndex) } }">
<td class="ddrTD">{= ui:label(?cell) }</td>
</ui:forEach>
</tr>
</ui:forEach>
</ui:call>
</table>
<br />
</div>
\ No newline at end of file
<ui:group let:activity="{= spl:object(?this, ep-activity:reportOn) }"
let:onWellBore="{# SELECT ?onWellBore WHERE { ?this ep-activity:reportOn/ep-activity:onWellBore ?onWellBore } }"
let:report="{= ?this }">
<ui:group
let:activity="{= spl:object(?report, ep-activity:reportOn) }"
let:onWellBore="{# SELECT ?onWellBore WHERE { ?this ep-activity:reportOn/ep-activity:onWellBore ?onWellBore } }">
<ui:group let:wellBore="{= spl:object(?onWellBore, ep-core:temporalPartOf) }">
<h1>Summary report Wellbore: {= rhspin:npdName(?wellBore) }</h1>
<div>End time: {= ui:label(spl:object(?activity, ep-activity:finishedAt)) }</div>
......@@ -9,7 +9,7 @@
<td class="ddrSummaryLeft">
<rhswp:NameValuePair arg:name="Report Number:" arg:value="{ spl:object(?this, ?) }" />
<rhswp:NameValuePair arg:name="Wellbore:" arg:value="{= rhspin:npdName(?wellBore) }" />
<rhswp:NameValuePair arg:name="Status:" arg:value="{= ui:label(spl:object(?this, rdf:type)) }" />
<rhswp:NameValuePair arg:name="Status:" arg:value="{= ui:label(spl:object(?report, rdf:type)) }" />
<rhswp:NameValuePair arg:name="Operator:" arg:value="{ spl:object(?this, ???) }" />
<rhswp:NameValuePair arg:name="Rig name:" arg:value="{ spl:object(?this, ???) }" />
<rhswp:NameValuePair arg:name="Spud date:" arg:value="{ spl:object(?this, ???) }" />
......@@ -19,7 +19,7 @@
<rhswp:NameValuePair arg:name="Fixed rig:" arg:value="{ spl:object(?this, ???) }" />
<rhswp:NameValuePair arg:name="Depth at Kick Off mMD:" arg:value="{= rhspin:dtypeValue(?onWellBore, ddr:mdKickoff) }" />
<rhswp:NameValuePair arg:name="Plug Back Depth mMD:" arg:value="{= rhspin:dtypeValue(?onWellBore, ddr:mdPlugTop) }" />
<rhswp:NameValuePair arg:name="Penetration Rate m/h:" arg:value="{= spl:object(?activity, ddr:ropCurrent) }" />
<rhswp:NameValuePair arg:name="Penetration Rate m/h:" arg:value="{= rhspin:dtypeValue(?activity, ddr:ropCurrent) }" />
<rhswp:NameValuePair arg:name="Pressure Test Type:" arg:value="{# SELECT ui:label(?pressureTestType) WHERE { ?activity ep-core:hasPart/rdf:type ?pressureTestType . ?pressureTestType a ep-activity:PressureTestType} }" />
<rhswp:NameValuePair arg:name="Depth At Formation Strength mMD:" arg:value="{= rhspin:dtypeValue(?activity, ddr:mdStrengthForm) }" />
<rhswp:NameValuePair arg:name="Dia Last Casing In:" arg:value="{ spl:object(?this, ???) }" />
......@@ -28,7 +28,7 @@
<td class="ddrSummaryRight">
<rhswp:NameValuePair arg:name="Period:" arg:value="{= fn:concat(ui:label(spl:object(?activity, ep-activity:startedAt)), ' - ', ui:label(spl:object(?activity, ep-activity:finishedAt))) }" />
<rhswp:NameValuePair arg:name="Wellbore Id:" arg:value="{= rhspin:npdId(?wellBore) }" />
<rhswp:NameValuePair arg:name="Created date:" arg:value="{= ui:label(spl:object(?this, ep-activity:createdAt)) }" />
<rhswp:NameValuePair arg:name="Created date:" arg:value="{= ui:label(spl:object(?report, ep-activity:createdAt)) }" />
<rhswp:NameValuePair arg:name="Drilling contractor:" arg:value="{ spl:object(?this, ???) }" />
<rhswp:NameValuePair arg:name="NPD Rig Id:" arg:value="{ spl:object(?this, ???) }" />
<rhswp:NameValuePair arg:name="Date Well Complete:" arg:value="{ spl:object(?this, ???) }" />
......@@ -45,5 +45,8 @@
<rhswp:NameValuePair arg:name="Depth At Last Casing mMD:" arg:value="{= rhspin:dtypeValue(?onWellBore, ddr:mdCsgLast) }" />
</td>
</tr></table>
<ddrswp:Table arg:report="{= ?report }" arg:template="ddr-tables:Operations" />
</ui:group>
</ui:group>
......
# Saved by TopBraid on Thu Aug 11 15:40:02 BST 2011
# baseURI: http://www.reportinghub.no/swp/ddr
# imports: http://www.reportinghub.no/ep/schema/1.0/organization
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://uispin.org/tui
# 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/ddr
# imports: http://www.reportinghub.no/ep/schema/1.0/equipment
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://www.reportinghub.no/ep/schema/1.0/facility
# imports: http://www.reportinghub.no/ep/schema/1.0/ddr
# imports: http://uispin.org/tui
# imports: http://www.reportinghub.no/ep/schema/1.0/organization
# 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/ddr-tables-v1.0
# imports: http://www.reportinghub.no/spin/rh
@prefix : <http://www.reportinghub.no/swp/ddr#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix ddrswp: <http://www.reportinghub.no/swp/ddr#> .
@prefix html: <http://uispin.org/html#> .
@prefix let: <http://uispin.org/let#> .
@prefix letrs: <http://uispin.org/letrs#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
......@@ -23,10 +26,61 @@
@prefix ui: <http://uispin.org/ui#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
arg:report
rdf:type rdf:Property ;
rdfs:label "report"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:template
rdf:type rdf:Property ;
rdfs:label "template"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
ui:instanceView <http://www.reportinghub.no/swp/DailyDrillingReport.uispin.html> .
ui:instanceView
[ rdf:type ddrswp:DailyDrillingReportView ;
arg:report spin:_this
] .
<http://www.reportinghub.no/swp/ddr>
rdf:type owl:Ontology ;
owl:imports <http://uispin.org/tui> , <http://www.reportinghub.no/ep/schema/1.0/ddr> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
owl:imports <http://uispin.org/tui> , <http://www.reportinghub.no/ep/schema/1.0/ddr> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/spin/ddr-tables-v1.0> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "0.1.0"^^xsd:string .
ddrswp:DailyDrillingReportView
rdf:type ui:NodeClass ;
rdfs:label "Daily drilling report view"^^xsd:string ;
rdfs:subClassOf ui:Element ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The report to display."^^xsd:string ;
spl:predicate arg:report ;
spl:valueType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
] ;
ui:headIncludes
[ rdf:type html:Link ;
html:href "http://spinrdf.org/rhlib/ddr.css"^^xsd:string ;
html:rel "stylesheet"^^xsd:string ;
html:type "text/css"^^xsd:string
] ;
ui:prototype <http://www.reportinghub.no/swp/DailyDrillingReport.uispin.html> .
ddrswp:Table
rdf:type ui:NodeClass ;
rdfs:comment "An HTML table displaying the results of a given SPIN template for a given DDR. The template should also provide rhspin:tableHeaders."^^xsd:string ;
rdfs:label "Table"^^xsd:string ;
rdfs:subClassOf ui:Element ;
spin:constraint
[ rdf:type spl:Argument ;
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/report#DailyDrillingReport>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The SPIN Template to execute."^^xsd:string ;
spl:predicate arg:template ;
spl:valueType spin:Template
] ;
ui:prototype <http://www.reportinghub.no/swp/DDRTable.uispin.html> .
......