Toggle navigation
Toggle navigation
This project
Loading...
Sign in
data.posccaesar.org
/
npd
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
1
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Authored by
Holger Knublauch
2012-07-14 11:50:19 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
25261e3d4969d27c66468d8e6b787ae272550b2e
25261e3d
1 parent
4be2748a
Added license checking for well bores and references fields
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
489 additions
and
566 deletions
www.reportinghub.no/ep/spin/SPIN_MPR-proxy-constraints.spin.ttl
www.reportinghub.no/ep/spin/SPIN_MPR-proxy-constraints.spin.ttl
View file @
25261e3
...
...
@@ -3,569 +3,492 @@
# imports: http://www.epim.no/schemas/mprml/1
# imports: http://www.reportinghub.no/spin/rh
# c14n-version: 3
@prefix
afn:
<http://jena.hpl.hp.com/ARQ/function#>
.
@prefix
arg:
<http://spinrdf.org/arg#>
.
@prefix
fn:
<http://www.w3.org/2005/xpath-functions#>
.
@prefix
mpr-proxy-constraints:
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints#>
.
@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
spif:
<http://spinrdf.org/spif#>
.
@prefix
spin:
<http://spinrdf.org/spin#>
.
@prefix
spl:
<http://spinrdf.org/spl#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
arg:
kindRef
rdf:
type
rdf:
Property
;
rdfs:
label
"kind ref"
^^
xsd:
string
;
rdfs:
subPropertyOf
sp:
arg
;
.
<http://www.epim.no/schemas/mprml/1#FacilityIdentifierStruct>
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_field>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_platform>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_terminal>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
arg:
type
<http://www.reportinghub.no/ep/schema/well#WellBore>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_field>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_platform>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Platform>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_terminal>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
arg:
type
<http://www.reportinghub.no/ep/schema/well#WellBore>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_field>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_platform>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_terminal>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
;
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
arg:
type
<http://www.reportinghub.no/ep/schema/well#WellBore>
;
]
;
.
<http://www.epim.no/schemas/mprml/1#Obj_productVolume>
spin:
constraint
[
rdf:
type
sp:
Construct
;
sp:
templates
(
[
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b3901
;
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b3901
;
]
)
;
sp:
where
(
[
rdf:
type
sp:
TriplePath
;
sp:
object
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
sp:
path
[
rdf:
type
sp:
SeqPath
;
sp:
path1
<http://www.epim.no/schemas/mprml/1#nameRef>
;
sp:
path2
<http://www.linkedmodel.org/schema/dtype#value>
;
]
;
sp:
subject
spin:
_this
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualByName
;
arg:
name
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
;
]
;
sp:
variable
[
sp:
varName
"field"
^^
xsd:
string
;
]
;
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"field"
^^
xsd:
string
;
]
;
]
;
]
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"Invalid Field name "
;
sp:
arg2
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
]
)
;
]
;
.
<http://www.epim.no/schemas/mprml/1#Obj_report>
spin:
constraint
[
rdf:
type
sp:
Construct
;
sp:
templates
(
[
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b384
;
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b384
;
]
)
;
sp:
where
(
[
sp:
object
[
sp:
varName
"installation"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#installationRef>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
<http://www.epim.no/schemas/mprml/1#RF_field>
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
[
sp:
varName
"installation"
^^
xsd:
string
;
]
;
]
[
sp:
object
[
sp:
varName
"fieldName"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
sp:
subject
[
sp:
varName
"installation"
^^
xsd:
string
;
]
;
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
rhspin:
currentUserIsOperatorOfFieldWithName
;
arg:
fieldName
[
sp:
varName
"fieldName"
^^
xsd:
string
;
]
;
]
;
]
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"Your company is not the operator of field with name "
;
sp:
arg2
[
sp:
varName
"fieldName"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
]
)
;
]
;
.
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints>
rdf:
type
owl:
Ontology
;
rdfs:
comment
"Collection of constraints that are executed on the SXML proxy ontology for MPR schema based reports."
^^
xsd:
string
;
owl:
imports
<http://spinrdf.org/spin>
;
owl:
imports
<http://www.epim.no/schemas/mprml/1>
;
owl:
imports
<http://www.reportinghub.no/spin/rh>
;
owl:
versionInfo
"0.1.0"
^^
xsd:
string
;
.
mpr-proxy-constraints:
CheckId
rdf:
type
spin:
ConstructTemplate
;
spin:
body
[
rdf:
type
sp:
Construct
;
sp:
templates
(
[
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b63838
;
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b63838
;
]
)
;
sp:
where
(
[
sp:
object
[
sp:
varName
"kindRef"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
"NPD"
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#namingSystem>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
[
sp:
varName
"id"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#uidRefValue>
;
sp:
subject
spin:
_this
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualById
;
arg:
id
[
sp:
varName
"id"
^^
xsd:
string
;
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"npd"
^^
xsd:
string
;
]
;
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"npd"
^^
xsd:
string
;
]
;
]
;
]
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"[RH-19] Invalid "
;
sp:
arg2
[
rdf:
type
afn:
localname
;
sp:
arg1
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
sp:
arg3
" id "
;
sp:
arg4
[
sp:
varName
"id"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
]
)
;
]
;
spin:
labelTemplate
"Must be NPD id of {?type}/{?kindRef}"
^^
xsd:
string
;
rdfs:
label
"Check id"
^^
xsd:
string
;
rdfs:
subClassOf
mpr-proxy-constraints:
ConstraintTemplates
;
.
mpr-proxy-constraints:
CheckIdAndNameMatch
rdf:
type
spin:
ConstructTemplate
;
spin:
body
[
rdf:
type
sp:
Construct
;
sp:
templates
(
[
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b30672
;
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b30672
;
]
)
;
sp:
where
(
[
sp:
object
[
sp:
varName
"kindRef"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
"NPD"
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#namingSystem>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
[
sp:
varName
"id"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#uidRefValue>
;
sp:
subject
spin:
_this
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualById
;
arg:
id
[
sp:
varName
"id"
^^
xsd:
string
;
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"byId"
^^
xsd:
string
;
]
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualByName
;
arg:
name
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"byName"
^^
xsd:
string
;
]
;
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
and
;
sp:
arg1
[
rdf:
type
sp:
or
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"byId"
^^
xsd:
string
;
]
;
]
;
sp:
arg2
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"byName"
^^
xsd:
string
;
]
;
]
;
]
;
sp:
arg2
[
rdf:
type
sp:
ne
;
sp:
arg1
[
sp:
varName
"byId"
^^
xsd:
string
;
]
;
sp:
arg2
[
sp:
varName
"byName"
^^
xsd:
string
;
]
;
]
;
]
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"[RH-19] Mismatching "
;
sp:
arg2
[
rdf:
type
afn:
localname
;
sp:
arg1
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
sp:
arg3
" id: "
;
sp:
arg4
[
sp:
varName
"id"
^^
xsd:
string
;
]
;
sp:
arg5
" is not the NPD id of "
;
sp:
arg6
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
]
)
;
]
;
spin:
labelTemplate
"NPD name and id of {?type}/{?kindRef} must match"
^^
xsd:
string
;
rdfs:
label
"NPD id and name must match"
^^
xsd:
string
;
rdfs:
subClassOf
mpr-proxy-constraints:
ConstraintTemplates
;
.
mpr-proxy-constraints:
CheckName
rdf:
type
spin:
ConstructTemplate
;
spin:
body
[
rdf:
type
sp:
Construct
;
sp:
templates
(
[
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b81462
;
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b81462
;
]
)
;
sp:
where
(
[
sp:
object
[
sp:
varName
"kindRef"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
"NPD"
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#namingSystem>
;
sp:
subject
spin:
_this
;
]
[
sp:
object
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
sp:
subject
spin:
_this
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualByName
;
arg:
name
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"npd"
^^
xsd:
string
;
]
;
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"npd"
^^
xsd:
string
;
]
;
]
;
]
;
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
[
rdf:
type
sp:
add
;
sp:
arg1
"[RH-19] Invalid "
;
sp:
arg2
[
rdf:
type
afn:
localname
;
sp:
arg1
[
sp:
varName
"type"
^^
xsd:
string
;
]
;
]
;
]
;
sp:
arg2
" name "
;
sp:
arg3
[
sp:
varName
"name"
^^
xsd:
string
;
]
;
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
;
]
;
]
)
;
]
;
spin:
labelTemplate
"Must be NPD name of {?type}/{?kindRef}"
^^
xsd:
string
;
rdfs:
label
"Check name"
^^
xsd:
string
;
rdfs:
subClassOf
mpr-proxy-constraints:
ConstraintTemplates
;
.
mpr-proxy-constraints:
ConstraintTemplates
rdf:
type
spin:
ConstructTemplate
;
spin:
constraint
[
rdf:
type
spl:
Argument
;
spl:
predicate
arg:
kindRef
;
spl:
valueType
<http://www.epim.no/schemas/mprml/1#ReportingFacility>
;
rdfs:
comment
"The kind reference value."
^^
xsd:
string
;
]
;
spin:
constraint
[
rdf:
type
spl:
Argument
;
spl:
predicate
arg:
type
;
spl:
valueType
rdfs:
Class
;
rdfs:
comment
"The NPD type that the individual needs to have."
^^
xsd:
string
;
]
;
rdfs:
label
"Constraint templates"
^^
xsd:
string
;
rdfs:
subClassOf
spin:
ConstructTemplates
;
.
@prefix
afn:
<http://jena.hpl.hp.com/ARQ/function#>
.
@prefix
arg:
<http://spinrdf.org/arg#>
.
@prefix
fn:
<http://www.w3.org/2005/xpath-functions#>
.
@prefix
mpr-proxy-constraints:
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints#>
.
@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
spif:
<http://spinrdf.org/spif#>
.
@prefix
spin:
<http://spinrdf.org/spin#>
.
@prefix
spl:
<http://spinrdf.org/spl#>
.
@prefix
xsd:
<http://www.w3.org/2001/XMLSchema#>
.
arg:
kindRef
rdf:
type
rdf:
Property
;
rdfs:
label
"kind ref"
^^
xsd:
string
;
rdfs:
subPropertyOf
sp:
arg
.
<http://www.epim.no/schemas/mprml/1#FacilityIdentifierStruct>
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_platform>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_terminal>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
arg:
type
<http://www.reportinghub.no/ep/schema/well#WellBore>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_terminal>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_field>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_field>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
arg:
type
<http://www.reportinghub.no/ep/schema/well#WellBore>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckId
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_platform>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_field>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckName
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
arg:
type
<http://www.reportinghub.no/ep/schema/well#WellBore>
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_platform>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Platform>
]
;
spin:
constraint
[
rdf:
type
sp:
Construct
;
sp:
templates
([
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b1
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b1
])
;
sp:
where
([
sp:
object
<http://www.epim.no/schemas/mprml/1#RF_field>
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
]
[
sp:
object
[
sp:
varName
"fieldName"
^^
xsd:
string
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
sp:
subject
spin:
_this
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
rhspin:
currentUserIsOperatorOfFieldWithName
;
arg:
fieldName
[
sp:
varName
"fieldName"
^^
xsd:
string
]
]
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"Your company is not the operator of field with name "
;
sp:
arg2
[
sp:
varName
"fieldName"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
]
])
]
;
spin:
constraint
[
rdf:
type
sp:
Construct
;
sp:
templates
([
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b2
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b2
])
;
sp:
where
([
sp:
object
<http://www.epim.no/schemas/mprml/1#RF_wellbore>
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
]
[
sp:
object
[
sp:
varName
"wellBoreName"
^^
xsd:
string
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
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:
bound
;
sp:
arg1
[
sp:
varName
"wellBore"
^^
xsd:
string
]
]
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
rhspin:
currentUserIsOperatorOfWellBore
;
arg:
wellBore
[
sp:
varName
"wellBore"
^^
xsd:
string
]
]
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"Your company is not the operator of well bore with name "
;
sp:
arg2
[
sp:
varName
"wellBoreName"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
]
])
]
;
spin:
constraint
[
rdf:
type
mpr-proxy-constraints:
CheckIdAndNameMatch
;
arg:
kindRef
<http://www.epim.no/schemas/mprml/1#RF_terminal>
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Facility>
]
.
<http://www.epim.no/schemas/mprml/1#Obj_productVolume>
spin:
constraint
[
rdf:
type
sp:
Construct
;
sp:
templates
([
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b3
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b3
])
;
sp:
where
([
rdf:
type
sp:
TriplePath
;
sp:
object
[
sp:
varName
"name"
^^
xsd:
string
]
;
sp:
path
[
rdf:
type
sp:
SeqPath
;
sp:
path1
<http://www.epim.no/schemas/mprml/1#nameRef>
;
sp:
path2
<http://www.linkedmodel.org/schema/dtype#value>
]
;
sp:
subject
spin:
_this
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualByName
;
arg:
name
[
sp:
varName
"name"
^^
xsd:
string
]
;
arg:
type
<http://www.reportinghub.no/ep/schema/facility#Field>
]
;
sp:
variable
[
sp:
varName
"field"
^^
xsd:
string
]
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"field"
^^
xsd:
string
]
]
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"Invalid Field name "
;
sp:
arg2
[
sp:
varName
"name"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
]
])
]
.
<http://www.reportinghub.no/ep/spin/mpr-proxy-constraints>
rdf:
type
owl:
Ontology
;
rdfs:
comment
"Collection of constraints that are executed on the SXML proxy ontology for MPR schema based reports."
^^
xsd:
string
;
owl:
imports
<http://www.reportinghub.no/spin/rh>
,
<http://www.epim.no/schemas/mprml/1>
,
<http://spinrdf.org/spin>
;
owl:
versionInfo
"0.1.0"
^^
xsd:
string
.
mpr-proxy-constraints:
CheckId
rdf:
type
spin:
ConstructTemplate
;
rdfs:
label
"Check id"
^^
xsd:
string
;
rdfs:
subClassOf
mpr-proxy-constraints:
ConstraintTemplates
;
spin:
body
[
rdf:
type
sp:
Construct
;
sp:
templates
([
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b4
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b4
])
;
sp:
where
([
sp:
object
[
sp:
varName
"kindRef"
^^
xsd:
string
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
]
[
sp:
object
"NPD"
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#namingSystem>
;
sp:
subject
spin:
_this
]
[
sp:
object
[
sp:
varName
"id"
^^
xsd:
string
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#uidRefValue>
;
sp:
subject
spin:
_this
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualById
;
arg:
id
[
sp:
varName
"id"
^^
xsd:
string
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"npd"
^^
xsd:
string
]
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"npd"
^^
xsd:
string
]
]
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"[RH-19] Invalid "
;
sp:
arg2
[
rdf:
type
afn:
localname
;
sp:
arg1
[
sp:
varName
"type"
^^
xsd:
string
]
]
;
sp:
arg3
" id "
;
sp:
arg4
[
sp:
varName
"id"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
]
])
]
;
spin:
labelTemplate
"Must be NPD id of {?type}/{?kindRef}"
^^
xsd:
string
.
mpr-proxy-constraints:
CheckIdAndNameMatch
rdf:
type
spin:
ConstructTemplate
;
rdfs:
label
"NPD id and name must match"
^^
xsd:
string
;
rdfs:
subClassOf
mpr-proxy-constraints:
ConstraintTemplates
;
spin:
body
[
rdf:
type
sp:
Construct
;
sp:
templates
([
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b5
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b5
])
;
sp:
where
([
sp:
object
[
sp:
varName
"kindRef"
^^
xsd:
string
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
]
[
sp:
object
"NPD"
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#namingSystem>
;
sp:
subject
spin:
_this
]
[
sp:
object
[
sp:
varName
"name"
^^
xsd:
string
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
sp:
subject
spin:
_this
]
[
sp:
object
[
sp:
varName
"id"
^^
xsd:
string
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#uidRefValue>
;
sp:
subject
spin:
_this
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualById
;
arg:
id
[
sp:
varName
"id"
^^
xsd:
string
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"byId"
^^
xsd:
string
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualByName
;
arg:
name
[
sp:
varName
"name"
^^
xsd:
string
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"byName"
^^
xsd:
string
]
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
and
;
sp:
arg1
[
rdf:
type
sp:
or
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"byId"
^^
xsd:
string
]
]
;
sp:
arg2
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"byName"
^^
xsd:
string
]
]
]
;
sp:
arg2
[
rdf:
type
sp:
ne
;
sp:
arg1
[
sp:
varName
"byId"
^^
xsd:
string
]
;
sp:
arg2
[
sp:
varName
"byName"
^^
xsd:
string
]
]
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
"[RH-19] Mismatching "
;
sp:
arg2
[
rdf:
type
afn:
localname
;
sp:
arg1
[
sp:
varName
"type"
^^
xsd:
string
]
]
;
sp:
arg3
" id: "
;
sp:
arg4
[
sp:
varName
"id"
^^
xsd:
string
]
;
sp:
arg5
" is not the NPD id of "
;
sp:
arg6
[
sp:
varName
"name"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
]
])
]
;
spin:
labelTemplate
"NPD name and id of {?type}/{?kindRef} must match"
^^
xsd:
string
.
mpr-proxy-constraints:
CheckName
rdf:
type
spin:
ConstructTemplate
;
rdfs:
label
"Check name"
^^
xsd:
string
;
rdfs:
subClassOf
mpr-proxy-constraints:
ConstraintTemplates
;
spin:
body
[
rdf:
type
sp:
Construct
;
sp:
templates
([
sp:
object
spin:
ConstraintViolation
;
sp:
predicate
rdf:
type
;
sp:
subject
_:
b6
]
[
sp:
object
[
sp:
varName
"message"
^^
xsd:
string
]
;
sp:
predicate
rdfs:
label
;
sp:
subject
_:
b6
])
;
sp:
where
([
sp:
object
[
sp:
varName
"kindRef"
^^
xsd:
string
]
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#kindRef>
;
sp:
subject
spin:
_this
]
[
sp:
object
"NPD"
;
sp:
predicate
<http://www.epim.no/schemas/mprml/1#namingSystem>
;
sp:
subject
spin:
_this
]
[
sp:
object
[
sp:
varName
"name"
^^
xsd:
string
]
;
sp:
predicate
<http://www.linkedmodel.org/schema/dtype#value>
;
sp:
subject
spin:
_this
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
rhspin:
npdIndividualByName
;
arg:
name
[
sp:
varName
"name"
^^
xsd:
string
]
;
arg:
type
[
sp:
varName
"type"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"npd"
^^
xsd:
string
]
]
[
rdf:
type
sp:
Filter
;
sp:
expression
[
rdf:
type
sp:
not
;
sp:
arg1
[
rdf:
type
sp:
bound
;
sp:
arg1
[
sp:
varName
"npd"
^^
xsd:
string
]
]
]
]
[
rdf:
type
sp:
Bind
;
sp:
expression
[
rdf:
type
fn:
concat
;
sp:
arg1
[
rdf:
type
sp:
add
;
sp:
arg1
"[RH-19] Invalid "
;
sp:
arg2
[
rdf:
type
afn:
localname
;
sp:
arg1
[
sp:
varName
"type"
^^
xsd:
string
]
]
]
;
sp:
arg2
" name "
;
sp:
arg3
[
sp:
varName
"name"
^^
xsd:
string
]
]
;
sp:
variable
[
sp:
varName
"message"
^^
xsd:
string
]
])
]
;
spin:
labelTemplate
"Must be NPD name of {?type}/{?kindRef}"
^^
xsd:
string
.
mpr-proxy-constraints:
ConstraintTemplates
rdf:
type
spin:
ConstructTemplate
;
rdfs:
label
"Constraint templates"
^^
xsd:
string
;
rdfs:
subClassOf
spin:
ConstructTemplates
;
spin:
constraint
[
rdf:
type
spl:
Argument
;
rdfs:
comment
"The NPD type that the individual needs to have."
^^
xsd:
string
;
spl:
predicate
arg:
type
;
spl:
valueType
rdfs:
Class
]
;
spin:
constraint
[
rdf:
type
spl:
Argument
;
rdfs:
comment
"The kind reference value."
^^
xsd:
string
;
spl:
predicate
arg:
kindRef
;
spl:
valueType
<http://www.epim.no/schemas/mprml/1#ReportingFacility>
]
.
...
...
Please
register
or
login
to post a comment