Holger Knublauch

Made DDR import and SPIN functions tolerate new user-defined datatypes

Deleted -temporaryForTesting, now uses correct NPD resources
This diff could not be displayed because it is too large.
# Saved by TopBraid on Sun Sep 25 18:41:25 BST 2011
# baseURI: http://www.reportinghub.no/ep/transform/1.1/ddr/drillReport
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/ep/spin/1.1/lib
# imports: http://www.energistics.org/schemas/abstract
# imports: http://www.witsml.org/schemas/1series
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/equipment
# imports: http://www.reportinghub.no/ep/schema/1.0/activity-purpose
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://spinrdf.org/spin
@prefix arg: <http://spinrdf.org/arg#> .
@prefix ddr: <http://www.witsml.org/schemas/1series#> .
@prefix ep-spin-lib: <http://www.reportinghub.no/ep/spin/lib#> .
@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/transform/1.1/ddr/drillReport>
rdf:type owl:Ontology ;
owl:imports <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/spin/1.1/lib> , <http://www.witsml.org/schemas/1series> , <http://www.energistics.org/schemas/abstract> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/report> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
ddr:Obj_drillReport
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 106 Create Well"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/well#Well> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#humanRecognizableName> ;
sp:subject _:b1
] [ sp:object _:b3 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
sp:subject _:b4
] [ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b3
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
sp:predicate rdf:type ;
sp:subject _:b3
] [ sp:object _:b5 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject _:b1
]) ;
sp:where ([ sp:object _:b6 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b2 ;
sp:predicate ddr:nameWell ;
sp:subject spin:_this
] [ sp:object _:b7 ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object _:b8 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
sp:subject _:b4
] [ sp:object _:b5 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b8
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b5
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b6
] ;
sp:variable _:b9
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 _:b9 ;
sp:arg2 _:b7
] ;
sp:variable _:b4
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b2
] ;
sp:variable _:b10
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellByName ;
arg:wellName _:b10
] ;
sp:variable _:b1
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 104 Transfer dTimEnd"^^xsd:string ;
sp:templates ([ sp:object _:b11 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject _:b12
]) ;
sp:where ([ sp:object _:b13 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b14 ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object _:b11 ;
sp:predicate ddr:dTimEnd ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b13
] ;
sp:variable _:b15
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 _:b15 ;
sp:arg2 _:b14
] ;
sp:variable _:b12
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 105
Classify a DailyDrillingReport"""^^xsd:string ;
sp:templates ([ sp:object _:b16 ;
sp:predicate rdf:type ;
sp:subject _:b17
]) ;
sp:where ([ sp:object _:b18 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b19 ;
sp:predicate ddr:createDate ;
sp:subject spin:_this
] [ sp:object _:b20 ;
sp:predicate ddr:versionKindRef ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:selectDailyDrillingReportType ;
sp:arg1 _:b20
] ;
sp:variable _:b16
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b18
] ;
sp:variable _:b21
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
sp:arg1 _:b21 ;
sp:arg2 _:b19
] ;
sp:variable _:b17
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 103a Set name of DailyDrillingReport as label
Minimum data - createDate, dTimStart, nameWellBore"""^^xsd:string ;
sp:templates ([ sp:object _:b22 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#name> ;
sp:subject _:b23
]) ;
sp:where ([ sp:object _:b24 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b22 ;
sp:predicate ddr:name ;
sp:subject spin:_this
] [ sp:object _:b25 ;
sp:predicate ddr:createDate ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b24
] ;
sp:variable _:b26
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
sp:arg1 _:b26 ;
sp:arg2 _:b25
] ;
sp:variable _:b23
])
] ;
spin:rule
[ rdf:type sp:Construct ;
# baseURI: http://www.reportinghub.no/ep/transform/1.1/ddr/drillReport
# imports: http://spinrdf.org/spin
# imports: http://www.energistics.org/schemas/abstract
# imports: http://www.reportinghub.no/ep/schema/1.0/activity
# imports: http://www.reportinghub.no/ep/schema/1.0/activity-purpose
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/equipment
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/ep/schema/1.0/well
# imports: http://www.reportinghub.no/ep/spin/1.1/lib
# imports: http://www.witsml.org/schemas/1series
@prefix NPD_110721144611-valid: <file:///Sandbox/NPD_110721144611-valid.xml#> .
@prefix arg: <http://spinrdf.org/arg#> .
@prefix ddr: <http://www.witsml.org/schemas/1series#> .
@prefix ep-spin-lib: <http://www.reportinghub.no/ep/spin/lib#> .
@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/transform/1.1/ddr/drillReport>
rdf:type owl:Ontology ;
owl:imports <http://spinrdf.org/spin> , <http://www.energistics.org/schemas/abstract> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/activity-purpose> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/spin/1.1/lib> , <http://www.witsml.org/schemas/1series> ;
owl:versionInfo "Created with TopBraid Composer"^^xsd:string .
ddr:Obj_drillReport
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 103 Create DailyDrillingReport, DailyDrillingActivity, TemporalPartOfAWellBore and WellBore
Minimum data - createDate, dTimStart, dTimEnd, nameWellBore
Optional data - extendedReport
replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore) ."""^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> ;
sp:predicate rdf:type ;
sp:subject _:b27
] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyDrillingActivity> ;
sp:predicate rdf:type ;
sp:subject _:b28
] [ sp:object _:b28 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject _:b27
] [ sp:object _:b29 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject _:b27
] [ sp:object _:b30 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
sp:subject _:b28
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWellBore> ;
sp:predicate rdf:type ;
sp:subject _:b31
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b32
] [ sp:object _:b32 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b31
] [ sp:object _:b33 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#humanRecognizableName> ;
sp:subject _:b32
] [ sp:object _:b31 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
sp:subject _:b28
] [ sp:object _:b34 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesFollowingTheDailyReportingPeriod> ;
sp:subject _:b28
] [ sp:object <http://www.reportinghub.no/ep/schema/report#Report> ;
sp:predicate rdf:type ;
sp:subject _:b34
] [ sp:object _:b35 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#hasContent> ;
sp:subject _:b34
] [ sp:object _:b36 ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject _:b34
]) ;
sp:where ([ sp:object _:b33 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b30 ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object _:b37 ;
sp:predicate ddr:dTimEnd ;
sp:subject spin:_this
] [ sp:object _:b29 ;
sp:predicate ddr:createDate ;
sp:subject spin:_this
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object _:b38 ;
sp:predicate ddr:extendedReportRef ;
sp:subject spin:_this
] [ sp:object _:b35 ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject _:b38
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object _:b36 ;
sp:predicate ddr:dTim ;
sp:subject _:b38
])
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b33
] ;
sp:variable _:b39
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
sp:arg1 _:b39 ;
sp:arg2 _:b29
] ;
sp:variable _:b27
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 _:b39 ;
sp:arg2 _:b30
] ;
sp:variable _:b28
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildTemporalPartOfAWellBoreURI ;
sp:arg1 _:b39 ;
sp:arg2 _:b30 ;
sp:arg3 _:b37
] ;
sp:variable _:b31
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildTemporaryWellBoreURI ;
sp:arg1 _:b39
] ;
sp:variable _:b32
])
] .
_:b1 sp:varName "well"^^xsd:string .
_:b10
sp:varName "normalizedWellName"^^xsd:string .
_:b9 sp:varName "normalizedWellBoreName"^^xsd:string .
_:b5 sp:varName "wellBore"^^xsd:string .
_:b8 sp:varName "temporalPartOfAWellBore"^^xsd:string .
_:b4 sp:varName "dailyDrillingActivity"^^xsd:string .
_:b7 sp:varName "dTimStart"^^xsd:string .
_:b2 sp:varName "nameWell"^^xsd:string .
_:b6 sp:varName "nameWellBore"^^xsd:string .
_:b15
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b14
sp:varName "dTimStart"^^xsd:string .
_:b13
sp:varName "nameWellBore"^^xsd:string .
_:b12
sp:varName "dailyDrillingActivity"^^xsd:string .
_:b11
sp:varName "dTimEnd"^^xsd:string .
_:b21
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b20
sp:varName "versionKind"^^xsd:string .
_:b19
sp:varName "createDate"^^xsd:string .
_:b18
sp:varName "nameWellBore"^^xsd:string .
_:b17
sp:varName "dailyDrillingReport"^^xsd:string .
_:b16
sp:varName "dailyDrillingReportType"^^xsd:string .
_:b26
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b25
sp:varName "createDate"^^xsd:string .
_:b24
sp:varName "nameWellBore"^^xsd:string .
_:b23
sp:varName "dailyDrillingReport"^^xsd:string .
_:b22
sp:varName "nameDailyDrillingReport"^^xsd:string .
_:b39
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b38
sp:varName "extendedReport"^^xsd:string .
_:b37
sp:varName "dTimEnd"^^xsd:string .
_:b36
sp:varName "dTimExtendedReport"^^xsd:string .
_:b35
sp:varName "extendedReportContent"^^xsd:string .
_:b33
sp:varName "nameWellBore"^^xsd:string .
_:b32
sp:varName "wellBore"^^xsd:string .
_:b31
sp:varName "temporalPartOfAWellBore"^^xsd:string .
_:b30
sp:varName "dTimStart"^^xsd:string .
_:b29
sp:varName "createDate"^^xsd:string .
_:b28
sp:varName "dailyDrillingActivity"^^xsd:string .
_:b27
sp:varName "dailyDrillingReport"^^xsd:string .
replaced for testing - BIND (rhspin:wellBoreByName(?nameWellBore) AS ?wellBore) ."""^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "dailyDrillingReport"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/activity#DailyDrillingActivity> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object
[ sp:varName "dailyDrillingActivity"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:subject
[ sp:varName "dailyDrillingReport"^^xsd:string
]
] [ sp:object
[ sp:varName "createDate"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject
[ sp:varName "dailyDrillingReport"^^xsd:string
]
] [ sp:object
[ sp:varName "dTimStart"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#startedAt> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWellBore> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "nameWellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#humanRecognizableName> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#descriptionOfActivitiesFollowingTheDailyReportingPeriod> ;
sp:subject
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ sp:object <http://www.reportinghub.no/ep/schema/report#Report> ;
sp:predicate rdf:type ;
sp:subject _:b1
] [ sp:object
[ sp:varName "extendedReportContent"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#hasContent> ;
sp:subject _:b1
] [ sp:object
[ sp:varName "dTimExtendedReport"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/ep/schema/report#createdAt> ;
sp:subject _:b1
]) ;
sp:where ([ sp:object
[ sp:varName "nameWellBore"^^xsd:string
] ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dTimStart"^^xsd:string
] ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "dTimEnd"^^xsd:string
] ;
sp:predicate ddr:dTimEnd ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "createDate"^^xsd:string
] ;
sp:predicate ddr:createDate ;
sp:subject spin:_this
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "extendedReport"^^xsd:string
] ;
sp:predicate ddr:extendedReportRef ;
sp:subject spin:_this
] [ sp:object
[ sp:varName "extendedReportContent"^^xsd:string
] ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject
[ sp:varName "extendedReport"^^xsd:string
]
] [ rdf:type sp:Optional ;
sp:elements ([ sp:object
[ sp:varName "dTimExtendedReport"^^xsd:string
] ;
sp:predicate ddr:dTim ;
sp:subject
[ sp:varName "extendedReport"^^xsd:string
]
])
])
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
]
] ;
sp:variable
[ sp:varName "normalizedWellBoreName"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
] ;
sp:arg2 [ sp:varName "createDate"^^xsd:string
]
] ;
sp:variable
[ sp:varName "dailyDrillingReport"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
] ;
sp:arg2 [ sp:varName "dTimStart"^^xsd:string
]
] ;
sp:variable
[ sp:varName "dailyDrillingActivity"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildTemporalPartOfAWellBoreURI ;
sp:arg1 [ sp:varName "normalizedWellBoreName"^^xsd:string
] ;
sp:arg2 [ sp:varName "dTimStart"^^xsd:string
] ;
sp:arg3 [ sp:varName "dTimEnd"^^xsd:string
]
] ;
sp:variable
[ sp:varName "temporalPartOfAWellBore"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellBoreByName ;
arg:wellBoreName
[ rdf:type xsd:string ;
sp:arg1 [ sp:varName "nameWellBore"^^xsd:string
]
]
] ;
sp:variable
[ sp:varName "wellBore"^^xsd:string
]
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 106 Create Well"^^xsd:string ;
sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/well#Well> ;
sp:predicate rdf:type ;
sp:subject _:b2
] [ sp:object _:b3 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#humanRecognizableName> ;
sp:subject _:b2
] [ sp:object _:b4 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWell> ;
sp:subject _:b5
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b4
] [ sp:object <http://www.reportinghub.no/ep/schema/well#TemporalPartOfAWell> ;
sp:predicate rdf:type ;
sp:subject _:b4
] [ sp:object _:b6 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#hasPart> ;
sp:subject _:b2
]) ;
sp:where ([ sp:object _:b7 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b3 ;
sp:predicate ddr:nameWell ;
sp:subject spin:_this
] [ sp:object _:b8 ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object _:b9 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#onWellBore> ;
sp:subject _:b5
] [ sp:object _:b6 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
sp:subject _:b9
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b6
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b7
] ;
sp:variable _:b10
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 _:b10 ;
sp:arg2 _:b8
] ;
sp:variable _:b5
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b3
] ;
sp:variable _:b11
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type rhspin:wellByName ;
arg:wellName _:b11
] ;
sp:variable _:b2
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment "STEP 104 Transfer dTimEnd"^^xsd:string ;
sp:templates ([ sp:object _:b12 ;
sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
sp:subject _:b13
]) ;
sp:where ([ sp:object _:b14 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b15 ;
sp:predicate ddr:dTimStart ;
sp:subject spin:_this
] [ sp:object _:b12 ;
sp:predicate ddr:dTimEnd ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b14
] ;
sp:variable _:b16
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingActivityURI ;
sp:arg1 _:b16 ;
sp:arg2 _:b15
] ;
sp:variable _:b13
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 105
Classify a DailyDrillingReport"""^^xsd:string ;
sp:templates ([ sp:object _:b17 ;
sp:predicate rdf:type ;
sp:subject _:b18
]) ;
sp:where ([ sp:object _:b19 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b20 ;
sp:predicate ddr:createDate ;
sp:subject spin:_this
] [ sp:object _:b21 ;
sp:predicate ddr:versionKindRef ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:selectDailyDrillingReportType ;
sp:arg1 _:b21
] ;
sp:variable _:b17
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b19
] ;
sp:variable _:b22
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
sp:arg1 _:b22 ;
sp:arg2 _:b20
] ;
sp:variable _:b18
])
] ;
spin:rule
[ rdf:type sp:Construct ;
rdfs:comment """STEP 103a Set name of DailyDrillingReport as label
Minimum data - createDate, dTimStart, nameWellBore"""^^xsd:string ;
sp:templates ([ sp:object _:b23 ;
sp:predicate <http://www.reportinghub.no/ep/schema/core#name> ;
sp:subject _:b24
]) ;
sp:where ([ sp:object _:b25 ;
sp:predicate ddr:nameWellbore ;
sp:subject spin:_this
] [ sp:object _:b23 ;
sp:predicate ddr:name ;
sp:subject spin:_this
] [ sp:object _:b26 ;
sp:predicate ddr:createDate ;
sp:subject spin:_this
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:normalizeString ;
sp:arg1 _:b25
] ;
sp:variable _:b27
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type ep-spin-lib:buildDailyDrillingReportURI ;
sp:arg1 _:b27 ;
sp:arg2 _:b26
] ;
sp:variable _:b24
])
] .
_:b11
sp:varName "normalizedWellName"^^xsd:string .
_:b10
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b9 sp:varName "temporalPartOfAWellBore"^^xsd:string .
_:b8 sp:varName "dTimStart"^^xsd:string .
_:b7 sp:varName "nameWellBore"^^xsd:string .
_:b6 sp:varName "wellBore"^^xsd:string .
_:b5 sp:varName "dailyDrillingActivity"^^xsd:string .
_:b3 sp:varName "nameWell"^^xsd:string .
_:b2 sp:varName "well"^^xsd:string .
_:b16
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b15
sp:varName "dTimStart"^^xsd:string .
_:b14
sp:varName "nameWellBore"^^xsd:string .
_:b13
sp:varName "dailyDrillingActivity"^^xsd:string .
_:b12
sp:varName "dTimEnd"^^xsd:string .
_:b22
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b21
sp:varName "versionKind"^^xsd:string .
_:b20
sp:varName "createDate"^^xsd:string .
_:b19
sp:varName "nameWellBore"^^xsd:string .
_:b18
sp:varName "dailyDrillingReport"^^xsd:string .
_:b17
sp:varName "dailyDrillingReportType"^^xsd:string .
_:b27
sp:varName "normalizedWellBoreName"^^xsd:string .
_:b26
sp:varName "createDate"^^xsd:string .
_:b25
sp:varName "nameWellBore"^^xsd:string .
_:b24
sp:varName "dailyDrillingReport"^^xsd:string .
_:b23
sp:varName "nameDailyDrillingReport"^^xsd:string .
......
......@@ -415,12 +415,19 @@ rhspin:ddrActivityStartDate
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type xsd:date ;
sp:arg1 _:b18
sp:arg1 [ rdf:type xsd:dateTime ;
sp:arg1 [ rdf:type xsd:string ;
sp:arg1 [ sp:varName "startedAt"^^xsd:string
]
]
]
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object _:b18 ;
sp:object
[ sp:varName "startedAt"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/activity#reportOn> ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#startedAt>
] ;
sp:subject
......@@ -443,13 +450,16 @@ rhspin:ddrWellBoreId
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b19) ;
sp:resultVariables ([ sp:varName "id"^^xsd:string
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object _:b20 ;
sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/activity#reportOn> ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#onWellBore>
] ;
sp:path2 <http://www.reportinghub.no/ep/schema/core#temporalPartOf>
......@@ -458,9 +468,13 @@ rhspin:ddrWellBoreId
[ sp:varName "ddr"^^xsd:string
]
] [ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b19 ;
sp:elements ([ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject _:b20
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
])
......@@ -502,13 +516,13 @@ rhspin:dtypeValue
rdfs:subClassOf spl:OntologyFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b21) ;
sp:where ([ sp:object _:b22 ;
sp:resultVariables (_:b18) ;
sp:where ([ sp:object _:b19 ;
sp:predicate spin:_arg2 ;
sp:subject spin:_arg1
] [ sp:object _:b21 ;
] [ sp:object _:b18 ;
sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
sp:subject _:b22
sp:subject _:b19
])
] ;
spin:constraint
......@@ -576,14 +590,17 @@ rhspin:graphForDDR
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:arg1 _:b23
sp:arg1 [ sp:varName "uri"^^xsd:string
]
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object _:b24 ;
sp:object
[ sp:varName "wellBore"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/activity#reportOn> ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#onWellBore>
] ;
sp:path2 <http://www.reportinghub.no/ep/schema/core#temporalPartOf>
......@@ -592,21 +609,32 @@ rhspin:graphForDDR
[ sp:varName "ddr"^^xsd:string
]
] [ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b25 ;
sp:elements ([ sp:object
[ sp:varName "licence"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject _:b24
] [ sp:object _:b26 ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
]
] [ sp:object
[ sp:varName "id"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject _:b25
sp:subject
[ sp:varName "licence"^^xsd:string
]
]) ;
sp:graphNameNode npdata:npd
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type fn:concat ;
sp:arg1 "https://www.reportinghub.no/ep/graph/licence-" ;
sp:arg2 _:b26
sp:arg2 [ sp:varName "id"^^xsd:string
]
] ;
sp:variable _:b23
sp:variable
[ sp:varName "uri"^^xsd:string
]
])
] ;
spin:constraint
......@@ -702,9 +730,9 @@ rhspin:licenceForWellBore
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b27) ;
sp:resultVariables (_:b20) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b27 ;
sp:elements ([ sp:object _:b20 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
......@@ -728,7 +756,7 @@ rhspin:normalizeString
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b28) ;
sp:resultVariables (_:b21) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
......@@ -736,67 +764,67 @@ rhspin:normalizeString
sp:arg2 "\\((.*)\\)" ;
sp:arg3 ""
] ;
sp:variable _:b29
sp:variable _:b22
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:trim ;
sp:arg1 _:b29
sp:arg1 _:b22
] ;
sp:variable _:b30
sp:variable _:b23
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:encodeURL ;
sp:arg1 _:b30
sp:arg1 _:b23
] ;
sp:variable _:b31
sp:variable _:b24
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b31 ;
sp:arg1 _:b24 ;
sp:arg2 "%2F" ;
sp:arg3 "_"
] ;
sp:variable _:b32
sp:variable _:b25
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b32 ;
sp:arg1 _:b25 ;
sp:arg2 "%[0-9A-F][0-9A-F]" ;
sp:arg3 ""
] ;
sp:variable _:b33
sp:variable _:b26
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b33 ;
sp:arg1 _:b26 ;
sp:arg2 "\\+" ;
sp:arg3 "_"
] ;
sp:variable _:b34
sp:variable _:b27
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b34 ;
sp:arg1 _:b27 ;
sp:arg2 "_+" ;
sp:arg3 "_"
] ;
sp:variable _:b35
sp:variable _:b28
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b35 ;
sp:arg1 _:b28 ;
sp:arg2 "\\*" ;
sp:arg3 ""
] ;
sp:variable _:b36
sp:variable _:b29
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type xsd:string ;
sp:arg1 [ rdf:type spif:upperCase ;
sp:arg1 _:b36
sp:arg1 _:b29
]
] ;
sp:variable _:b28
sp:variable _:b21
])
] ;
spin:constraint
......@@ -813,9 +841,9 @@ rhspin:npdId
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b37) ;
sp:resultVariables (_:b30) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b37 ;
sp:elements ([ sp:object _:b30 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject
[ sp:varName "resource"^^xsd:string
......@@ -838,9 +866,9 @@ rhspin:npdName
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b38) ;
sp:resultVariables (_:b31) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b38 ;
sp:elements ([ sp:object _:b31 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
[ sp:varName "resource"^^xsd:string
......@@ -993,16 +1021,16 @@ rhspin:wellBoreByName
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b39) ;
sp:resultVariables (_:b32) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object
[ sp:varName "wellBoreName"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b39
sp:subject _:b32
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b39
sp:subject _:b32
]) ;
sp:graphNameNode npdata:npd
])
......@@ -1041,71 +1069,50 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b39
sp:varName "wellBore"^^xsd:string .
_:b38
sp:varName "name"^^xsd:string .
_:b37
sp:varName "id"^^xsd:string .
_:b36
sp:varName "t4"^^xsd:string .
_:b35
sp:varName "t3"^^xsd:string .
_:b34
sp:varName "t2"^^xsd:string .
_:b33
sp:varName "t1"^^xsd:string .
_:b32
sp:varName "t0b"^^xsd:string .
sp:varName "wellBore"^^xsd:string .
_:b31
sp:varName "t0a"^^xsd:string .
sp:varName "name"^^xsd:string .
_:b30
sp:varName "s2"^^xsd:string .
sp:varName "id"^^xsd:string .
_:b29
sp:varName "s1"^^xsd:string .
sp:varName "t4"^^xsd:string .
_:b28
sp:varName "normalizedStr"^^xsd:string .
sp:varName "t3"^^xsd:string .
_:b27
sp:varName "licence"^^xsd:string .
sp:varName "t2"^^xsd:string .
_:b26
sp:varName "id"^^xsd:string .
sp:varName "t1"^^xsd:string .
_:b25
sp:varName "licence"^^xsd:string .
sp:varName "t0b"^^xsd:string .
_:b24
sp:varName "wellBore"^^xsd:string .
sp:varName "t0a"^^xsd:string .
_:b23
sp:varName "uri"^^xsd:string .
sp:varName "s2"^^xsd:string .
_:b22
sp:varName "reif"^^xsd:string .
sp:varName "s1"^^xsd:string .
_:b21
sp:varName "value"^^xsd:string .
sp:varName "normalizedStr"^^xsd:string .
_:b20
sp:varName "wellBore"^^xsd:string .
sp:varName "licence"^^xsd:string .
_:b19
sp:varName "id"^^xsd:string .
sp:varName "reif"^^xsd:string .
_:b18
sp:varName "startedAt"^^xsd:string .
sp:varName "value"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
......