Showing
2 changed files
with
131 additions
and
15 deletions
1 | # baseURI: http://www.reportinghub.no/system/schema/reporting | 1 | # baseURI: http://www.reportinghub.no/system/schema/reporting |
2 | # imports: http://purl.org/dc/terms/ | 2 | # imports: http://purl.org/dc/terms/ |
3 | +# imports: http://www.reportinghub.no/np/schema/1.0/npd | ||
3 | 4 | ||
4 | @prefix foaf: <http://xmlns.com/foaf/0.1/> . | 5 | @prefix foaf: <http://xmlns.com/foaf/0.1/> . |
5 | @prefix owl: <http://www.w3.org/2002/07/owl#> . | 6 | @prefix owl: <http://www.w3.org/2002/07/owl#> . |
... | @@ -16,40 +17,61 @@ sioc:id | ... | @@ -16,40 +17,61 @@ sioc:id |
16 | <http://www.reportinghub.no/system/schema/reporting> | 17 | <http://www.reportinghub.no/system/schema/reporting> |
17 | rdf:type owl:Ontology ; | 18 | rdf:type owl:Ontology ; |
18 | rdfs:comment "The schema of metadata kept by the ReportingHub system to keep track of submitted reports. The starting point is the class foaf:Document."^^xsd:string ; | 19 | rdfs:comment "The schema of metadata kept by the ReportingHub system to keep track of submitted reports. The starting point is the class foaf:Document."^^xsd:string ; |
19 | - owl:imports <http://purl.org/dc/terms/> ; | 20 | + owl:imports <http://purl.org/dc/terms/> , <http://www.reportinghub.no/np/schema/1.0/npd> ; |
20 | - owl:versionInfo "0.1.0"^^xsd:string . | 21 | + owl:versionInfo "0.2.0"^^xsd:string . |
21 | 22 | ||
22 | -report:DDR | 23 | +report:AbstractDR |
23 | rdf:type rdfs:Class ; | 24 | rdf:type rdfs:Class ; |
24 | - rdfs:comment "The metadata about a Daily Drilling Report."^^xsd:string ; | 25 | + rdfs:comment "Abstract base class for various types of daily reports."^^xsd:string ; |
25 | - rdfs:label "DDR"^^xsd:string ; | ||
26 | rdfs:subClassOf foaf:Document ; | 26 | rdfs:subClassOf foaf:Document ; |
27 | rdfs:subClassOf | 27 | rdfs:subClassOf |
28 | [ rdf:type owl:Restriction ; | 28 | [ rdf:type owl:Restriction ; |
29 | - owl:allValuesFrom xsd:string ; | 29 | + owl:cardinality "1"^^xsd:nonNegativeInteger ; |
30 | owl:onProperty sioc:id | 30 | owl:onProperty sioc:id |
31 | ] ; | 31 | ] ; |
32 | rdfs:subClassOf | 32 | rdfs:subClassOf |
33 | [ rdf:type owl:Restriction ; | 33 | [ rdf:type owl:Restriction ; |
34 | owl:cardinality "1"^^xsd:nonNegativeInteger ; | 34 | owl:cardinality "1"^^xsd:nonNegativeInteger ; |
35 | - owl:onProperty <http://purl.org/dc/terms/date> | 35 | + owl:onProperty <http://purl.org/dc/terms/created> |
36 | ] ; | 36 | ] ; |
37 | rdfs:subClassOf | 37 | rdfs:subClassOf |
38 | [ rdf:type owl:Restriction ; | 38 | [ rdf:type owl:Restriction ; |
39 | owl:cardinality "1"^^xsd:nonNegativeInteger ; | 39 | owl:cardinality "1"^^xsd:nonNegativeInteger ; |
40 | - owl:onProperty report:wellBoreId | 40 | + owl:onProperty <http://purl.org/dc/terms/date> |
41 | ] ; | 41 | ] ; |
42 | rdfs:subClassOf | 42 | rdfs:subClassOf |
43 | [ rdf:type owl:Restriction ; | 43 | [ rdf:type owl:Restriction ; |
44 | + owl:allValuesFrom xsd:string ; | ||
45 | + owl:onProperty sioc:id | ||
46 | + ] . | ||
47 | + | ||
48 | +report:DDR | ||
49 | + rdf:type rdfs:Class ; | ||
50 | + rdfs:comment "The metadata about a Daily Drilling Report."^^xsd:string ; | ||
51 | + rdfs:label "DDR"^^xsd:string ; | ||
52 | + rdfs:subClassOf report:AbstractDR ; | ||
53 | + rdfs:subClassOf | ||
54 | + [ rdf:type owl:Restriction ; | ||
44 | owl:cardinality "1"^^xsd:nonNegativeInteger ; | 55 | owl:cardinality "1"^^xsd:nonNegativeInteger ; |
45 | - owl:onProperty <http://purl.org/dc/terms/created> | 56 | + owl:onProperty report:wellBoreId |
46 | - ] ; | 57 | + ] . |
58 | + | ||
59 | +report:DPR | ||
60 | + rdf:type rdfs:Class ; | ||
61 | + rdfs:comment "The metadata about a Daily Production Report."^^xsd:string ; | ||
62 | + rdfs:label "DPR"^^xsd:string ; | ||
63 | + rdfs:subClassOf report:AbstractDR ; | ||
47 | rdfs:subClassOf | 64 | rdfs:subClassOf |
48 | [ rdf:type owl:Restriction ; | 65 | [ rdf:type owl:Restriction ; |
49 | owl:cardinality "1"^^xsd:nonNegativeInteger ; | 66 | owl:cardinality "1"^^xsd:nonNegativeInteger ; |
50 | - owl:onProperty sioc:id | 67 | + owl:onProperty report:owner |
51 | ] . | 68 | ] . |
52 | 69 | ||
70 | +report:owner | ||
71 | + rdf:type owl:ObjectProperty ; | ||
72 | + rdfs:label "owner"^^xsd:string ; | ||
73 | + rdfs:range <http://www.reportinghub.no/np/schema/npd#Owner> . | ||
74 | + | ||
53 | report:wellBoreId | 75 | report:wellBoreId |
54 | rdf:type owl:DatatypeProperty ; | 76 | rdf:type owl:DatatypeProperty ; |
55 | rdfs:label "well bore id"^^xsd:string . | 77 | rdfs:label "well bore id"^^xsd:string . | ... | ... |
... | @@ -22,6 +22,11 @@ | ... | @@ -22,6 +22,11 @@ |
22 | rdfs:label "id"^^xsd:string ; | 22 | rdfs:label "id"^^xsd:string ; |
23 | rdfs:subPropertyOf sp:arg . | 23 | rdfs:subPropertyOf sp:arg . |
24 | 24 | ||
25 | +<http://spinrdf.org/arg#owner> | ||
26 | + rdf:type rdf:Property ; | ||
27 | + rdfs:label "owner"^^xsd:string ; | ||
28 | + rdfs:subPropertyOf sp:arg . | ||
29 | + | ||
25 | <http://spinrdf.org/arg#wellBoreId> | 30 | <http://spinrdf.org/arg#wellBoreId> |
26 | rdf:type rdf:Property ; | 31 | rdf:type rdf:Property ; |
27 | rdfs:label "well bore id"^^xsd:string ; | 32 | rdfs:label "well bore id"^^xsd:string ; |
... | @@ -36,7 +41,7 @@ | ... | @@ -36,7 +41,7 @@ |
36 | reportspin:graphByDDRId | 41 | reportspin:graphByDDRId |
37 | rdf:type spin:Function ; | 42 | rdf:type spin:Function ; |
38 | rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DDR (metadata) with a given id."^^xsd:string ; | 43 | rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DDR (metadata) with a given id."^^xsd:string ; |
39 | - rdfs:label "graph by DDRId"^^xsd:string ; | 44 | + rdfs:label "graph by DDR id"^^xsd:string ; |
40 | rdfs:subClassOf spin:Functions ; | 45 | rdfs:subClassOf spin:Functions ; |
41 | spin:body | 46 | spin:body |
42 | [ rdf:type sp:Select ; | 47 | [ rdf:type sp:Select ; |
... | @@ -64,6 +69,37 @@ reportspin:graphByDDRId | ... | @@ -64,6 +69,37 @@ reportspin:graphByDDRId |
64 | ] ; | 69 | ] ; |
65 | spin:returnType rdfs:Resource . | 70 | spin:returnType rdfs:Resource . |
66 | 71 | ||
72 | +reportspin:graphByDPRId | ||
73 | + rdf:type spin:Function ; | ||
74 | + rdfs:comment "Gets the URI of the named graph containing the triples submitted by a report:DPR (metadata) with a given id."^^xsd:string ; | ||
75 | + rdfs:label "graph by DPR id"^^xsd:string ; | ||
76 | + rdfs:subClassOf spin:Functions ; | ||
77 | + spin:body | ||
78 | + [ rdf:type sp:Select ; | ||
79 | + sp:resultVariables ([ rdf:type sp:iri ; | ||
80 | + sp:arg1 [ sp:varName "uri"^^xsd:string | ||
81 | + ] | ||
82 | + ]) ; | ||
83 | + sp:where ([ rdf:type sp:Bind ; | ||
84 | + sp:expression | ||
85 | + [ rdf:type fn:concat ; | ||
86 | + sp:arg1 "http://www.reportinghub.no/system/dpr/" ; | ||
87 | + sp:arg2 [ sp:varName "id"^^xsd:string | ||
88 | + ] | ||
89 | + ] ; | ||
90 | + sp:variable | ||
91 | + [ sp:varName "uri"^^xsd:string | ||
92 | + ] | ||
93 | + ]) | ||
94 | + ] ; | ||
95 | + spin:constraint | ||
96 | + [ rdf:type spl:Argument ; | ||
97 | + rdfs:comment "The id of the DPR metadata."^^xsd:string ; | ||
98 | + spl:predicate <http://spinrdf.org/arg#id> ; | ||
99 | + spl:valueType xsd:string | ||
100 | + ] ; | ||
101 | + spin:returnType rdfs:Resource . | ||
102 | + | ||
67 | reportspin:idOfDDRByDateAndWellBoreId | 103 | reportspin:idOfDDRByDateAndWellBoreId |
68 | rdf:type spin:Function ; | 104 | rdf:type spin:Function ; |
69 | rdfs:comment "Gets the id of a DDR defined by date and well bore id. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ; | 105 | rdfs:comment "Gets the id of a DDR defined by date and well bore id. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ; |
... | @@ -110,14 +146,72 @@ reportspin:idOfDDRByDateAndWellBoreId | ... | @@ -110,14 +146,72 @@ reportspin:idOfDDRByDateAndWellBoreId |
110 | ] ; | 146 | ] ; |
111 | spin:constraint | 147 | spin:constraint |
112 | [ rdf:type spl:Argument ; | 148 | [ rdf:type spl:Argument ; |
149 | + rdfs:comment "The id of the well bore."^^xsd:string ; | ||
150 | + spl:predicate <http://spinrdf.org/arg#wellBoreId> ; | ||
151 | + spl:valueType xsd:string | ||
152 | + ] ; | ||
153 | + spin:constraint | ||
154 | + [ rdf:type spl:Argument ; | ||
113 | rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ; | 155 | rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ; |
114 | spl:predicate <http://spinrdf.org/arg#date> ; | 156 | spl:predicate <http://spinrdf.org/arg#date> ; |
115 | spl:valueType xsd:date | 157 | spl:valueType xsd:date |
116 | ] ; | 158 | ] ; |
159 | + spin:returnType xsd:string . | ||
160 | + | ||
161 | +reportspin:idOfDPRByDateAndOwner | ||
162 | + rdf:type spin:Function ; | ||
163 | + rdfs:comment "Gets the id of a DPR defined by date and licence or BAA. If preliminary reports have been created, this will return the most recent one only."^^xsd:string ; | ||
164 | + rdfs:label "id of DPR by date and owner"^^xsd:string ; | ||
165 | + rdfs:subClassOf spin:Functions ; | ||
166 | + spin:body | ||
167 | + [ rdf:type sp:Select ; | ||
168 | + sp:orderBy ([ rdf:type sp:Desc ; | ||
169 | + sp:expression | ||
170 | + [ sp:varName "created"^^xsd:string | ||
171 | + ] | ||
172 | + ]) ; | ||
173 | + sp:resultVariables ([ sp:varName "id"^^xsd:string | ||
174 | + ]) ; | ||
175 | + sp:where ([ sp:object | ||
176 | + [ sp:varName "owner"^^xsd:string | ||
177 | + ] ; | ||
178 | + sp:predicate <http://www.reportinghub.no/system/schema/reporting#owner> ; | ||
179 | + sp:subject | ||
180 | + [ sp:varName "report"^^xsd:string | ||
181 | + ] | ||
182 | + ] [ sp:object | ||
183 | + [ sp:varName "date"^^xsd:string | ||
184 | + ] ; | ||
185 | + sp:predicate <http://purl.org/dc/terms/date> ; | ||
186 | + sp:subject | ||
187 | + [ sp:varName "report"^^xsd:string | ||
188 | + ] | ||
189 | + ] [ sp:object | ||
190 | + [ sp:varName "created"^^xsd:string | ||
191 | + ] ; | ||
192 | + sp:predicate <http://purl.org/dc/terms/created> ; | ||
193 | + sp:subject | ||
194 | + [ sp:varName "report"^^xsd:string | ||
195 | + ] | ||
196 | + ] [ sp:object | ||
197 | + [ sp:varName "id"^^xsd:string | ||
198 | + ] ; | ||
199 | + sp:predicate <http://rdfs.org/sioc/ns#id> ; | ||
200 | + sp:subject | ||
201 | + [ sp:varName "report"^^xsd:string | ||
202 | + ] | ||
203 | + ]) | ||
204 | + ] ; | ||
117 | spin:constraint | 205 | spin:constraint |
118 | [ rdf:type spl:Argument ; | 206 | [ rdf:type spl:Argument ; |
119 | - rdfs:comment "The id of the well bore."^^xsd:string ; | 207 | + rdfs:comment "The date of the DDR (not the submission date, but the start date of the report)."^^xsd:string ; |
120 | - spl:predicate <http://spinrdf.org/arg#wellBoreId> ; | 208 | + spl:predicate <http://spinrdf.org/arg#date> ; |
121 | - spl:valueType xsd:string | 209 | + spl:valueType xsd:date |
210 | + ] ; | ||
211 | + spin:constraint | ||
212 | + [ rdf:type spl:Argument ; | ||
213 | + rdfs:comment "The Licence or BAA."^^xsd:string ; | ||
214 | + spl:predicate <http://spinrdf.org/arg#owner> ; | ||
215 | + spl:valueType <http://www.reportinghub.no/np/schema/npd#Owner> | ||
122 | ] ; | 216 | ] ; |
123 | spin:returnType xsd:string . | 217 | spin:returnType xsd:string . | ... | ... |
-
Please register or login to post a comment