Holger Knublauch

Added constraint to compare well bore number with name

......@@ -27,6 +27,58 @@
ddr:Obj_drillReport
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 ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b1
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
arg:wellBoreName
[ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
]
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well bore name " ;
sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
]
])
] ;
spin:constraint
[ rdf:type sp:Ask ;
rdfs:comment "DDRs can only be submitted if a user is logged in"^^xsd:string ;
sp:where ([ rdf:type sp:Bind ;
......@@ -50,24 +102,29 @@ ddr:Obj_drillReport
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b1
sp:subject _:b2
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b1
sp:subject _:b2
]) ;
sp:where ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/spin/lib#nameWellbore> ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "wellBoreNumber"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/spin/lib#numberWellbore> ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
......@@ -78,19 +135,31 @@ ddr:Obj_drillReport
sp:variable
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreById ;
arg:id [ sp:varName "wellBoreNumber"^^xsd:string
]
] ;
sp:variable
[ sp:varName "wellBore2"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
]
[ rdf:type sp:ne ;
sp:arg1 [ sp:varName "wellBore"^^xsd:string
] ;
sp:arg2 [ sp:varName "wellBore2"^^xsd:string
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well bore name " ;
sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
sp:arg1 "Well bore number " ;
sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string
] ;
sp:arg3 "mismatches well bore name " ;
sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
......
This diff could not be displayed because it is too large.
......@@ -8,6 +8,7 @@
# imports: 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
# imports: http://www.reportinghub.no/system/schema/reporting
@prefix afn: <http://jena.hpl.hp.com/ARQ/function#> .
@prefix arg: <http://spinrdf.org/arg#> .
......@@ -64,6 +65,11 @@ arg:report
rdfs:label "report"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:reportType
rdf:type rdf:Property ;
rdfs:label "report type"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:resource
rdf:type rdf:Property ;
rdfs:label "resource"^^xsd:string ;
......@@ -121,15 +127,15 @@ arg:wellName
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The property that must be used in the result resource."^^xsd:string ;
spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ;
spl:valueType rdf:Property
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
] ;
spin:returnType rdfs:Resource .
npdata:npd
......@@ -139,7 +145,7 @@ 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://topbraid.org/spin/spinmapl> , <http://www.linkedmodel.org/schema/dtype> , <http://www.reportinghub.no/ep/schema/1.0/core> , <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/production-report> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/np/schema/1.0/npd> ;
owl:imports <http://spinrdf.org/spin> , <http://topbraid.org/spin/spinmapl> , <http://www.linkedmodel.org/schema/dtype> , <http://www.reportinghub.no/ep/schema/1.0/core> , <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/production-report> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/system/schema/reporting> ;
owl:versionInfo "0.1.1"^^xsd:string .
rhspin:DDRTableTemplates
......@@ -423,15 +429,15 @@ rhspin:WDRTableTemplates
spin:abstract "true"^^xsd:boolean ;
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
] ;
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
......@@ -934,16 +940,16 @@ rhspin:ddrOfWeek
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The first day of the week."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The well bore that the DDR must be about."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The first day of the week."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType xsd:date
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> .
rhspin:ddrWellBoreId
......@@ -1030,15 +1036,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
......@@ -1681,17 +1687,17 @@ rhspin:npdIndividualById
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id to match."^^xsd:string ;
spl:predicate arg:id ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The rdf:type that the result must have."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:type ;
spl:valueType rdfs:Class
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id to match."^^xsd:string ;
spl:predicate arg:id ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Individual> .
rhspin:npdIndividualByName
......@@ -1756,17 +1762,17 @@ rhspin:npdIndividualByName
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD name to match."^^xsd:string ;
spl:predicate arg:name ;
spl:valueType xsd:string
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The rdf:type that the result must have."^^xsd:string ;
spl:optional "true"^^xsd:boolean ;
spl:predicate arg:type ;
spl:valueType rdfs:Class
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD name to match."^^xsd:string ;
spl:predicate arg:name ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Individual> .
rhspin:npdName
......@@ -1812,8 +1818,9 @@ rhspin:npdTripleExists
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:constraint
[ rdf:type spl:Argument ;
......@@ -1823,9 +1830,8 @@ rhspin:npdTripleExists
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
] ;
spin:returnType xsd:boolean .
......@@ -1930,11 +1936,30 @@ rhspin:tufById
spl:valueType xsd:string
] .
rhspin:userCanDownload
rdf:type spin:Function ;
rdfs:comment "Checks whether the current user has the privilege to download reports of a given type. This is used to control which parts of the UI are visible, depending on who is logged in. The implementation of this function is Java only."^^xsd:string ;
rdfs:label "user can download"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The type of report to check, e.g. REPORT.DDR, REPORT.DPR, REPORT.NPTR, REPORT.WDR."^^xsd:string ;
spl:predicate arg:reportType ;
spl:valueType rdfs:Class
] ;
spin:returnType xsd:boolean .
rhspin:userCanUpload
rdf:type spin:Function ;
rdfs:comment "Checks whether the current user has the privilege to upload reports. This is used to control which parts of the UI are visible, depending on who is logged in. The implementation of this function is Java only."^^xsd:string ;
rdfs:comment "Checks whether the current user has the privilege to upload reports of a given type. This is used to control which parts of the UI are visible, depending on who is logged in. The implementation of this function is Java only."^^xsd:string ;
rdfs:label "user can upload"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The type of report to check, e.g. REPORT.DDR, REPORT.DPR."^^xsd:string ;
spl:predicate arg:reportType ;
spl:valueType rdfs:Class
] ;
spin:returnType xsd:boolean .
rhspin:userIsAppAdmin
......@@ -2053,71 +2078,71 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b1 sp:varName "subject"^^xsd:string .
_:b2 sp:varName "wellBoreName"^^xsd:string .
_:b26
sp:varName "name"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
_:b25
sp:varName "id"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b24
sp:varName "t4"^^xsd:string .
_:b5 sp:varName "wellName"^^xsd:string .
_:b23
sp:varName "t3"^^xsd:string .
_:b6 sp:varName "well"^^xsd:string .
_:b22
sp:varName "t2"^^xsd:string .
_:b7 sp:varName "company"^^xsd:string .
_:b21
sp:varName "t1"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b20
sp:varName "t0b"^^xsd:string .
_:b9 sp:varName "company"^^xsd:string .
_:b19
sp:varName "t0a"^^xsd:string .
_:b10
sp:varName "companyName"^^xsd:string .
_:b18
sp:varName "s2"^^xsd:string .
_:b11
sp:varName "company"^^xsd:string .
_:b17
sp:varName "s1"^^xsd:string .
_:b12
sp:varName "wellBore"^^xsd:string .
_:b16
sp:varName "normalizedStr"^^xsd:string .
_:b13
sp:varName "value"^^xsd:string .
_:b15
sp:varName "licence"^^xsd:string .
_:b14
sp:varName "reif"^^xsd:string .
_:b15
sp:varName "licence"^^xsd:string .
_:b13
sp:varName "value"^^xsd:string .
_:b16
sp:varName "normalizedStr"^^xsd:string .
_:b12
sp:varName "wellBore"^^xsd:string .
_:b17
sp:varName "s1"^^xsd:string .
_:b11
sp:varName "company"^^xsd:string .
_:b18
sp:varName "s2"^^xsd:string .
_:b10
sp:varName "companyName"^^xsd:string .
_:b19
sp:varName "t0a"^^xsd:string .
_:b9 sp:varName "company"^^xsd:string .
_:b20
sp:varName "t0b"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b21
sp:varName "t1"^^xsd:string .
_:b7 sp:varName "company"^^xsd:string .
_:b22
sp:varName "t2"^^xsd:string .
_:b6 sp:varName "well"^^xsd:string .
_:b23
sp:varName "t3"^^xsd:string .
_:b5 sp:varName "wellName"^^xsd:string .
_:b24
sp:varName "t4"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b25
sp:varName "id"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
_:b26
sp:varName "name"^^xsd:string .
_:b2 sp:varName "wellBoreName"^^xsd:string .
_:b1 sp:varName "subject"^^xsd:string .
......