David Leal

Made the generation of the MPR report URI more robust.

# Saved by TopBraid on Mon Dec 19 18:49:44 GMT 2011
# baseURI: http://www.reportinghub.no/ep/schema/1.0/production-report
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/np/schema/1.0/npd
......@@ -11,11 +10,11 @@
<http://www.reportinghub.no/ep/schema/1.0/production-report>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/np/schema/1.0/npd> ;
owl:imports <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/ep/schema/1.0/report> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
ep-prodreport:DailyProductVolumeReport
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdfs:label "daily product volume report"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
......@@ -30,7 +29,7 @@ ep-prodreport:FluidSampleReport
rdfs:subClassOf <http://www.reportinghub.no/ep/schema/report#Report> .
ep-prodreport:MonthlyProductVolumeReport
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdfs:label " monthly product volume report"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
......@@ -45,12 +44,12 @@ ep-prodreport:ProductVolumeReport
rdfs:subClassOf ep-prodreport:ProductionReport .
ep-prodreport:ProductVolumeReportForInstant
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdfs:label "product volume report for instant"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
ep-prodreport:ProductVolumeReportMonthToDate
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdfs:label " product volume report month to date"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
......@@ -60,7 +59,7 @@ ep-prodreport:ProductVolumeReportPeriodType
rdfs:subClassOf owl:Class .
ep-prodreport:ProductVolumeReportYearToDate
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdfs:label " product volume report year to date"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
......@@ -79,8 +78,8 @@ ep-prodreport:ReportAliasIdentifier
rdfs:subClassOf owl:Thing ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty ep-prodreport:isAliasFor
owl:minCardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty ep-prodreport:aliasName
] ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
......@@ -89,17 +88,17 @@ ep-prodreport:ReportAliasIdentifier
] ;
rdfs:subClassOf
[ rdf:type owl:Restriction ;
owl:minCardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty ep-prodreport:aliasName
owl:cardinality "1"^^xsd:nonNegativeInteger ;
owl:onProperty ep-prodreport:isAliasFor
] .
ep-prodreport:WeeklyProductVolumeReport
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdfs:label "weekly product volume report"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
ep-prodreport:YearlyProductVolumeReport
rdf:type owl:Class , ep-prodreport:ProductVolumeReportPeriodType ;
rdf:type ep-prodreport:ProductVolumeReportPeriodType , owl:Class ;
rdfs:label "yearly product volume report"^^xsd:string ;
rdfs:subClassOf ep-prodreport:ProductVolumeReport .
......@@ -124,3 +123,8 @@ ep-prodreport:disclaimer
ep-prodreport:isAliasFor
rdf:type owl:ObjectProperty ;
rdfs:range <http://www.reportinghub.no/np/schema/npd#Individual> .
ep-prodreport:issuedAt
rdf:type owl:DatatypeProperty , owl:FunctionalProperty ;
rdfs:domain <http://www.reportinghub.no/ep/schema/report#Report> ;
rdfs:label "issued at"^^xsd:string .
......
......@@ -55,15 +55,37 @@ ep-mpr-spin-lib:Function
rdf:type spin:Function ;
rdfs:subClassOf spin:Functions .
ep-mpr-spin-lib:buildIntervalIdentifier
rdf:type spin:Function ;
rdfs:subClassOf ep-mpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
rdfs:comment """arg1 is the report start date
arg2 is the report end date"""^^xsd:string ;
sp:resultVariables ([ sp:varName "intervalIdentifier"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 spin:_arg1 ;
sp:arg2 "$" ;
sp:arg3 spin:_arg2
] ;
sp:variable
[ sp:varName "intervalIdentifier"^^xsd:string
]
])
] .
ep-mpr-spin-lib:buildProductionReportURI
rdf:type spin:Function ;
rdfs:subClassOf ep-mpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
rdfs:comment """arg1 is the name of the report
arg2 is the report start date
arg3 is the report end date"""^^xsd:string ;
sp:resultVariables (_:b1) ;
rdfs:comment """arg1 is the name of the installation
arg2 is the interval identifier"""^^xsd:string ;
sp:resultVariables ([ sp:varName "uri"^^xsd:string
]) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildURI ;
......@@ -71,12 +93,12 @@ arg3 is the report end date"""^^xsd:string ;
sp:arg2 [ rdf:type fn:concat ;
sp:arg1 spin:_arg1 ;
sp:arg2 "$" ;
sp:arg3 spin:_arg2 ;
sp:arg4 "$" ;
sp:arg5 spin:_arg3
sp:arg3 spin:_arg2
]
] ;
sp:variable _:b1
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] .
......@@ -916,7 +938,7 @@ ep-mpr-spin-lib:selectFluidSamplingType
rdfs:subClassOf ep-mpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b2) ;
sp:resultVariables (_:b1) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -997,7 +1019,7 @@ ep-mpr-spin-lib:selectFluidSamplingType
]
]
] ;
sp:variable _:b2
sp:variable _:b1
])
] .
......@@ -3047,7 +3069,7 @@ ep-mpr-spin-lib:selectProductVolumeReportPeriodType
rdfs:subClassOf ep-mpr-spin-lib:Function ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b3) ;
sp:resultVariables (_:b2) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
......@@ -3191,7 +3213,7 @@ ep-mpr-spin-lib:selectProductVolumeReportPeriodType
]
]
] ;
sp:variable _:b3
sp:variable _:b2
])
] .
......@@ -5598,8 +5620,6 @@ ep-mpr-spin-lib:selectWorkScale
])
] .
_:b3 sp:varName "productVolumeReportPeriodType"^^xsd:string .
_:b2 sp:varName "fluidSamplingType"^^xsd:string .
_:b1 sp:varName "fluidSamplingType"^^xsd:string .
_:b1 sp:varName "uri"^^xsd:string .
_:b2 sp:varName "productVolumeReportPeriodType"^^xsd:string .
......
# Saved by TopBraid on Tue Dec 20 19:26:54 GMT 2011
# baseURI: null
@prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> .
......
# Saved by TopBraid on Thu Dec 15 19:14:36 GMT 2011
# baseURI: http://www.reportinghub.no/test/mpr/TEST_mpr-xml-ingest
# imports: http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-collector
# imports: http://spinrdf.org/spin
# imports: http://www.epim.no/schemas/mprml/1
# imports: http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-collector
# imports: http://www.reportinghub.no/np/data/npd
# imports: http://spinrdf.org/spin
@prefix : <http://www.reportinghub.no/test/mpr/TEST_mpr-xml-ingest#> .
@prefix TRANSFORM_mpr-collector: <http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-collector#> .
......
# Saved by TopBraid on Thu Dec 15 19:14:36 GMT 2011
# baseURI: null
@prefix composite: <http://www.topbraid.org/2007/05/composite.owl#> .
......