Holger Knublauch

Added npd:licenceOperator and mapping to fill it, changed upload

constraints
...@@ -92,15 +92,27 @@ ...@@ -92,15 +92,27 @@
92 sp:arg1 [ sp:varName "company"^^xsd:string 92 sp:arg1 [ sp:varName "company"^^xsd:string
93 ] 93 ]
94 ] 94 ]
95 - ] [ rdf:type sp:NotExists ; 95 + ] [ rdf:type sp:Bind ;
96 - sp:elements ([ sp:object 96 + sp:expression
97 - [ sp:varName "wellBore"^^xsd:string 97 + [ rdf:type rhspin:licenceForWellBore ;
98 - ] ; 98 + arg:wellBore
99 - sp:predicate rhspin:companyHasLicenceForWellBore ; 99 + [ sp:varName "wellBore"^^xsd:string
100 - sp:subject 100 + ]
101 - [ sp:varName "company"^^xsd:string 101 + ] ;
102 - ] 102 + sp:variable
103 - ]) 103 + [ sp:varName "licence"^^xsd:string
104 + ]
105 + ] [ rdf:type sp:Filter ;
106 + sp:expression
107 + [ rdf:type sp:not ;
108 + sp:arg1 [ rdf:type rhspin:npdTripleExists ;
109 + sp:arg1 [ sp:varName "licence"^^xsd:string
110 + ] ;
111 + sp:arg2 <http://www.reportinghub.no/np/schema/npd#licenceOperator> ;
112 + sp:arg3 [ sp:varName "company"^^xsd:string
113 + ]
114 + ]
115 + ]
104 ] [ rdf:type sp:Bind ; 116 ] [ rdf:type sp:Bind ;
105 sp:expression 117 sp:expression
106 [ rdf:type sp:coalesce ; 118 [ rdf:type sp:coalesce ;
...@@ -112,7 +124,20 @@ ...@@ -112,7 +124,20 @@
112 sp:arg2 "Unknown well bore" 124 sp:arg2 "Unknown well bore"
113 ] ; 125 ] ;
114 sp:variable 126 sp:variable
115 - [ sp:varName "displayName"^^xsd:string 127 + [ sp:varName "wellBoreName"^^xsd:string
128 + ]
129 + ] [ rdf:type sp:Bind ;
130 + sp:expression
131 + [ rdf:type sp:coalesce ;
132 + sp:arg1 [ rdf:type rhspin:npdName ;
133 + arg:resource
134 + [ sp:varName "licence"^^xsd:string
135 + ]
136 + ] ;
137 + sp:arg2 "Unknown licence"
138 + ] ;
139 + sp:variable
140 + [ sp:varName "licenceName"^^xsd:string
116 ] 141 ]
117 ] [ rdf:type sp:Bind ; 142 ] [ rdf:type sp:Bind ;
118 sp:expression 143 sp:expression
...@@ -120,8 +145,11 @@ ...@@ -120,8 +145,11 @@
120 sp:arg1 "Your company (" ; 145 sp:arg1 "Your company (" ;
121 sp:arg2 [ sp:varName "companyName"^^xsd:string 146 sp:arg2 [ sp:varName "companyName"^^xsd:string
122 ] ; 147 ] ;
123 - sp:arg3 ") does not hold a licence for well bore " ; 148 + sp:arg3 ") is not the operator of licence " ;
124 - sp:arg4 [ sp:varName "displayName"^^xsd:string 149 + sp:arg4 [ sp:varName "licenceName"^^xsd:string
150 + ] ;
151 + sp:arg5 " for well bore " ;
152 + sp:arg6 [ sp:varName "wellBoreName"^^xsd:string
125 ] 153 ]
126 ] ; 154 ] ;
127 sp:variable 155 sp:variable
......
This diff could not be displayed because it is too large.
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
7 # imports: file:///www.reportinghub.no/transform/npd/facilitymoveable 7 # imports: file:///www.reportinghub.no/transform/npd/facilitymoveable
8 # imports: file:///www.reportinghub.no/transform/npd/field 8 # imports: file:///www.reportinghub.no/transform/npd/field
9 # imports: file:///www.reportinghub.no/transform/npd/licence 9 # imports: file:///www.reportinghub.no/transform/npd/licence
10 +# imports: file:///www.reportinghub.no/transform/npd/licenceop
10 # imports: file:///www.reportinghub.no/transform/npd/licensee 11 # imports: file:///www.reportinghub.no/transform/npd/licensee
11 # imports: file:///www.reportinghub.no/transform/npd/tufoperator 12 # imports: file:///www.reportinghub.no/transform/npd/tufoperator
12 # imports: file:///www.reportinghub.no/transform/npd/wbdev 13 # imports: file:///www.reportinghub.no/transform/npd/wbdev
...@@ -24,8 +25,8 @@ ...@@ -24,8 +25,8 @@
24 25
25 @prefix : <http://www.reportinghub.no/transform/spreadsheets2npd#> . 26 @prefix : <http://www.reportinghub.no/transform/spreadsheets2npd#> .
26 @prefix arg: <http://spinrdf.org/arg#> . 27 @prefix arg: <http://spinrdf.org/arg#> .
27 -@prefix baa-2011-07-30: <file:///www.reportinghub.no/transform/npd/baa-2011-07-30#> .
28 @prefix fn: <http://www.w3.org/2005/xpath-functions#> . 28 @prefix fn: <http://www.w3.org/2005/xpath-functions#> .
29 +@prefix licenceop: <file:///www.reportinghub.no/transform/npd/licenceop#> .
29 @prefix npdi: <http://www.reportinghub.no/np/data/npd/> . 30 @prefix npdi: <http://www.reportinghub.no/np/data/npd/> .
30 @prefix owl: <http://www.w3.org/2002/07/owl#> . 31 @prefix owl: <http://www.w3.org/2002/07/owl#> .
31 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . 32 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
...@@ -651,6 +652,60 @@ ...@@ -651,6 +652,60 @@
651 <http://www.reportinghub.no/np/schema/npd#licensingActivity> 652 <http://www.reportinghub.no/np/schema/npd#licensingActivity>
652 ] . 653 ] .
653 654
655 +licenceop:LicenceOp
656 + spinmap:rule
657 + [ rdf:type spinmap:Mapping-0-1 ;
658 + spinmap:context :LicenceOp-Licence ;
659 + spinmap:expression <http://www.reportinghub.no/np/schema/npd#Licence> ;
660 + spinmap:targetPredicate1
661 + rdf:type
662 + ] ;
663 + spinmap:rule
664 + [ rdf:type sp:Construct ;
665 + sp:templates ([ sp:object
666 + [ sp:varName "operator"^^xsd:string
667 + ] ;
668 + sp:predicate <http://www.reportinghub.no/np/schema/npd#licenceOperator> ;
669 + sp:subject
670 + [ sp:varName "target"^^xsd:string
671 + ]
672 + ]) ;
673 + sp:where ([ rdf:type sp:Filter ;
674 + sp:expression
675 + [ rdf:type sp:notExists ;
676 + sp:elements ([ sp:object
677 + [ sp:varName "dateTo"^^xsd:string
678 + ] ;
679 + sp:predicate licenceop:prlOperDateValidTo ;
680 + sp:subject spin:_this
681 + ])
682 + ]
683 + ] [ sp:object
684 + [ sp:varName "companyId"^^xsd:string
685 + ] ;
686 + sp:predicate licenceop:cmpNpdidCompany ;
687 + sp:subject spin:_this
688 + ] [ rdf:type sp:Bind ;
689 + sp:expression
690 + [ rdf:type rhspin:companyById ;
691 + arg:id [ sp:varName "companyId"^^xsd:string
692 + ]
693 + ] ;
694 + sp:variable
695 + [ sp:varName "operator"^^xsd:string
696 + ]
697 + ] [ rdf:type sp:Bind ;
698 + sp:expression
699 + [ rdf:type spinmap:targetResource ;
700 + sp:arg1 spin:_this ;
701 + spinmap:context :LicenceOp-Licence
702 + ] ;
703 + sp:variable
704 + [ sp:varName "target"^^xsd:string
705 + ]
706 + ])
707 + ] .
708 +
654 <file:///www.reportinghub.no/transform/npd/licensee#Licensee> 709 <file:///www.reportinghub.no/transform/npd/licensee#Licensee>
655 spinmap:rule 710 spinmap:rule
656 [ rdf:type spinmap:Mapping-1-1 ; 711 [ rdf:type spinmap:Mapping-1-1 ;
...@@ -1339,7 +1394,7 @@ arg:wellName ...@@ -1339,7 +1394,7 @@ arg:wellName
1339 <http://www.reportinghub.no/transform/spreadsheets2npd> 1394 <http://www.reportinghub.no/transform/spreadsheets2npd>
1340 rdf:type owl:Ontology ; 1395 rdf:type owl:Ontology ;
1341 rdfs:comment "Takes spreadsheets imported from the NPD fact pages and maps them into the NPD ontology."^^xsd:string ; 1396 rdfs:comment "Takes spreadsheets imported from the NPD fact pages and maps them into the NPD ontology."^^xsd:string ;
1342 - owl:imports <file:///www.reportinghub.no/transform/npd/baa> , <file:///www.reportinghub.no/transform/npd/baalicensee> , <file:///www.reportinghub.no/transform/npd/company> , <file:///www.reportinghub.no/transform/npd/discovery> , <file:///www.reportinghub.no/transform/npd/facilityfixed> , <file:///www.reportinghub.no/transform/npd/facilitymoveable> , <file:///www.reportinghub.no/transform/npd/field> , <file:///www.reportinghub.no/transform/npd/licence> , <file:///www.reportinghub.no/transform/npd/licensee> , <file:///www.reportinghub.no/transform/npd/tufoperator> , <file:///www.reportinghub.no/transform/npd/wbdev> , <file:///www.reportinghub.no/transform/npd/wbexp> , <file:///www.reportinghub.no/transform/npd/wbid> , <file:///www.reportinghub.no/transform/npd/wbsha> , <http://spinrdf.org/spin> , <http://topbraid.org/spin/spinmapl> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/spin/rh> ; 1397 + owl:imports <file:///www.reportinghub.no/transform/npd/baa> , <file:///www.reportinghub.no/transform/npd/baalicensee> , <file:///www.reportinghub.no/transform/npd/company> , <file:///www.reportinghub.no/transform/npd/discovery> , <file:///www.reportinghub.no/transform/npd/facilityfixed> , <file:///www.reportinghub.no/transform/npd/facilitymoveable> , <file:///www.reportinghub.no/transform/npd/field> , <file:///www.reportinghub.no/transform/npd/licence> , <file:///www.reportinghub.no/transform/npd/licenceop> , <file:///www.reportinghub.no/transform/npd/licensee> , <file:///www.reportinghub.no/transform/npd/tufoperator> , <file:///www.reportinghub.no/transform/npd/wbdev> , <file:///www.reportinghub.no/transform/npd/wbexp> , <file:///www.reportinghub.no/transform/npd/wbid> , <file:///www.reportinghub.no/transform/npd/wbsha> , <http://spinrdf.org/spin> , <http://topbraid.org/spin/spinmapl> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/spin/rh> ;
1343 owl:versionInfo "0.1.0"^^xsd:string . 1398 owl:versionInfo "0.1.0"^^xsd:string .
1344 1399
1345 :BAA-BusinessArrangementArea 1400 :BAA-BusinessArrangementArea
...@@ -1418,6 +1473,15 @@ arg:wellName ...@@ -1418,6 +1473,15 @@ arg:wellName
1418 ] ; 1473 ] ;
1419 spinmap:targetClass <http://www.reportinghub.no/ep/schema/facility#Field> . 1474 spinmap:targetClass <http://www.reportinghub.no/ep/schema/facility#Field> .
1420 1475
1476 +:LicenceOp-Licence
1477 + rdf:type spinmap:Context ;
1478 + spinmap:sourceClass licenceop:LicenceOp ;
1479 + spinmap:target
1480 + [ rdf:type :buildLicenceOpURI ;
1481 + spinmap:source spinmap:_source
1482 + ] ;
1483 + spinmap:targetClass <http://www.reportinghub.no/np/schema/npd#Licence> .
1484 +
1421 :License-License 1485 :License-License
1422 rdf:type spinmap:Context ; 1486 rdf:type spinmap:Context ;
1423 spinmap:sourceClass <file:///www.reportinghub.no/transform/npd/licence#Licence> ; 1487 spinmap:sourceClass <file:///www.reportinghub.no/transform/npd/licence#Licence> ;
...@@ -1716,6 +1780,22 @@ arg:wellName ...@@ -1716,6 +1780,22 @@ arg:wellName
1716 ] ; 1780 ] ;
1717 spin:returnType rdfs:Resource . 1781 spin:returnType rdfs:Resource .
1718 1782
1783 +:buildLicenceOpURI
1784 + rdf:type spinmap:TargetFunction ;
1785 + rdfs:label "build licence op URI"^^xsd:string ;
1786 + rdfs:subClassOf spinmap:TargetFunctions ;
1787 + spin:body
1788 + [ rdf:type sp:Select ;
1789 + sp:resultVariables ([ rdf:type rhspin:licenceById ;
1790 + arg:id [ rdf:type spl:object ;
1791 + sp:arg1 [ sp:varName "source"^^xsd:string
1792 + ] ;
1793 + sp:arg2 licenceop:prlNpdidLicence
1794 + ]
1795 + ]) ;
1796 + sp:where ()
1797 + ] .
1798 +
1719 :buildLicenceURI 1799 :buildLicenceURI
1720 rdf:type spinmap:TargetFunction ; 1800 rdf:type spinmap:TargetFunction ;
1721 rdfs:label "build licence URI"^^xsd:string ; 1801 rdfs:label "build licence URI"^^xsd:string ;
......
...@@ -12,11 +12,11 @@ ...@@ -12,11 +12,11 @@
12 [] rdf:type inference:Configuration ; 12 [] rdf:type inference:Configuration ;
13 composite:child 13 composite:child
14 [ rdf:type <http://spinrdf.org/spin#TopSPIN> ; 14 [ rdf:type <http://spinrdf.org/spin#TopSPIN> ;
15 - composite:index "1"^^xsd:int 15 + composite:index "0"^^xsd:int
16 ] ; 16 ] ;
17 composite:child 17 composite:child
18 [ rdf:type <http://spinrdf.org/spin#TopSPIN> ; 18 [ rdf:type <http://spinrdf.org/spin#TopSPIN> ;
19 - composite:index "0"^^xsd:int 19 + composite:index "1"^^xsd:int
20 ] ; 20 ] ;
21 inference:completeMode 21 inference:completeMode
22 "true"^^xsd:boolean ; 22 "true"^^xsd:boolean ;
......
1 +# baseURI: file:///www.reportinghub.no/transform/npd/licenceop
2 +# imports: http://topbraid.org/tables
3 +
4 +@prefix licenceop: <file:///www.reportinghub.no/transform/npd/licenceop#> .
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/licenceop>
12 + rdf:type owl:Ontology ;
13 + owl:imports <http://topbraid.org/tables> .
14 +
15 +licenceop:LicenceOp
16 + rdf:type owl:Class ;
17 + rdfs:label "licenceop" ;
18 + tables:sheetIndex "0"^^xsd:int .
19 +
20 +licenceop:cmpLongName
21 + rdf:type owl:DatatypeProperty ;
22 + rdfs:domain licenceop:LicenceOp ;
23 + rdfs:label "cmpLongName" ;
24 + rdfs:range xsd:string ;
25 + tables:columnIndex "3"^^xsd:int .
26 +
27 +licenceop:cmpNpdidCompany
28 + rdf:type owl:DatatypeProperty ;
29 + rdfs:domain licenceop:LicenceOp ;
30 + rdfs:label "cmpNpdidCompany" ;
31 + rdfs:range xsd:string ;
32 + tables:columnIndex "5"^^xsd:int .
33 +
34 +licenceop:datesyncNPD
35 + rdf:type owl:DatatypeProperty ;
36 + rdfs:domain licenceop:LicenceOp ;
37 + rdfs:label "DatesyncNPD" ;
38 + rdfs:range xsd:string ;
39 + tables:columnIndex "6"^^xsd:int .
40 +
41 +licenceop:prlName
42 + rdf:type owl:DatatypeProperty ;
43 + rdfs:domain licenceop:LicenceOp ;
44 + rdfs:label "ÔªøprlName" ;
45 + rdfs:range xsd:string ;
46 + tables:columnIndex "0"^^xsd:int .
47 +
48 +licenceop:prlNpdidLicence
49 + rdf:type owl:DatatypeProperty ;
50 + rdfs:domain licenceop:LicenceOp ;
51 + rdfs:label "prlNpdidLicence" ;
52 + rdfs:range xsd:string ;
53 + tables:columnIndex "4"^^xsd:int .
54 +
55 +licenceop:prlOperDateValidFrom
56 + rdf:type owl:DatatypeProperty ;
57 + rdfs:domain licenceop:LicenceOp ;
58 + rdfs:label "prlOperDateValidFrom" ;
59 + rdfs:range xsd:string ;
60 + tables:columnIndex "1"^^xsd:int .
61 +
62 +licenceop:prlOperDateValidTo
63 + rdf:type owl:DatatypeProperty ;
64 + rdfs:domain licenceop:LicenceOp ;
65 + rdfs:label "prlOperDateValidTo" ;
66 + rdfs:range xsd:string ;
67 + tables:columnIndex "2"^^xsd:int .