Holger Knublauch

Support for editing WDRs

# baseURI: http://www.reportinghub.no/ep/spin/wdr-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/ddr
# imports: http://www.reportinghub.no/spin/rh
@prefix arg: <http://spinrdf.org/arg#> .
@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 wdr-tables: <http://www.reportinghub.no/ep/spin/wdr-tables#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://www.reportinghub.no/ep/spin/wdr-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://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://www.reportinghub.no/ep/schema/1.0/ddr> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "0.1.0"^^xsd:string .
wdr-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) .
......@@ -62,6 +62,11 @@ arg:resource
rdfs:label "resource"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:startDate
rdf:type rdf:Property ;
rdfs:label "start date"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:well
rdf:type rdf:Property ;
rdfs:label "well"^^xsd:string ;
......@@ -122,7 +127,7 @@ npdata:npd
rhspin:DDRTableTemplates
rdf:type rhspin:TableTemplate ;
rdfs:label "DDRTable templates"^^xsd:string ;
rdfs:label "DDR table templates"^^xsd:string ;
rdfs:subClassOf rhspin:TableTemplates ;
spin:abstract "true"^^xsd:boolean ;
spin:constraint
......@@ -254,6 +259,24 @@ rhspin:Test-normalizeWellBoreName-4
] ;
spl:testResult "31/2-L12"^^xsd:string .
rhspin:WDRTableTemplates
rdf:type rhspin:TableTemplate ;
rdfs:label "WDR table 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 arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The start date of the reporting week."^^xsd:string ;
spl:predicate arg:startDate ;
spl:valueType xsd:date
] .
rhspin:baaById
rdf:type spin:Function ;
rdfs:label "baa by id"^^xsd:string ;
......@@ -1403,86 +1426,86 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b31
sp:varName "name"^^xsd:string .
_:b30
sp:varName "id"^^xsd:string .
_:b29
sp:varName "t4"^^xsd:string .
_:b1 sp:varName "subject"^^xsd:string .
_:b28
sp:varName "t3"^^xsd:string .
_:b2 sp:varName "wellBoreName"^^xsd:string .
_:b27
sp:varName "t2"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
_:b26
sp:varName "t1"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b25
sp:varName "t0b"^^xsd:string .
_:b5 sp:varName "wellName"^^xsd:string .
_:b24
sp:varName "t0a"^^xsd:string .
_:b6 sp:varName "well"^^xsd:string .
_:b23
sp:varName "s2"^^xsd:string .
_:b7 sp:varName "company"^^xsd:string .
_:b22
sp:varName "s1"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b21
sp:varName "normalizedStr"^^xsd:string .
_:b9 sp:varName "licence"^^xsd:string .
_:b20
sp:varName "licence"^^xsd:string .
_:b10
sp:varName "share"^^xsd:string .
_:b19
sp:varName "reif"^^xsd:string .
_:b11
sp:varName "wellBore"^^xsd:string .
_:b18
sp:varName "value"^^xsd:string .
_:b12
sp:varName "share"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b13
sp:varName "licence"^^xsd:string .
_:b16
_:b14
sp:varName "company"^^xsd:string .
_:b15
sp:varName "companyName"^^xsd:string .
_:b14
_:b16
sp:varName "company"^^xsd:string .
_:b13
sp:varName "licence"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b12
sp:varName "share"^^xsd:string .
_:b18
sp:varName "value"^^xsd:string .
_:b11
sp:varName "wellBore"^^xsd:string .
_:b19
sp:varName "reif"^^xsd:string .
_:b10
sp:varName "share"^^xsd:string .
_:b20
sp:varName "licence"^^xsd:string .
_:b9 sp:varName "licence"^^xsd:string .
_:b21
sp:varName "normalizedStr"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b22
sp:varName "s1"^^xsd:string .
_:b7 sp:varName "company"^^xsd:string .
_:b23
sp:varName "s2"^^xsd:string .
_:b6 sp:varName "well"^^xsd:string .
_:b24
sp:varName "t0a"^^xsd:string .
_:b5 sp:varName "wellName"^^xsd:string .
_:b25
sp:varName "t0b"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b26
sp:varName "t1"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
_:b27
sp:varName "t2"^^xsd:string .
_:b2 sp:varName "wellBoreName"^^xsd:string .
_:b28
sp:varName "t3"^^xsd:string .
_:b1 sp:varName "subject"^^xsd:string .
_:b29
sp:varName "t4"^^xsd:string .
_:b30
sp:varName "id"^^xsd:string .
_:b31
sp:varName "name"^^xsd:string .
......
# baseURI: http://www.reportinghub.no/swp/wdr
# 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/facility
# 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/wdr-tables
# imports: http://www.reportinghub.no/spin/rh
@prefix arg: <http://spinrdf.org/arg#> .
@prefix ep-well: <http://www.reportinghub.no/ep/schema/well#> .
@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#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spin: <http://spinrdf.org/spin#> .
@prefix spl: <http://spinrdf.org/spl#> .
@prefix ui: <http://uispin.org/ui#> .
@prefix wdrswp: <http://www.reportinghub.no/swp/wdr#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
arg:startDate
rdf:type rdf:Property ;
rdfs:label "startDate"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:template
rdf:type rdf:Property ;
rdfs:label "template"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:wellBore
rdf:type rdf:Property ;
rdfs:label "well bore"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
ui:instanceView
[ rdf:type ui:group ;
let:startDate
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "startDate"^^xsd:string
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "timeStamp"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#startedAt>
] ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type xsd:date ;
sp:arg1 [ sp:varName "timeStamp"^^xsd:string
]
] ;
sp:variable
[ sp:varName "startDate"^^xsd:string
]
])
] ;
let:wellBore
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "wellBore"^^xsd:string
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#onWellBore>
] ;
sp:path2 <http://www.reportinghub.no/ep/schema/core#temporalPartOf>
] ;
sp:subject spin:_this
])
] ;
ui:child
[ rdf:type wdrswp:WeeklyDrillingReportView ;
arg:startDate
[ sp:varName "startDate"^^xsd:string
] ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
] ;
ui:childIndex 0
] ;
ui:priority -1
] .
<http://www.reportinghub.no/swp/wdr>
rdf:type owl:Ontology ;
owl:imports <http://uispin.org/tui> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/ddr> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/spin/wdr-tables> , <http://www.reportinghub.no/spin/rh> ;
owl:versionInfo "0.1.0"^^xsd:string .
wdrswp:Table
rdf:type ui:NodeClass ;
rdfs:comment "An HTML table displaying the results of a given SPIN template for a given WDR. 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 start date of the report."^^xsd:string ;
spl:predicate arg:startDate ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The well bore of the report."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType ep-well:WellBore
] ;
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/WDRTable.uispin.html> .
wdrswp:WeeklyDrillingReportView
rdf:type ui:NodeClass ;
rdfs:label "Weekly drilling report view"^^xsd:string ;
rdfs:subClassOf ui:Element ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The start date of the report to display."^^xsd:string ;
spl:predicate arg:startDate ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The well bore."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType ep-well:WellBore
] ;
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/WeeklyDrillingReport.uispin.html> .
<div>
<hr />
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/wdr-tables&gt;">
<h2>{= ui:label(?template) }</h2>
</ui:setContext>
<table class="ddrTable">
<ui:setContext ui:queryGraph="&lt;http://www.reportinghub.no/ep/spin/wdr-tables&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:startDate="{= ?startDate }" arg:wellBore="{= ?wellBore }">
<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>
<ui:group >
<h1>Weekly Report for Well bore {= ?wellBore } starting at {= ?startDate }</h1>
<hr />
<wdrswp:Table arg:startDate="{= ?startDate }" arg:wellBore="{= ?wellBore }" arg:template="wdr-tables:Test" />
</ui:group>
</ui:group>
\ No newline at end of file