Holger Knublauch

Mapping of Licence and Company spreadsheets to NPD ontology

This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
1 -<ui:setContext
2 - xmlns:npd="http://www.reportinghub.no/schema/npd#"
3 - ui:queryGraph="&lt;https://www.reportinghub.no/data/npd&gt;"
4 - let:well="{= ui:param('well', rdfs:Resource) }">
5 - [
6 - <ui:forEach ui:resultSet="{#
7 - SELECT ?wellBore ?wellBoreName
8 - WHERE {
9 - ?wellBore npd:partOfWell ?well .
10 - ?wellBore npd:name ?wellBoreName .
11 - } ORDER By ?wellBoreName
12 - }" ui:indexVar="i"><ui:if ui:condition="{= ?i &gt; 0 }">,</ui:if>
13 - {
14 - "value" : "{= ui:escapeJSON(xsd:string(?wellBore)) }",
15 - "label" : "{= ui:escapeJSON(?wellBoreName) }"
16 - }</ui:forEach>
17 - ]
18 -</ui:setContext>
...\ No newline at end of file ...\ No newline at end of file
...@@ -15,17 +15,25 @@ ...@@ -15,17 +15,25 @@
15 @prefix spl: <http://spinrdf.org/spl#> . 15 @prefix spl: <http://spinrdf.org/spl#> .
16 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . 16 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
17 17
18 +<http://spinrdf.org/arg#id>
19 + rdf:type rdf:Property ;
20 + rdfs:label "id"^^xsd:string ;
21 + rdfs:subPropertyOf sp:arg .
22 +
18 <http://spinrdf.org/arg#well> 23 <http://spinrdf.org/arg#well>
19 rdf:type rdf:Property ; 24 rdf:type rdf:Property ;
20 - rdfs:label "well"^^xsd:string . 25 + rdfs:label "well"^^xsd:string ;
26 + rdfs:subPropertyOf sp:arg .
21 27
22 <http://spinrdf.org/arg#wellBoreName> 28 <http://spinrdf.org/arg#wellBoreName>
23 rdf:type rdf:Property ; 29 rdf:type rdf:Property ;
24 - rdfs:label "well bore name"^^xsd:string . 30 + rdfs:label "well bore name"^^xsd:string ;
31 + rdfs:subPropertyOf sp:arg .
25 32
26 <http://spinrdf.org/arg#wellName> 33 <http://spinrdf.org/arg#wellName>
27 rdf:type rdf:Property ; 34 rdf:type rdf:Property ;
28 - rdfs:label "well name"^^xsd:string . 35 + rdfs:label "well name"^^xsd:string ;
36 + rdfs:subPropertyOf sp:arg .
29 37
30 <http://www.reportinghub.no/spin/rh> 38 <http://www.reportinghub.no/spin/rh>
31 rdf:type owl:Ontology ; 39 rdf:type owl:Ontology ;
...@@ -62,6 +70,51 @@ rhspin:GetWellBoresOfWell ...@@ -62,6 +70,51 @@ rhspin:GetWellBoresOfWell
62 spl:valueType <http://www.reportinghub.no/schema/npd#Well> 70 spl:valueType <http://www.reportinghub.no/schema/npd#Well>
63 ] . 71 ] .
64 72
73 +rhspin:companyById
74 + rdf:type spin:Function ;
75 + rdfs:label "company by id"^^xsd:string ;
76 + rdfs:subClassOf spl:URIFunctions ;
77 + spin:body
78 + [ rdf:type sp:Select ;
79 + sp:resultVariables ([ rdf:type sp:iri ;
80 + sp:arg1 [ rdf:type fn:concat ;
81 + sp:arg1 "https://www.reportinghub.no/data/npd/Company-" ;
82 + sp:arg2 [ sp:varName "id"^^xsd:string
83 + ]
84 + ]
85 + ]) ;
86 + sp:where ()
87 + ] ;
88 + spin:constraint
89 + [ rdf:type spl:Argument ;
90 + rdfs:comment "The NPD id of the company."^^xsd:string ;
91 + spl:predicate <http://spinrdf.org/arg#id> ;
92 + spl:valueType xsd:string
93 + ] .
94 +
95 +rhspin:licenceById
96 + rdf:type spin:Function ;
97 + rdfs:label "license by id"^^xsd:string ;
98 + rdfs:subClassOf spl:URIFunctions ;
99 + spin:body
100 + [ rdf:type sp:Select ;
101 + sp:resultVariables ([ rdf:type sp:iri ;
102 + sp:arg1 [ rdf:type fn:concat ;
103 + sp:arg1 "https://www.reportinghub.no/data/npd/Licence-" ;
104 + sp:arg2 [ sp:varName "id"^^xsd:string
105 + ]
106 + ]
107 + ]) ;
108 + sp:where ()
109 + ] ;
110 + spin:constraint
111 + [ rdf:type spl:Argument ;
112 + rdfs:comment "The id of the license."^^xsd:string ;
113 + spl:predicate <http://spinrdf.org/arg#id> ;
114 + spl:valueType xsd:string
115 + ] ;
116 + spin:returnType <http://www.reportinghub.no/schema/npd#License> .
117 +
65 rhspin:userName 118 rhspin:userName
66 rdf:type spin:Function ; 119 rdf:type spin:Function ;
67 rdfs:comment "Gets the name of the currently logged in user."^^xsd:string ; 120 rdfs:comment "Gets the name of the currently logged in user."^^xsd:string ;
......
1 +# baseURI: file:///www.reportinghub.no/transform/npd/company
2 +# imports: http://topbraid.org/tables
3 +
4 +@prefix company: <file:///www.reportinghub.no/transform/npd/company#> .
5 +@prefix owl: <http://www.w3.org/2002/07/owl#> .
6 +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
7 +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
8 +@prefix tables: <http://topbraid.org/tables#> .
9 +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
10 +
11 +<file:///www.reportinghub.no/transform/npd/company>
12 + rdf:type owl:Ontology ;
13 + owl:imports <http://topbraid.org/tables> .
14 +
15 +company:Company
16 + rdf:type owl:Class ;
17 + rdfs:label "Company"^^xsd:string ;
18 + tables:sheetIndex "0"^^xsd:int .
19 +
20 +company:cmpGroup
21 + rdf:type owl:DatatypeProperty ;
22 + rdfs:domain company:Company ;
23 + rdfs:label "cmpGroup" ;
24 + rdfs:range xsd:string ;
25 + tables:columnIndex "2"^^xsd:int .
26 +
27 +company:cmpLicenceLicenseeCurrent
28 + rdf:type owl:DatatypeProperty ;
29 + rdfs:domain company:Company ;
30 + rdfs:label "cmpLicenceLicenseeCurrent" ;
31 + rdfs:range xsd:string ;
32 + tables:columnIndex "7"^^xsd:int .
33 +
34 +company:cmpLicenceLicenseeFormer
35 + rdf:type owl:DatatypeProperty ;
36 + rdfs:domain company:Company ;
37 + rdfs:label "cmpLicenceLicenseeFormer" ;
38 + rdfs:range xsd:string ;
39 + tables:columnIndex "8"^^xsd:int .
40 +
41 +company:cmpLicenceOperCurrent
42 + rdf:type owl:DatatypeProperty ;
43 + rdfs:domain company:Company ;
44 + rdfs:label "cmpLicenceOperCurrent" ;
45 + rdfs:range xsd:string ;
46 + tables:columnIndex "5"^^xsd:int .
47 +
48 +company:cmpLicenceOperFormer
49 + rdf:type owl:DatatypeProperty ;
50 + rdfs:domain company:Company ;
51 + rdfs:label "cmpLicenceOperFormer" ;
52 + rdfs:range xsd:string ;
53 + tables:columnIndex "6"^^xsd:int .
54 +
55 +company:cmpLongName
56 + rdf:type owl:DatatypeProperty ;
57 + rdfs:domain company:Company ;
58 + rdfs:label "cmpLongName"^^xsd:string ;
59 + rdfs:range xsd:string ;
60 + tables:columnIndex "0"^^xsd:int .
61 +
62 +company:cmpNpdidCompany
63 + rdf:type owl:DatatypeProperty ;
64 + rdfs:domain company:Company ;
65 + rdfs:label "cmpNpdidCompany" ;
66 + rdfs:range xsd:string ;
67 + tables:columnIndex "4"^^xsd:int .
68 +
69 +company:cmpOrgNumberBrReg
70 + rdf:type owl:DatatypeProperty ;
71 + rdfs:domain company:Company ;
72 + rdfs:label "cmpOrgNumberBrReg" ;
73 + rdfs:range xsd:string ;
74 + tables:columnIndex "1"^^xsd:int .
75 +
76 +company:cmpShortName
77 + rdf:type owl:DatatypeProperty ;
78 + rdfs:domain company:Company ;
79 + rdfs:label "cmpShortName" ;
80 + rdfs:range xsd:string ;
81 + tables:columnIndex "3"^^xsd:int .
82 +
83 +company:dateSyncNPD
84 + rdf:type owl:DatatypeProperty ;
85 + rdfs:domain company:Company ;
86 + rdfs:label "dateSyncNPD" ;
87 + rdfs:range xsd:string ;
88 + tables:columnIndex "9"^^xsd:int .
1 +# baseURI: file:///www.reportinghub.no/transform/npd/licence
2 +# imports: http://topbraid.org/tables
3 +
4 +@prefix licence: <file:///www.reportinghub.no/examples/transform/npd/licence-2011-07-30.csv#> .
5 +@prefix owl: <http://www.w3.org/2002/07/owl#> .
6 +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
7 +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
8 +@prefix tables: <http://topbraid.org/tables#> .
9 +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
10 +
11 +licence:Licence
12 + rdf:type owl:Class ;
13 + rdfs:label "Licence"^^xsd:string ;
14 + tables:sheetIndex "0"^^xsd:int .
15 +
16 +licence:datesyncNPD
17 + rdf:type owl:DatatypeProperty ;
18 + rdfs:domain licence:Licence ;
19 + rdfs:label "DatesyncNPD" ;
20 + rdfs:range xsd:string ;
21 + tables:columnIndex "8"^^xsd:int .
22 +
23 +licence:prlCurrentArea
24 + rdf:type owl:DatatypeProperty ;
25 + rdfs:domain licence:Licence ;
26 + rdfs:label "prlCurrentArea" ;
27 + rdfs:range xsd:string ;
28 + tables:columnIndex "6"^^xsd:int .
29 +
30 +licence:prlDateGranted
31 + rdf:type owl:DatatypeProperty ;
32 + rdfs:domain licence:Licence ;
33 + rdfs:label "prlDateGranted" ;
34 + rdfs:range xsd:string ;
35 + tables:columnIndex "3"^^xsd:int .
36 +
37 +licence:prlDateValidTo
38 + rdf:type owl:DatatypeProperty ;
39 + rdfs:domain licence:Licence ;
40 + rdfs:label "prlDateValidTo" ;
41 + rdfs:range xsd:string ;
42 + tables:columnIndex "4"^^xsd:int .
43 +
44 +licence:prlLicensingActivityName
45 + rdf:type owl:DatatypeProperty ;
46 + rdfs:domain licence:Licence ;
47 + rdfs:label "prlLicensingActivityName" ;
48 + rdfs:range xsd:string ;
49 + tables:columnIndex "1"^^xsd:int .
50 +
51 +licence:prlName
52 + rdf:type owl:DatatypeProperty ;
53 + rdfs:domain licence:Licence ;
54 + rdfs:label "ÔªøprlName" ;
55 + rdfs:range xsd:string ;
56 + tables:columnIndex "0"^^xsd:int .
57 +
58 +licence:prlNpdidLicence
59 + rdf:type owl:DatatypeProperty ;
60 + rdfs:domain licence:Licence ;
61 + rdfs:label "prlNpdidLicence" ;
62 + rdfs:range xsd:string ;
63 + tables:columnIndex "7"^^xsd:int .
64 +
65 +licence:prlOriginalArea
66 + rdf:type owl:DatatypeProperty ;
67 + rdfs:domain licence:Licence ;
68 + rdfs:label "prlOriginalArea" ;
69 + rdfs:range xsd:string ;
70 + tables:columnIndex "5"^^xsd:int .
71 +
72 +licence:prlStatus
73 + rdf:type owl:DatatypeProperty ;
74 + rdfs:domain licence:Licence ;
75 + rdfs:label "prlStatus" ;
76 + rdfs:range xsd:string ;
77 + tables:columnIndex "2"^^xsd:int .
78 +
79 +<file:///www.reportinghub.no/transform/npd/licence>
80 + rdf:type owl:Ontology ;
81 + owl:imports <http://topbraid.org/tables> .