Holger Knublauch

Added rhspin:graphForDDR

......@@ -8,6 +8,7 @@
# imports: http://www.reportinghub.no/ep/schema/1.0/report
# imports: http://www.reportinghub.no/np/schema/1.0/npd
@prefix arg: <http://spinrdf.org/arg#> .
@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
@prefix npdata: <http://www.reportinghub.no/np/data/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
......@@ -20,57 +21,62 @@
@prefix spl: <http://spinrdf.org/spl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<http://spinrdf.org/arg#company>
arg:company
rdf:type rdf:Property ;
rdfs:label "company"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#companyName>
arg:companyName
rdf:type rdf:Property ;
rdfs:label "company name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#ddr>
arg:ddr
rdf:type rdf:Property ;
rdfs:label "ddr"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#id>
arg:id
rdf:type rdf:Property ;
rdfs:label "id"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#name>
arg:licence
rdf:type rdf:Property ;
rdfs:label "licence"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
arg:name
rdf:type rdf:Property ;
rdfs:label "name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#report>
arg:report
rdf:type rdf:Property ;
rdfs:label "report"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#resource>
arg:resource
rdf:type rdf:Property ;
rdfs:label "resource"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#well>
arg:well
rdf:type rdf:Property ;
rdfs:label "well"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#wellBore>
arg:wellBore
rdf:type rdf:Property ;
rdfs:label "well bore"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#wellBoreName>
arg:wellBoreName
rdf:type rdf:Property ;
rdfs:label "well bore name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
<http://spinrdf.org/arg#wellName>
arg:wellName
rdf:type rdf:Property ;
rdfs:label "well name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
......@@ -92,15 +98,15 @@
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
] ;
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
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The value to match against."^^xsd:string ;
spl:predicate sp:arg1
] ;
spin:returnType rdfs:Resource .
npdata:npd
......@@ -121,7 +127,7 @@ rhspin:DDRTableTemplates
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR that serves as root of the query."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#report> ;
spl:predicate arg:report ;
spl:valueType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
] .
......@@ -153,7 +159,7 @@ rhspin:GetWellBoresOfWell
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The Well to get the bores of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#well> ;
spl:predicate arg:well ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#Well>
] .
......@@ -195,7 +201,7 @@ rhspin:GetWellsOfCompanyName
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The name of a company."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#companyName> ;
spl:predicate arg:companyName ;
spl:valueType xsd:string
] .
......@@ -229,7 +235,7 @@ rhspin:baaById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id of the BAA."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
......@@ -251,7 +257,7 @@ rhspin:companyById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id of the company."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
......@@ -349,7 +355,7 @@ rhspin:companyWithName
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The name of the Company to get."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#name> ;
spl:predicate arg:name ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/organization#Company> .
......@@ -378,7 +384,7 @@ rhspin:ddrActivityStartDate
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DailyDrillingReport to get the start date of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#ddr> ;
spl:predicate arg:ddr ;
spl:valueType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
] ;
spin:returnType xsd:date .
......@@ -415,7 +421,7 @@ rhspin:ddrWellBoreId
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DailyDrillingReport to get the start date of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#ddr> ;
spl:predicate arg:ddr ;
spl:valueType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
] ;
spin:returnType xsd:string .
......@@ -438,7 +444,7 @@ rhspin:discoveryById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id of the Discovery."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
......@@ -460,15 +466,15 @@ rhspin:dtypeValue
] ;
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
] ;
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
] .
rhspin:facilityById
......@@ -489,7 +495,7 @@ rhspin:facilityById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id of the facility."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
......@@ -511,10 +517,59 @@ rhspin:fieldById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id of the field."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
rhspin:graphForDDR
rdf:type spin:Function ;
rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given DDR."^^xsd:string ;
rdfs:label "graph for DDR"^^xsd:string ;
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables ([ rdf:type sp:iri ;
sp:arg1 _:b20
]) ;
sp:where ([ rdf:type sp:TriplePath ;
sp:object _:b21 ;
sp:path [ rdf:type sp:SeqPath ;
sp:path1
[ rdf:type sp:SeqPath ;
sp:path1 <http://www.reportinghub.no/ep/schema/activity#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:NamedGraph ;
sp:elements ([ sp:object _:b22 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject _:b21
] [ sp:object _:b23 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject _:b22
]) ;
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 _:b23
] ;
sp:variable _:b20
])
] ;
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The DDR to get the graph for."^^xsd:string ;
spl:predicate arg:ddr ;
spl:valueType <http://www.reportinghub.no/ep/schema/report#DailyDrillingReport>
] ;
spin:returnType rdfs:Resource .
rhspin:licenceById
rdf:type spin:Function ;
rdfs:label "license by id"^^xsd:string ;
......@@ -533,7 +588,7 @@ rhspin:licenceById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the license."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Licence> .
......@@ -545,9 +600,9 @@ rhspin:licenceForWellBore
rdfs:subClassOf spin:Functions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b20) ;
sp:resultVariables (_:b24) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b20 ;
sp:elements ([ sp:object _:b24 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject
[ sp:varName "wellBore"^^xsd:string
......@@ -559,7 +614,7 @@ rhspin:licenceForWellBore
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The WellBore to get the licence of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellBore> ;
spl:predicate arg:wellBore ;
spl:valueType <http://www.reportinghub.no/ep/schema/well#WellBore>
] ;
spin:returnType <http://www.reportinghub.no/np/schema/npd#Licence> .
......@@ -571,7 +626,7 @@ rhspin:normalizeString
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b21) ;
sp:resultVariables (_:b25) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
......@@ -579,67 +634,67 @@ rhspin:normalizeString
sp:arg2 "\\((.*)\\)" ;
sp:arg3 ""
] ;
sp:variable _:b22
sp:variable _:b26
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:trim ;
sp:arg1 _:b22
sp:arg1 _:b26
] ;
sp:variable _:b23
sp:variable _:b27
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:encodeURL ;
sp:arg1 _:b23
sp:arg1 _:b27
] ;
sp:variable _:b24
sp:variable _:b28
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b24 ;
sp:arg1 _:b28 ;
sp:arg2 "%2F" ;
sp:arg3 "_"
] ;
sp:variable _:b25
sp:variable _:b29
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b25 ;
sp:arg1 _:b29 ;
sp:arg2 "%[0-9A-F][0-9A-F]" ;
sp:arg3 ""
] ;
sp:variable _:b26
sp:variable _:b30
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b26 ;
sp:arg1 _:b30 ;
sp:arg2 "\\+" ;
sp:arg3 "_"
] ;
sp:variable _:b27
sp:variable _:b31
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b27 ;
sp:arg1 _:b31 ;
sp:arg2 "_+" ;
sp:arg3 "_"
] ;
sp:variable _:b28
sp:variable _:b32
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b28 ;
sp:arg1 _:b32 ;
sp:arg2 "\\*" ;
sp:arg3 ""
] ;
sp:variable _:b29
sp:variable _:b33
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type xsd:string ;
sp:arg1 [ rdf:type spif:upperCase ;
sp:arg1 _:b29
sp:arg1 _:b33
]
] ;
sp:variable _:b21
sp:variable _:b25
])
] ;
spin:constraint
......@@ -656,9 +711,9 @@ rhspin:npdId
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b30) ;
sp:resultVariables (_:b34) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b30 ;
sp:elements ([ sp:object _:b34 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject
[ sp:varName "resource"^^xsd:string
......@@ -670,7 +725,7 @@ rhspin:npdId
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The resource to get the npd:id of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#resource> ;
spl:predicate arg:resource ;
spl:valueType <http://www.reportinghub.no/np/schema/npd#NPDIndividual>
] .
......@@ -681,9 +736,9 @@ rhspin:npdName
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b31) ;
sp:resultVariables (_:b35) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ sp:object _:b31 ;
sp:elements ([ sp:object _:b35 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject
[ sp:varName "resource"^^xsd:string
......@@ -695,7 +750,7 @@ rhspin:npdName
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD resource to get the name of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#resource> ;
spl:predicate arg:resource ;
spl:valueType <http://www.reportinghub.no/np/schema/npd#NPDIndividual>
] ;
spin:returnType xsd:string .
......@@ -717,8 +772,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:constraint
[ rdf:type spl:Argument ;
......@@ -728,9 +784,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:returnType xsd:boolean .
......@@ -755,7 +810,7 @@ rhspin:parentCompanyByName
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD name of the parent company to get the URI of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#name> ;
spl:predicate arg:name ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#WellBore> .
......@@ -785,7 +840,7 @@ rhspin:tufById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD id of the TUF."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] .
......@@ -817,7 +872,7 @@ rhspin:wellBoreById
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The id of the well bore."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#id> ;
spl:predicate arg:id ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#WellBore> .
......@@ -829,16 +884,16 @@ rhspin:wellBoreByName
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b32) ;
sp:resultVariables (_:b36) ;
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 _:b32
sp:subject _:b36
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b32
sp:subject _:b36
]) ;
sp:graphNameNode npdata:npd
])
......@@ -846,7 +901,7 @@ rhspin:wellBoreByName
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The name of the well bore."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellBoreName> ;
spl:predicate arg:wellBoreName ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#WellBore> .
......@@ -872,48 +927,60 @@ rhspin:wellByName
spin:constraint
[ rdf:type spl:Argument ;
rdfs:comment "The NPD name of the well to get the URI of."^^xsd:string ;
spl:predicate <http://spinrdf.org/arg#wellName> ;
spl:predicate arg:wellName ;
spl:valueType xsd:string
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b32
_:b20
sp:varName "uri"^^xsd:string .
_:b23
sp:varName "id"^^xsd:string .
_:b22
sp:varName "licence"^^xsd:string .
_:b21
sp:varName "wellBore"^^xsd:string .
_:b31
_:b36
sp:varName "wellBore"^^xsd:string .
_:b35
sp:varName "name"^^xsd:string .
_:b30
_:b34
sp:varName "id"^^xsd:string .
_:b29
_:b33
sp:varName "t4"^^xsd:string .
_:b28
_:b32
sp:varName "t3"^^xsd:string .
_:b27
_:b31
sp:varName "t2"^^xsd:string .
_:b26
_:b30
sp:varName "t1"^^xsd:string .
_:b25
_:b29
sp:varName "t0b"^^xsd:string .
_:b24
_:b28
sp:varName "t0a"^^xsd:string .
_:b23
_:b27
sp:varName "s2"^^xsd:string .
_:b22
_:b26
sp:varName "s1"^^xsd:string .
_:b21
_:b25
sp:varName "normalizedStr"^^xsd:string .
_:b20
_:b24
sp:varName "licence"^^xsd:string .
_:b19
......