Holger Knublauch

Added rhspin:ddrOfWeek

......@@ -16,6 +16,7 @@
@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 smf: <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix spif: <http://spinrdf.org/spif#> .
@prefix spin: <http://spinrdf.org/spin#> .
......@@ -104,14 +105,14 @@ arg:wellName
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The property that must be used in the result resource."^^xsd:string ;
spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ;
spl:valueType rdf:Property
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
rdfs:comment "The property that must be used in the result resource."^^xsd:string ;
spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ;
spl:valueType rdf:Property
] ;
spin:returnType rdfs:Resource .
......@@ -266,15 +267,15 @@ rhspin:WDRTableTemplates
spin:abstract "true"^^xsd:boolean ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR that serves as root of the query."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The start date of the reporting week."^^xsd:string ;
spl:predicate arg:startDate ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR that serves as root of the query."^^xsd:string ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] .
rhspin:baaById
......@@ -573,6 +574,84 @@ rhspin:ddrActivityStartDate
] ;
spin:returnType xsd:date .
rhspin:ddrOfWeek
rdf:type spin:MagicProperty ;
rdfs:comment """A magic property that finds all DailyDrillingReports (variable on right) that are within 7 days of the xsd:date (first value on the left) and for a given well bore (second value on the left). For example,
(?startDate ?wellBore) rhspin:ddrOfWeek ?ddr"""^^xsd:string ;
rdfs:label "DDR of week"^^xsd:string ;
rdfs:subClassOf spin:MagicProperties ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ sp:varName "ddr"^^xsd:string
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object spin:_arg2 ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
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>
] ;
sp:subject
[ sp:varName "ddr"^^xsd:string
]
] [ rdf:type sp:TriplePath ;
sp:object
[ sp:varName "startDateTime"^^xsd:string
] ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/report#reportOn> ;
sp:path2 <http://www.reportinghub.no/ep/schema/activity#startedAt>
] ;
sp:subject
[ sp:varName "ddr"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type xsd:date ;
sp:arg1 [ sp:varName "startDateTime"^^xsd:string
]
] ;
sp:variable
[ sp:varName "startDate"^^xsd:string
]
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type smf:duration ;
sp:arg1 "d" ;
sp:arg2 spin:_arg1 ;
sp:arg3 [ sp:varName "startDate"^^xsd:string
]
] ;
sp:variable
[ sp:varName "days"^^xsd:string
]
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:lt ;
sp:arg1 [ sp:varName "days"^^xsd:string
] ;
sp:arg2 7
]
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The first day of the week."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType xsd:date
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The well bore that the DDR must be about."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport> .
rhspin:ddrWellBoreId
rdf:type spin:Function ;
rdfs:comment "Gets the id of the well bore covered by a given DDR."^^xsd:string ;
......@@ -657,15 +736,15 @@ rhspin:dtypeValue
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject of the value."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The predicate that points to the reified value."^^xsd:string ;
spl:predicate sp:arg2 ;
spl:valueType rdf:Property
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject of the value."^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] .
rhspin:facilityById
......@@ -1245,9 +1324,8 @@ rhspin:npdTripleExists
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
] ;
spin:constraint
[ rdf:type spl:Argument ;
......@@ -1257,8 +1335,9 @@ rhspin:npdTripleExists
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The object to match."^^xsd:string ;
spl:predicate sp:arg3
rdfs:comment "The subject to find"^^xsd:string ;
spl:predicate sp:arg1 ;
spl:valueType rdfs:Resource
] ;
spin:returnType xsd:boolean .
......@@ -1426,86 +1505,86 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b1 sp:varName "subject"^^xsd:string .
_:b2 sp:varName "wellBoreName"^^xsd:string .
_:b31
sp:varName "name"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
_:b30
sp:varName "id"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b29
sp:varName "t4"^^xsd:string .
_:b5 sp:varName "wellName"^^xsd:string .
_:b28
sp:varName "t3"^^xsd:string .
_:b6 sp:varName "well"^^xsd:string .
_:b27
sp:varName "t2"^^xsd:string .
_:b7 sp:varName "company"^^xsd:string .
_:b26
sp:varName "t1"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b25
sp:varName "t0b"^^xsd:string .
_:b9 sp:varName "licence"^^xsd:string .
_:b24
sp:varName "t0a"^^xsd:string .
_:b10
sp:varName "share"^^xsd:string .
_:b23
sp:varName "s2"^^xsd:string .
_:b11
sp:varName "wellBore"^^xsd:string .
_:b22
sp:varName "s1"^^xsd:string .
_:b12
sp:varName "share"^^xsd:string .
_:b21
sp:varName "normalizedStr"^^xsd:string .
_:b13
_:b20
sp:varName "licence"^^xsd:string .
_:b14
sp:varName "company"^^xsd:string .
_:b15
sp:varName "companyName"^^xsd:string .
_:b19
sp:varName "reif"^^xsd:string .
_:b16
sp:varName "company"^^xsd:string .
_:b18
sp:varName "value"^^xsd:string .
_:b17
sp:varName "wellBore"^^xsd:string .
_:b18
sp:varName "value"^^xsd:string .
_:b16
sp:varName "company"^^xsd:string .
_:b19
sp:varName "reif"^^xsd:string .
_:b15
sp:varName "companyName"^^xsd:string .
_:b20
_:b14
sp:varName "company"^^xsd:string .
_:b13
sp:varName "licence"^^xsd:string .
_:b21
sp:varName "normalizedStr"^^xsd:string .
_:b12
sp:varName "share"^^xsd:string .
_:b22
sp:varName "s1"^^xsd:string .
_:b11
sp:varName "wellBore"^^xsd:string .
_:b23
sp:varName "s2"^^xsd:string .
_:b10
sp:varName "share"^^xsd:string .
_:b24
sp:varName "t0a"^^xsd:string .
_:b9 sp:varName "licence"^^xsd:string .
_:b25
sp:varName "t0b"^^xsd:string .
_:b8 sp:varName "wellBore"^^xsd:string .
_:b26
sp:varName "t1"^^xsd:string .
_:b7 sp:varName "company"^^xsd:string .
_:b27
sp:varName "t2"^^xsd:string .
_:b6 sp:varName "well"^^xsd:string .
_:b28
sp:varName "t3"^^xsd:string .
_:b5 sp:varName "wellName"^^xsd:string .
_:b29
sp:varName "t4"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
_:b30
sp:varName "id"^^xsd:string .
_:b3 sp:varName "wellBoreId"^^xsd:string .
_:b31
sp:varName "name"^^xsd:string .
_:b2 sp:varName "wellBoreName"^^xsd:string .
_:b1 sp:varName "subject"^^xsd:string .
......