Holger Knublauch

Fixed well/bore constraints

Added constraints for licence checking
Removed header (moved to Sources project)
# baseURI: http://www.reportinghub.no/ep/spin/report-constraints
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# 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/np/schema/1.0/npd
# imports: http://www.reportinghub.no/spin/rh
@prefix : <http://www.reportinghub.no/ep/spin/report-constraints#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix ddr: <http://www.reportinghub.no/ep/schema/ddr#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@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/schema/report#DailyDrillingReport>
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b1
] [ sp:object _:b2 ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object _:b3 ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/activity#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
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
] ;
sp:variable _:b4
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyWithName ;
arg:name _:b4
] ;
sp:variable _:b5
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:bound ;
sp:arg1 _:b5
]
] [ rdf:type sp:NotExists ;
sp:elements ([ sp:object _:b3 ;
sp:predicate rhspin:companyHasLicenceForWellBore ;
sp:subject _:b5
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Your company (" ;
sp:arg2 _:b4 ;
sp:arg3 ") does not hold a licence for well bore " ;
sp:arg4 [ rdf:type rhspin:npdName ;
arg:resource _:b3
]
] ;
sp:variable _:b2
])
] .
<http://www.reportinghub.no/ep/spin/report-constraints>
rdf:type owl:Ontology ;
rdfs:comment "Constraints that need to be executed after ep-report:Report generation (without SXML triples)."^^xsd:string ;
owl:imports <http://www.reportinghub.no/spin/rh> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/ddr> ;
owl:versionInfo "0.1.0"^^xsd:string .
_:b2 sp:varName "message"^^xsd:string .
_:b3 sp:varName "wellBore"^^xsd:string .
_:b4 sp:varName "companyName"^^xsd:string .
_:b5 sp:varName "company"^^xsd:string .
......@@ -700,6 +700,40 @@ rhspin:npdName
] ;
spin:returnType xsd:string .
rhspin:npdTripleExists
rdf:type spin:Function ;
rdfs:comment "Checks whether the NPD graph contains a given triple (?arg1, ?arg2, ?arg3)."^^xsd:string ;
rdfs:label "NPD triple exists"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Ask ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object spin:_arg3 ;
sp:predicate spin:_arg2 ;
sp:subject spin:_arg1
]) ;
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The predicate to match."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType rdf:Property
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:returnType xsd:boolean .
rhspin:parentCompanyByName
rdf:type spin:Function ;
rdfs:comment "Gets the URI resource of a parent company based on its NPD name."^^xsd:string ;
......@@ -797,22 +831,11 @@ rhspin:wellBoreByName
[ rdf:type sp:Select ;
sp:resultVariables (_:b32) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:Union ;
sp:elements (([ sp:object _:b33 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b32
]) ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:replaceAll ;
sp:arg1 _:b33 ;
sp:arg2 "/0" ;
sp:arg3 "/"
] ;
sp:variable _:b34
] [ sp:object _:b34 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b32
]))
sp:elements ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b32
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b32
......@@ -854,21 +877,6 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b16
sp:varName "id"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b15
sp:varName "startedAt"^^xsd:string .
_:b34
sp:varName "str"^^xsd:string .
_:b33
sp:varName "wellBoreName"^^xsd:string .
_:b32
sp:varName "wellBore"^^xsd:string .
......@@ -914,6 +922,15 @@ _:b19
_:b18
sp:varName "value"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b16
sp:varName "id"^^xsd:string .
_:b15
sp:varName "startedAt"^^xsd:string .
_:b14
sp:varName "company"^^xsd:string .
......
<ui:group>
<div>&nbsp;</div>
<div class="logoContainer"><a href="http://www.epim.no" target="_new"><img src="lib/rh/images/logoEpim.gif" width="201" height="106" align="right" title="EPIM" /></a>
<div style="padding: 10px">
<h1>ReportingHub</h1>
<div>You are logged in as: <b>{= rhspin:userName() }</b></div>
</div>
</div>
</ui:group>
\ No newline at end of file