Holger Knublauch

NPD naming constraints now working

......@@ -11,40 +11,114 @@
# imports: http://www.reportinghub.no/np/schema/1.0/npd
@prefix : <http://www.reportinghub.no/ep/spin/ddr-constraints#> .
@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/ddr#Obj_drillReport>
ddr:Obj_drillReport
spin:constraint
[ rdf:type sp:Ask ;
rdfs:comment "Unregistered well bore name"^^xsd:string ;
sp:where ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/ddr#nameWellbore> ;
[ 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:nameWell ;
sp:predicate spin:violationPath ;
sp:subject _:b1
] [ sp:object _:b2 ;
sp:predicate rdfs:label ;
sp:subject _:b1
]) ;
sp:where ([ sp:object _:b3 ;
sp:predicate ddr:nameWell ;
sp:subject spin:_this
] [ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:NotExists ;
sp:elements ([ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/npd/schema#name> ;
sp:subject _:b2
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:elements ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellByName ;
sp:arg1 _:b3
] ;
sp:variable _:b4
] [ sp:object <http://www.reportinghub.no/ep/schema/well#Well> ;
sp:predicate rdf:type ;
sp:subject _:b2
sp:subject _:b4
])
]) ;
sp:graphNameNode <https://www.reportinghub.no/ep/data/npd>
sp:graphNameNode <http://www.reportinghub.no/np/data/npd>
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well name " ;
sp:arg2 _:b3
] ;
sp:variable _:b2
])
] ;
spin:constraint
[ rdf:type sp:Construct ;
sp:templates ([ sp:object spin:ConstraintViolation ;
sp:predicate rdf:type ;
sp:subject _:b5
] [ sp:object spin:_this ;
sp:predicate spin:violationRoot ;
sp:subject _:b5
] [ sp:object ddr:nameWellbore ;
sp:predicate spin:violationPath ;
sp:subject _:b5
] [ sp:object _:b6 ;
sp:predicate rdfs:label ;
sp:subject _:b5
]) ;
sp:where ([ sp:object _:b7 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
sp:arg1 _:b7
] ;
sp:variable _:b8
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:not ;
sp:arg1 [ rdf:type sp:bound ;
sp:arg1 _:b8
]
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "Unregistered well bore name " ;
sp:arg2 _:b7
] ;
sp:variable _:b6
])
] .
<http://www.reportinghub.no/ep/spin/ddr-constraints>
rdf:type owl:Ontology ;
rdfs:comment "Constraints that need to be executed immediately after SXML import, i.e. not on the inferred triples."^^xsd:string ;
owl:imports <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/ddr> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://spinrdf.org/spin> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
owl:versionInfo "0.1.0"^^xsd:string .
_:b2 sp:varName "message"^^xsd:string .
_:b4 sp:varName "well"^^xsd:string .
_:b3 sp:varName "nameWell"^^xsd:string .
_:b6 sp:varName "message"^^xsd:string .
_:b1 sp:varName "nameWellbore"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b2 sp:varName "wellBore"^^xsd:string .
_:b7 sp:varName "nameWellbore"^^xsd:string .
......