Holger Knublauch

More MPRG support infrastructure

......@@ -1517,6 +1517,62 @@ rhspin:graphForDDR
] ;
spin:returnType rdfs:Resource .
rhspin:graphForFieldWithName
rdf:type spin:Function ;
rdfs:comment "Gets the graph that holds the MPRG triples for a Field with a given name."^^xsd:string ;
rdfs:label "graph for field with name"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:expression
[ rdf:type sp:iri ;
sp:arg1 [ sp:varName "uri"^^xsd:string
]
] ;
sp:varName "result"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "fieldName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
[ sp:varName "field"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/facility#Field> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "field"^^xsd:string
]
] [ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject
[ sp:varName "field"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "https://www.reportinghub.no/ep/graph/field-" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
] ;
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The field name."^^xsd:string ;
spl:predicate arg:fieldName ;
spl:valueType xsd:string
] ;
spin:returnType rdfs:Resource .
rhspin:graphForLicence
rdf:type spin:Function ;
rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given licence."^^xsd:string ;
......@@ -2589,12 +2645,12 @@ _:b13
_:b6 sp:varName "well"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b12
sp:varName "wellBore"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
......
......@@ -24,7 +24,7 @@ report:AbstractDR
rdf:type report:ReportClass ;
rdfs:comment "Abstract base class for various types of daily reports."^^xsd:string ;
rdfs:label "Daily report"^^xsd:string ;
rdfs:subClassOf foaf:Document ;
rdfs:subClassOf report:AbstractReport ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
......@@ -58,7 +58,12 @@ report:AbstractDR
report:AbstractMPR
rdf:type report:ReportClass ;
rdfs:label "Abstract MPR"^^xsd:string ;
rdfs:label "Monthly Production Report"^^xsd:string ;
rdfs:subClassOf report:AbstractReport .
report:AbstractReport
rdf:type owl:Class ;
rdfs:label "Any report"^^xsd:string ;
rdfs:subClassOf foaf:Document .
report:DDR
......@@ -104,7 +109,7 @@ report:MPRD
report:MPRG
rdf:type report:ReportClass ;
rdfs:label "MPRG"^^xsd:string ;
rdfs:label "MPR Gov"^^xsd:string ;
rdfs:subClassOf report:AbstractMPR .
report:MPRP
......@@ -142,10 +147,22 @@ report:ZipFormat
rdf:type report:Format ;
rdfs:label "Zip format"^^xsd:string .
report:fieldName
rdf:type owl:DatatypeProperty ;
rdfs:domain report:AbstractMPR ;
rdfs:label "field name"^^xsd:string ;
rdfs:range xsd:string .
report:format
rdf:type owl:ObjectProperty ;
rdfs:label "format"^^xsd:string .
report:month
rdf:type owl:DatatypeProperty ;
rdfs:domain report:MPRG ;
rdfs:label "month"^^xsd:string ;
rdfs:range xsd:string .
report:owner
rdf:type owl:ObjectProperty ;
rdfs:label "owner"^^xsd:string ;
......
......@@ -18,11 +18,21 @@
rdfs:label "date"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#fieldName>
rdf:type rdf:Property ;
rdfs:label "field name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#id>
rdf:type rdf:Property ;
rdfs:label "id"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#month>
rdf:type rdf:Property ;
rdfs:label "month"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#owner>
rdf:type rdf:Property ;
rdfs:label "owner"^^xsd:string ;
......@@ -220,6 +230,37 @@ reportspin:graphByDPRId
] ;
spin:returnType rdfs:Resource .
reportspin:graphByReportId
rdf:type spin:Function ;
rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report with a given id."^^xsd:string ;
rdfs:label "graph by report id"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:arg1 [ sp:varName "uri"^^xsd:string
]
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "http://www.reportinghub.no/system/report/" ;
sp:arg2 [ sp:varName "id"^^xsd:string
]
] ;
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the DDR metadata."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:valueType xsd:string
] ;
spin:returnType rdfs:Resource .
reportspin:idOfDDRByDateAndWellBoreId
rdf:type spin:Function ;
rdfs:comment "Gets the id of a DDR defined by date and well bore id. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ;
......@@ -266,16 +307,16 @@ reportspin:idOfDDRByDateAndWellBoreId
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the well bore."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellBoreId> ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#date> ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the well bore."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellBoreId> ;
spl:valueType xsd:string
] ;
spin:returnType xsd:string .
reportspin:idOfDPRByDateAndOwner
......@@ -335,3 +376,60 @@ reportspin:idOfDPRByDateAndOwner
spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner>
] ;
spin:returnType xsd:string .
reportspin:idOfMPRGByFieldAndMonth
rdf:type spin:Function ;
rdfs:label "id of MPRG by field and month"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:orderBy ([ rdf:type sp:Desc ;
sp:expression
[ sp:varName "created"^^xsd:string
]
]) ;
sp:resultVariables ([ sp:varName "id"^^xsd:string
]) ;
sp:where ([ sp:object
[ sp:varName "fieldName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/system/schema/reporting#fieldName> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object
[ sp:varName "month"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/system/schema/reporting#month> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object
[ sp:varName "created"^^xsd:string
] ;
sp:predicate <http://purl.org/dc/terms/created> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
] [ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://rdfs.org/sioc/ns#id> ;
sp:subject
[ sp:varName "report"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The field name."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#fieldName> ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The month, e.g. \"2011-04\""^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#month> ;
spl:valueType xsd:string
] ;
spin:returnType xsd:string .
......
......@@ -19,13 +19,23 @@
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
report:AbstractDR
swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type <http://rdfs.org/sioc/ns#id>) ;
ui:instanceView
[ rdf:type report:DRFormBody ;
arg:resource spin:_this ;
ui:id "search"^^xsd:string
] .
report:AbstractMPR
swa:keyProperties (<http://purl.org/dc/terms/created> rdf:type report:fieldName <http://rdfs.org/sioc/ns#id>) ;
ui:instanceView
[ rdf:type report:MPRFormBody ;
arg:resource spin:_this ;
ui:id "search"^^xsd:string
] .
report:AbstractReport
swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type <http://rdfs.org/sioc/ns#id>) .
report:DDR
swa:keyProperties (<http://purl.org/dc/terms/created> <http://purl.org/dc/terms/date> rdf:type report:wellBoreId <http://rdfs.org/sioc/ns#id>) ;
ui:instanceView
......@@ -87,6 +97,54 @@ report:DRFormBody
]
] .
report:MPRFormBody
rdf:type ui:ResourceViewClass ;
rdfs:label "MPR form body"^^xsd:string ;
rdfs:subClassOf swa:FormBody ;
ui:prototype
[ rdf:type html:Div ;
default:subject
[ sp:varName "resource"^^xsd:string
] ;
ui:child
[ rdf:type swa:ColumnLayout ;
arg:colWidths "50%,50%"^^xsd:string ;
arg:width "600px"^^xsd:string ;
ui:child
[ rdf:type swa:Object ;
arg:label "Created"^^xsd:string ;
arg:predicate <http://purl.org/dc/terms/created> ;
ui:childIndex 0
] ;
ui:child
[ rdf:type swa:Object ;
arg:label "Field name"^^xsd:string ;
arg:predicate report:fieldName ;
ui:childIndex 1
] ;
ui:childIndex 0
]
] .
report:MPRG
swa:keyProperties (<http://purl.org/dc/terms/created> rdf:type report:fieldName report:month <http://rdfs.org/sioc/ns#id>) ;
ui:instanceView
[ rdf:type ui:group ;
default:subject spin:_this ;
ui:child
[ rdf:type report:MPRFormBody ;
arg:resource spin:_this ;
ui:childIndex 0
] ;
ui:child
[ rdf:type swa:Object ;
arg:label "Month (yyyy-MM)"^^xsd:string ;
arg:predicate report:month ;
ui:childIndex 1
] ;
ui:id "search"^^xsd:string
] .
<http://www.reportinghub.no/system/swp/reporting>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/system/schema/reporting> , <http://www.reportinghub.no/system/swp/SWP-logging> ;
......