Holger Knublauch

NPD test data working, minor tweak to an error message

......@@ -124,54 +124,52 @@ ddr:Cs_drillReportWellboreInfo
ddr:Obj_drillReport
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b2
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b2
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
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
] [ rdf:type sp:Bind ;
[ 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 ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
arg:wellBoreName
[ sp:varName "wellBoreName"^^xsd:string
]
[ rdf:type rhspin:companyName
] ;
sp:variable
[ sp:varName "wellBore"^^xsd:string
[ sp:varName "companyName"^^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
sp:arg1 [ sp:varName "companyName"^^xsd:string
]
]
]
])
] ;
spin:constraint
[ rdf:type sp:Ask ;
rdfs:comment "DDRs can only be submitted if the logged-in user is from a registered company"^^xsd:string ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
] ;
sp:variable
[ sp:varName "companyName"^^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
[ rdf:type rhspin:companyWithName ;
arg:name
[ sp:varName "companyName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "message"^^xsd:string
[ sp:varName "company"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "company"^^xsd:string
]
]
]
])
] ;
......@@ -179,18 +177,18 @@ ddr:Obj_drillReport
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b3
sp:subject _:b2
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b3
sp:subject _:b2
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b3
sp:subject _:b2
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:predicate rdfs:label ;
sp:subject _:b3
sp:subject _:b2
]) ;
sp:where ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
......@@ -235,7 +233,7 @@ ddr:Obj_drillReport
sp:arg1 "Well bore number " ;
sp:arg2 [ sp:varName "wellBoreNumber"^^xsd:string
] ;
sp:arg3 "mismatches well bore name " ;
sp:arg3 " mismatches well bore name " ;
sp:arg4 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
......@@ -245,52 +243,54 @@ ddr:Obj_drillReport
])
] ;
spin:constraint
[ rdf:type sp:Ask ;
rdfs:comment "DDRs can only be submitted if the logged-in user is from a registered company"^^xsd:string ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b3
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b3
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b3
] [ sp:object
[ sp:varName "message"^^xsd:string
] ;
sp:variable
[ sp:varName "companyName"^^xsd:string
]
sp:predicate rdfs:label ;
sp:subject _:b3
]) ;
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:companyWithName ;
arg:name
[ sp:varName "companyName"^^xsd:string
[ rdf:type rhspin:wellBoreByName ;
arg:wellBoreName
[ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "company"^^xsd:string
[ 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 "company"^^xsd:string
sp:arg1 [ sp:varName "wellBore"^^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 ;
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:companyName
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well bore name " ;
sp:arg2 [ sp:varName "wellBoreName"^^xsd:string
]
] ;
sp:variable
[ sp:varName "companyName"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 [ sp:varName "companyName"^^xsd:string
]
]
[ sp:varName "message"^^xsd:string
]
])
] .
......
......@@ -5,6 +5,7 @@
@prefix ep-well: <http://www.reportinghub.no/ep/schema/well#> .
@prefix npd: <http://www.reportinghub.no/np/schema/npd#> .
@prefix npd-test: <http://www.reportinghub.no/np/data/npd-test#> .
@prefix npdi: <http://www.reportinghub.no/np/data/npd/> .
@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#> .
......@@ -15,55 +16,70 @@
rdfs:comment "These triples will be added to the NPD Fact Pages automatically. They contain additional test companies, well bores etc that allows the developers and admins to upload and download dummy data."^^xsd:string ;
owl:imports <http://www.reportinghub.no/np/schema/1.0/npd> .
npd-test:BA_ERH_TEST
npd-test:ShareOfBAA_1
rdf:type npd:ShareOfBAA ;
npd:baaShared npdi:BAA-2222222222 ;
npd:shareHolder npdi:Company-5555555555 .
npd-test:ShareOfLicence_1
rdf:type npd:ShareOfLicence ;
npd:licenceShared npdi:Licence-3333333333 ;
npd:shareHolder npdi:Company-5555555555 .
npdi:BAA-2222222222
rdf:type npd:BusinessArrangementArea ;
npd:baaOperator npdi:Company-5555555555 ;
npd:id "2222222222"^^xsd:string ;
npd:name "BA_ERH_TEST"^^xsd:string .
npd-test:EPIM
npdi:Company-5555555555
rdf:type npd:OperatingCompany ;
npd:companyShortName
"EPIM"^^xsd:string ;
npd:id "5555555555"^^xsd:string ;
npd:name "EPIM"^^xsd:string .
npd-test:ERH-TEST-WELL-01
npdi:Field-1111111111
rdf:type ep-fac:Field ;
npd:fieldOwner npdi:BAA-2222222222 ;
npd:id "1111111111"^^xsd:string ;
npd:name "ERH_TEST_FIELD_01"^^xsd:string .
npdi:Field-1222222222
rdf:type ep-fac:Field ;
npd:fieldOwner npdi:Licence-3333333333 ;
npd:id "1222222222"^^xsd:string ;
npd:name "ERH_TEST_FIELD_02"^^xsd:string .
npdi:Licence-3333333333
rdf:type npd:Licence ;
npd:id "3333333333"^^xsd:string ;
npd:licenceOperator npdi:Company-5555555555 ;
npd:licenceStatus npd:LS_Active ;
npd:name "PL_ERH_TEST"^^xsd:string .
npdi:Well-ERH-TEST-WELL-01
rdf:type ep-well:Well ;
npd:name "ERH-TEST-WELL-01"^^xsd:string ;
npd:wellPartOfField npd-test:ERH_TEST_FIELD_01 .
npd:wellPartOfField npdi:Field-1111111111 .
npd-test:ERH-TEST-WELL-02
npdi:Well-ERH-TEST-WELL-02
rdf:type ep-well:Well ;
npd:name "ERH-TEST-WELL-02"^^xsd:string ;
npd:wellPartOfField npd-test:ERH_TEST_FIELD_02 .
npd:wellPartOfField npdi:Field-1222222222 .
npd-test:ERH-TEST-WELLBORE-01
npdi:WellBore-4111111111
rdf:type ep-well:WellBore ;
npd:drilledInProductionLicence
npdi:Licence-3333333333 ;
npd:id "4111111111"^^xsd:string ;
npd:name "ERH-TEST-WELLBORE-01"^^xsd:string ;
npd:partOfWell npd-test:ERH-TEST-WELL-01 ;
npd:partOfWell npdi:Well-ERH-TEST-WELL-01 ;
npd:wellBoreType "DEVELOPMENT"^^xsd:string .
npd-test:ERH-TEST-WELLBORE-02
npdi:WellBore-4222222222
rdf:type ep-well:WellBore ;
npd:id "4222222222"^^xsd:string ;
npd:name "ERH-TEST-WELLBORE-02"^^xsd:string ;
npd:partOfWell npd-test:ERH-TEST-WELL-02 ;
npd:partOfWell npdi:Well-ERH-TEST-WELL-02 ;
npd:wellBoreType "DEVELOPMENT"^^xsd:string .
npd-test:ERH_TEST_FIELD_01
rdf:type ep-fac:Field ;
npd:fieldOwner npd-test:BA_ERH_TEST ;
npd:id "1111111111"^^xsd:string ;
npd:name "ERH_TEST_FIELD_01"^^xsd:string .
npd-test:ERH_TEST_FIELD_02
rdf:type ep-fac:Field ;
npd:fieldOwner npd-test:PL_ERH_TEST ;
npd:id "1222222222"^^xsd:string ;
npd:name "ERH_TEST_FIELD_02"^^xsd:string .
npd-test:PL_ERH_TEST
rdf:type npd:Licence ;
npd:id "3333333333"^^xsd:string ;
npd:name "PL_ERH_TEST"^^xsd:string .
......