Holger Knublauch

New DDR semantics

......@@ -772,6 +772,13 @@ rhspin:companyHasLicenceForWellBore
sp:subject
[ sp:varName "share"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type rhspin:shareIsValid ;
arg:share
[ sp:varName "share"^^xsd:string
]
]
] [ sp:object
[ sp:varName "licence"^^xsd:string
] ;
......@@ -784,18 +791,39 @@ rhspin:companyHasLicenceForWellBore
sp:subject
[ sp:varName "licence"^^xsd:string
]
] [ sp:object
] [ rdf:type sp:Union ;
sp:elements (([ sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
]) ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
sp:path2 <http://www.reportinghub.no/np/schema/npd#wellPartOfField>
] ;
sp:path2 <http://www.reportinghub.no/np/schema/npd#fieldOwner>
] ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
]))
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type rhspin:shareIsValid ;
arg:share
[ sp:varName "share"^^xsd:string
[ rdf:type sp:eq ;
sp:arg1 [ rdf:type rhspin:licenceForWellBore ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
]
] ;
sp:arg2 [ sp:varName "licence"^^xsd:string
]
]
]) ;
......@@ -1626,16 +1654,16 @@ rhspin:graphForDDR
sp:subject
[ sp:varName "ddr"^^xsd:string
]
] [ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:licenceForWellBore ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
] ;
sp:variable
[ sp:varName "licence"^^xsd:string
]
])
] ;
spin:constraint
......@@ -1769,13 +1797,16 @@ rhspin:graphForWellBoreWithId
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:licenceForWellBore ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
]
] ;
sp:variable
[ sp:varName "licence"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
......@@ -1814,10 +1845,55 @@ rhspin:licenceById
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Licence> .
rhspin:licenceForWellBore
rhspin:licenceForDevelopmentWellBore
rdf:type spin:Function ;
rdfs:comment "Gets the licence associated with a given well bore."^^xsd:string ;
rdfs:label "licence for well bore"^^xsd:string ;
rdfs:comment """Gets the licence associated with a given development well bore:
- Find the wellbore’s field association according to NPD fact pages
- For that field, look up field attribute “Owner- current”. This is then the license or BAA that the wellbore should be associated with."""^^xsd:string ;
rdfs:label "licence for development well bore"^^xsd:string ;
rdfs:seeAlso <http://st.epim.no/EPIM_SPIRATEST/16/Requirement/997.aspx> ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "licence"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "field"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
sp:path2 <http://www.reportinghub.no/np/schema/npd#wellPartOfField>
] ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#fieldOwner> ;
sp:subject
[ sp:varName "field"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The WellBore to get the licence of."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Licence> .
rhspin:licenceForExplorationWellBore
rdf:type spin:Function ;
rdfs:comment """Gets the licence associated with a given exporation well bore.
Wellbore should be associated with the license specified in the attribute “drilled in production license” from the NPD facts for the given wellbore. """^^xsd:string ;
rdfs:label "licence for exploration well bore"^^xsd:string ;
rdfs:seeAlso <http://st.epim.no/EPIM_SPIRATEST/16/Requirement/997.aspx> ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
......@@ -1843,6 +1919,67 @@ rhspin:licenceForWellBore
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Licence> .
rhspin:licenceForWellBore
rdf:type spin:Function ;
rdfs:comment """Gets the licence associated with a given well bore.
For development wellbores:
- Find the wellbore’s field association according to NPD fact pages
- For that field, look up field attribute “Owner- current”. This is then the license or BAA that the wellbore should be associated with.
For exploration wellbores:
Wellbore should be associated with the license specified in the attribute “drilled in production license” from the NPD facts for the given wellbore.
Note that SHALLOW well bores are handled like EXPLORATION well bores."""^^xsd:string ;
rdfs:label "licence for well bore"^^xsd:string ;
rdfs:seeAlso <http://st.epim.no/EPIM_SPIRATEST/16/Requirement/997.aspx> ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "licence"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "type"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#wellBoreType> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type sp:if ;
sp:arg1 [ rdf:type sp:eq ;
sp:arg1 [ sp:varName "type"^^xsd:string
] ;
sp:arg2 "DEVELOPMENT"
] ;
sp:arg2 [ rdf:type rhspin:licenceForDevelopmentWellBore ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
]
] ;
sp:arg3 [ rdf:type rhspin:licenceForExplorationWellBore ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
]
]
] ;
sp:variable
[ sp:varName "licence"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The WellBore to get the licence of."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Licence> .
rhspin:normalizeString
rdf:type spin:Function ;
rdfs:comment "Takes a raw string and \"normalizes\" it, replacing special characters so that they can be used in URIs."^^xsd:string ;
......@@ -2698,20 +2835,26 @@ rhspin:wellBoreLicenceOperator
sp:resultVariables ([ sp:varName "operator"^^xsd:string
]) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject
sp:elements ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:licenceForWellBore ;
arg:wellBore
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "operator"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#licenceOperator> ;
sp:subject
sp:variable
[ sp:varName "licence"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spl:object ;
sp:arg1 [ sp:varName "licence"^^xsd:string
] ;
sp:arg2 <http://www.reportinghub.no/np/schema/npd#licenceOperator>
] ;
sp:variable
[ sp:varName "operator"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
......