Holger Knublauch

Renamed to .spin. file

Updated download page to new NPD namespace
<html xmlns:npd="http://www.reportinghub.no/schema/npd#">
<html>
<head>
<title>ReportingHub - Download DDR</title>
<link rel="stylesheet" type="text/css" href="lib/rh/rh.css" />
......@@ -37,8 +37,8 @@
<ui:forEach ui:resultSet="{#
SELECT ?well ?wellName
WHERE {
GRAPH &lt;https://www.reportinghub.no/data/npd&gt; {
?well a npd:Well .
GRAPH npdata:npd {
?well a ep-well:Well .
?well npd:name ?wellName .
}
} ORDER BY ?wellName
......
......@@ -8,6 +8,7 @@
# imports: http://www.reportinghub.no/np/schema/1.0/npd
@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#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
......@@ -48,6 +49,10 @@
rdfs:label "well name"^^xsd:string ;
rdfs:subPropertyOf sp:arg .
npdata:npd
rdf:type rdfs:Resource ;
rdfs:label "NPDI"^^xsd:string .
<http://www.reportinghub.no/spin/rh>
rdf:type owl:Ontology ;
rdfs:comment "A collection of SPIN functions and templates to support working with the ReportingHub schemas."^^xsd:string ;
......@@ -56,7 +61,7 @@
rhspin:GetWellBoresOfWell
rdf:type spin:SelectTemplate ;
rdfs:comment "Gets an ordered list of well bores that belong to a given Well. Result variables are ?wellBore and ?wellBoreName."^^xsd:string ;
rdfs:comment "Gets an ordered list of well bores that belong to a given Well. Result variables are ?wellBoreId and ?wellBoreName."^^xsd:string ;
rdfs:label "Get well bores of well"^^xsd:string ;
rdfs:subClassOf spin:SelectTemplates ;
spin:body
......@@ -68,12 +73,15 @@ rhspin:GetWellBoresOfWell
[ sp:varName "well"^^xsd:string
] ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#partOfWell> ;
sp:subject _:b2
sp:subject _:b3
] [ sp:object _:b1 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b2
sp:subject _:b3
] [ sp:object _:b2 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
sp:subject _:b3
]) ;
sp:graphNameNode <https://www.reportinghub.no/np/data/npd>
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
......@@ -135,7 +143,7 @@ rhspin:companyHasLicenceForWellBore
spin:body
[ rdf:type sp:Select ;
sp:distinct "true"^^xsd:boolean ;
sp:resultVariables (_:b3) ;
sp:resultVariables (_:b4) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type xsd:date ;
......@@ -148,37 +156,37 @@ rhspin:companyHasLicenceForWellBore
sp:arg3 10
]
] ;
sp:variable _:b4
sp:variable _:b5
] [ sp:object spin:_arg1 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#shareHolder> ;
sp:subject _:b5
] [ sp:object _:b6 ;
sp:subject _:b6
] [ sp:object _:b7 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#licenceShared> ;
sp:subject _:b5
sp:subject _:b6
] [ sp:object <http://www.reportinghub.no/np/schema/npd#LS_Active> ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#licenceStatus> ;
sp:subject _:b6
] [ sp:object _:b7 ;
sp:subject _:b7
] [ sp:object _:b8 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#startDate> ;
sp:subject _:b6
sp:subject _:b7
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:le ;
sp:arg1 _:b7 ;
sp:arg2 _:b4
sp:arg1 _:b8 ;
sp:arg2 _:b5
]
] [ sp:object _:b8 ;
] [ sp:object _:b9 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#endDate> ;
sp:subject _:b6
sp:subject _:b7
] [ rdf:type sp:Filter ;
sp:expression
[ rdf:type sp:gt ;
sp:arg1 _:b8 ;
sp:arg2 _:b4
sp:arg1 _:b9 ;
sp:arg2 _:b5
]
] [ sp:object _:b6 ;
] [ sp:object _:b7 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
sp:subject _:b3
sp:subject _:b4
])
] ;
spin:constraint
......@@ -285,7 +293,7 @@ rhspin:normalizeString
rdfs:subClassOf spl:StringFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b9) ;
sp:resultVariables (_:b10) ;
sp:where ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
......@@ -293,67 +301,67 @@ rhspin:normalizeString
sp:arg2 "\\((.*)\\)" ;
sp:arg3 ""
] ;
sp:variable _:b10
sp:variable _:b11
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:trim ;
sp:arg1 _:b10
sp:arg1 _:b11
] ;
sp:variable _:b11
sp:variable _:b12
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:encodeURL ;
sp:arg1 _:b11
sp:arg1 _:b12
] ;
sp:variable _:b12
sp:variable _:b13
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b12 ;
sp:arg1 _:b13 ;
sp:arg2 "%2F" ;
sp:arg3 "_"
] ;
sp:variable _:b13
sp:variable _:b14
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b13 ;
sp:arg1 _:b14 ;
sp:arg2 "%[0-9A-F][0-9A-F]" ;
sp:arg3 ""
] ;
sp:variable _:b14
sp:variable _:b15
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b14 ;
sp:arg1 _:b15 ;
sp:arg2 "\\+" ;
sp:arg3 "_"
] ;
sp:variable _:b15
sp:variable _:b16
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b15 ;
sp:arg1 _:b16 ;
sp:arg2 "_+" ;
sp:arg3 "_"
] ;
sp:variable _:b16
sp:variable _:b17
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:regex ;
sp:arg1 _:b16 ;
sp:arg1 _:b17 ;
sp:arg2 "\\*" ;
sp:arg3 ""
] ;
sp:variable _:b17
sp:variable _:b18
] [ rdf:type sp:Bind ;
sp:expression
[ rdf:type xsd:string ;
sp:arg1 [ rdf:type spif:upperCase ;
sp:arg1 _:b17
sp:arg1 _:b18
]
] ;
sp:variable _:b9
sp:variable _:b10
])
] ;
spin:constraint
......@@ -451,29 +459,29 @@ rhspin:wellBoreByName
rdfs:subClassOf spl:URIFunctions ;
spin:body
[ rdf:type sp:Select ;
sp:resultVariables (_:b18) ;
sp:resultVariables (_:b19) ;
sp:where ([ rdf:type sp:NamedGraph ;
sp:elements ([ rdf:type sp:Union ;
sp:elements (([ sp:object _:b19 ;
sp:elements (([ sp:object _:b20 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b18
sp:subject _:b19
]) ([ rdf:type sp:Bind ;
sp:expression
[ rdf:type spif:replaceAll ;
sp:arg1 _:b19 ;
sp:arg1 _:b20 ;
sp:arg2 "/0" ;
sp:arg3 "/"
] ;
sp:variable _:b20
] [ sp:object _:b20 ;
sp:variable _:b21
] [ sp:object _:b21 ;
sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
sp:subject _:b18
sp:subject _:b19
]))
] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ;
sp:predicate rdf:type ;
sp:subject _:b18
sp:subject _:b19
]) ;
sp:graphNameNode <http://www.reportinghub.no/np/data/npd>
sp:graphNameNode npdata:npd
])
] ;
spin:constraint
......@@ -510,53 +518,56 @@ rhspin:wellByName
] ;
spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
_:b20
_:b2 sp:varName "wellBoreId"^^xsd:string .
_:b1 sp:varName "wellBoreName"^^xsd:string .
_:b3 sp:varName "wellBore"^^xsd:string .
_:b21
sp:varName "str"^^xsd:string .
_:b19
_:b20
sp:varName "wellBoreName"^^xsd:string .
_:b18
_:b19
sp:varName "wellBore"^^xsd:string .
_:b17
_:b18
sp:varName "t4"^^xsd:string .
_:b16
_:b17
sp:varName "t3"^^xsd:string .
_:b15
_:b16
sp:varName "t2"^^xsd:string .
_:b14
_:b15
sp:varName "t1"^^xsd:string .
_:b13
_:b14
sp:varName "t0b"^^xsd:string .
_:b12
_:b13
sp:varName "t0a"^^xsd:string .
_:b11
_:b12
sp:varName "s2"^^xsd:string .
_:b10
_:b11
sp:varName "s1"^^xsd:string .
_:b9 sp:varName "normalizedStr"^^xsd:string .
_:b8 sp:varName "endDate"^^xsd:string .
_:b7 sp:varName "startDate"^^xsd:string .
_:b10
sp:varName "normalizedStr"^^xsd:string .
_:b6 sp:varName "licence"^^xsd:string .
_:b9 sp:varName "endDate"^^xsd:string .
_:b5 sp:varName "share"^^xsd:string .
_:b8 sp:varName "startDate"^^xsd:string .
_:b4 sp:varName "nowDate"^^xsd:string .
_:b7 sp:varName "licence"^^xsd:string .
_:b3 sp:varName "wellBore"^^xsd:string .
_:b6 sp:varName "share"^^xsd:string .
_:b2 sp:varName "wellBore"^^xsd:string .
_:b5 sp:varName "nowDate"^^xsd:string .
_:b1 sp:varName "wellBoreName"^^xsd:string .
_:b4 sp:varName "wellBore"^^xsd:string .
......