Merge branch 'master' of github.com:TopQuadrant/EPIM-Ontologies
Showing
4 changed files
with
371 additions
and
111 deletions
... | @@ -36,7 +36,7 @@ | ... | @@ -36,7 +36,7 @@ |
36 | <http://www.reportinghub.no/ep/spin/report-constraints> | 36 | <http://www.reportinghub.no/ep/spin/report-constraints> |
37 | rdf:type owl:Ontology ; | 37 | rdf:type owl:Ontology ; |
38 | rdfs:comment "Constraints that need to be executed after ep-report:Report generation (without SXML triples)."^^xsd:string ; | 38 | rdfs:comment "Constraints that need to be executed after ep-report:Report generation (without SXML triples)."^^xsd:string ; |
39 | - owl:imports <http://www.reportinghub.no/spin/rh> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/ddr> ; | 39 | + owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/activity> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/ep/schema/1.0/ddr> , <http://www.reportinghub.no/ep/schema/1.0/equipment> , <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/report> , <http://www.reportinghub.no/ep/schema/1.0/well> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.reportinghub.no/spin/rh> ; |
40 | owl:versionInfo "0.1.0"^^xsd:string . | 40 | owl:versionInfo "0.1.0"^^xsd:string . |
41 | 41 | ||
42 | :DDRSuperclass | 42 | :DDRSuperclass |
... | @@ -52,12 +52,16 @@ | ... | @@ -52,12 +52,16 @@ |
52 | ] [ sp:object spin:_this ; | 52 | ] [ sp:object spin:_this ; |
53 | sp:predicate spin:violationRoot ; | 53 | sp:predicate spin:violationRoot ; |
54 | sp:subject _:b1 | 54 | sp:subject _:b1 |
55 | - ] [ sp:object _:b2 ; | 55 | + ] [ sp:object |
56 | + [ sp:varName "message"^^xsd:string | ||
57 | + ] ; | ||
56 | sp:predicate rdfs:label ; | 58 | sp:predicate rdfs:label ; |
57 | sp:subject _:b1 | 59 | sp:subject _:b1 |
58 | ]) ; | 60 | ]) ; |
59 | sp:where ([ rdf:type sp:TriplePath ; | 61 | sp:where ([ rdf:type sp:TriplePath ; |
60 | - sp:object _:b3 ; | 62 | + sp:object |
63 | + [ sp:varName "wellBore"^^xsd:string | ||
64 | + ] ; | ||
61 | sp:path [ rdf:type sp:SeqPath ; | 65 | sp:path [ rdf:type sp:SeqPath ; |
62 | sp:path1 | 66 | sp:path1 |
63 | [ rdf:type sp:SeqPath ; | 67 | [ rdf:type sp:SeqPath ; |
... | @@ -71,41 +75,59 @@ | ... | @@ -71,41 +75,59 @@ |
71 | sp:expression | 75 | sp:expression |
72 | [ rdf:type rhspin:companyName | 76 | [ rdf:type rhspin:companyName |
73 | ] ; | 77 | ] ; |
74 | - sp:variable _:b4 | 78 | + sp:variable |
79 | + [ sp:varName "companyName"^^xsd:string | ||
80 | + ] | ||
75 | ] [ rdf:type sp:Bind ; | 81 | ] [ rdf:type sp:Bind ; |
76 | sp:expression | 82 | sp:expression |
77 | [ rdf:type rhspin:companyWithName ; | 83 | [ rdf:type rhspin:companyWithName ; |
78 | - arg:name _:b4 | 84 | + arg:name |
85 | + [ sp:varName "companyName"^^xsd:string | ||
86 | + ] | ||
79 | ] ; | 87 | ] ; |
80 | - sp:variable _:b5 | 88 | + sp:variable |
89 | + [ sp:varName "company"^^xsd:string | ||
90 | + ] | ||
81 | ] [ rdf:type sp:Filter ; | 91 | ] [ rdf:type sp:Filter ; |
82 | sp:expression | 92 | sp:expression |
83 | [ rdf:type sp:bound ; | 93 | [ rdf:type sp:bound ; |
84 | - sp:arg1 _:b5 | 94 | + sp:arg1 [ sp:varName "company"^^xsd:string |
95 | + ] | ||
85 | ] | 96 | ] |
86 | ] [ rdf:type sp:NotExists ; | 97 | ] [ rdf:type sp:NotExists ; |
87 | - sp:elements ([ sp:object _:b3 ; | 98 | + sp:elements ([ sp:object |
99 | + [ sp:varName "wellBore"^^xsd:string | ||
100 | + ] ; | ||
88 | sp:predicate rhspin:companyHasLicenceForWellBore ; | 101 | sp:predicate rhspin:companyHasLicenceForWellBore ; |
89 | - sp:subject _:b5 | 102 | + sp:subject |
103 | + [ sp:varName "company"^^xsd:string | ||
104 | + ] | ||
90 | ]) | 105 | ]) |
91 | ] [ rdf:type sp:Bind ; | 106 | ] [ rdf:type sp:Bind ; |
92 | sp:expression | 107 | sp:expression |
108 | + [ rdf:type sp:coalesce ; | ||
109 | + sp:arg1 [ rdf:type rhspin:npdName ; | ||
110 | + arg:resource | ||
111 | + [ sp:varName "wellBore"^^xsd:string | ||
112 | + ] | ||
113 | + ] ; | ||
114 | + sp:arg2 "Unknown well bore" | ||
115 | + ] ; | ||
116 | + sp:variable | ||
117 | + [ sp:varName "displayName"^^xsd:string | ||
118 | + ] | ||
119 | + ] [ rdf:type sp:Bind ; | ||
120 | + sp:expression | ||
93 | [ rdf:type fn:concat ; | 121 | [ rdf:type fn:concat ; |
94 | sp:arg1 "Your company (" ; | 122 | sp:arg1 "Your company (" ; |
95 | - sp:arg2 _:b4 ; | 123 | + sp:arg2 [ sp:varName "companyName"^^xsd:string |
124 | + ] ; | ||
96 | sp:arg3 ") does not hold a licence for well bore " ; | 125 | sp:arg3 ") does not hold a licence for well bore " ; |
97 | - sp:arg4 [ rdf:type rhspin:npdName ; | 126 | + sp:arg4 [ sp:varName "displayName"^^xsd:string |
98 | - arg:resource _:b3 | ||
99 | ] | 127 | ] |
100 | ] ; | 128 | ] ; |
101 | - sp:variable _:b2 | 129 | + sp:variable |
130 | + [ sp:varName "message"^^xsd:string | ||
131 | + ] | ||
102 | ]) | 132 | ]) |
103 | ] . | 133 | ] . |
104 | - | ||
105 | -_:b5 sp:varName "company"^^xsd:string . | ||
106 | - | ||
107 | -_:b4 sp:varName "companyName"^^xsd:string . | ||
108 | - | ||
109 | -_:b3 sp:varName "wellBore"^^xsd:string . | ||
110 | - | ||
111 | -_:b2 sp:varName "message"^^xsd:string . | ... | ... |
... | @@ -98,14 +98,14 @@ arg:wellName | ... | @@ -98,14 +98,14 @@ arg:wellName |
98 | ] ; | 98 | ] ; |
99 | spin:constraint | 99 | spin:constraint |
100 | [ rdf:type spl:Argument ; | 100 | [ rdf:type spl:Argument ; |
101 | - rdfs:comment "The property that must be used in the result resource."^^xsd:string ; | 101 | + rdfs:comment "The value to match against."^^xsd:string ; |
102 | - spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ; | 102 | + spl:predicate sp:arg1 |
103 | - spl:valueType rdf:Property | ||
104 | ] ; | 103 | ] ; |
105 | spin:constraint | 104 | spin:constraint |
106 | [ rdf:type spl:Argument ; | 105 | [ rdf:type spl:Argument ; |
107 | - rdfs:comment "The value to match against."^^xsd:string ; | 106 | + rdfs:comment "The property that must be used in the result resource."^^xsd:string ; |
108 | - spl:predicate sp:arg1 | 107 | + spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ; |
108 | + spl:valueType rdf:Property | ||
109 | ] ; | 109 | ] ; |
110 | spin:returnType rdfs:Resource . | 110 | spin:returnType rdfs:Resource . |
111 | 111 | ||
... | @@ -116,8 +116,8 @@ npdata:npd | ... | @@ -116,8 +116,8 @@ npdata:npd |
116 | <http://www.reportinghub.no/spin/rh> | 116 | <http://www.reportinghub.no/spin/rh> |
117 | rdf:type owl:Ontology ; | 117 | rdf:type owl:Ontology ; |
118 | rdfs:comment "A collection of SPIN functions and templates to support working with the ReportingHub schemas."^^xsd:string ; | 118 | rdfs:comment "A collection of SPIN functions and templates to support working with the ReportingHub schemas."^^xsd:string ; |
119 | - owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/schema/1.0/organization> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/schema/1.0/report> , <http://topbraid.org/spin/spinmapl> , <http://www.reportinghub.no/ep/schema/1.0/core> , <http://www.reportinghub.no/np/schema/1.0/npd> , <http://www.linkedmodel.org/schema/dtype> ; | 119 | + owl:imports <http://spinrdf.org/spin> , <http://topbraid.org/spin/spinmapl> , <http://www.linkedmodel.org/schema/dtype> , <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/report> , <http://www.reportinghub.no/np/schema/1.0/npd> ; |
120 | - owl:versionInfo "0.1.0"^^xsd:string . | 120 | + owl:versionInfo "0.1.1"^^xsd:string . |
121 | 121 | ||
122 | rhspin:DDRTableTemplates | 122 | rhspin:DDRTableTemplates |
123 | rdf:type rhspin:TableTemplate ; | 123 | rdf:type rhspin:TableTemplate ; |
... | @@ -321,8 +321,7 @@ rhspin:companyHasLicenceForWellBore | ... | @@ -321,8 +321,7 @@ rhspin:companyHasLicenceForWellBore |
321 | spl:predicate sp:arg1 ; | 321 | spl:predicate sp:arg1 ; |
322 | spl:valueType <http://www.reportinghub.no/ep/schema/organization#Company> | 322 | spl:valueType <http://www.reportinghub.no/ep/schema/organization#Company> |
323 | ] ; | 323 | ] ; |
324 | - spin:returnType <http://www.reportinghub.no/ep/schema/well#WellBore> ; | 324 | + spin:returnType <http://www.reportinghub.no/ep/schema/well#WellBore> . |
325 | - owl:versionInfo "Note: the algorithm isn't clear - it could be that the date checks are not needed."^^xsd:string . | ||
326 | 325 | ||
327 | rhspin:companyName | 326 | rhspin:companyName |
328 | rdf:type spin:Function ; | 327 | rdf:type spin:Function ; |
... | @@ -360,6 +359,54 @@ rhspin:companyWithName | ... | @@ -360,6 +359,54 @@ rhspin:companyWithName |
360 | ] ; | 359 | ] ; |
361 | spin:returnType <http://www.reportinghub.no/ep/schema/organization#Company> . | 360 | spin:returnType <http://www.reportinghub.no/ep/schema/organization#Company> . |
362 | 361 | ||
362 | +rhspin:currentUserHasAccessToWellBoreWithId | ||
363 | + rdf:type spin:Function ; | ||
364 | + rdfs:comment "Tests whether the currently logged in user is working for a company that has a valid licence for a well bore with a given id. This function is used by the download service to validate access privileges."^^xsd:string ; | ||
365 | + rdfs:label "current user has access to well bore with id"^^xsd:string ; | ||
366 | + rdfs:subClassOf spin:Functions ; | ||
367 | + spin:body | ||
368 | + [ rdf:type sp:Ask ; | ||
369 | + sp:where ([ rdf:type sp:Bind ; | ||
370 | + sp:expression | ||
371 | + [ rdf:type rhspin:companyName | ||
372 | + ] ; | ||
373 | + sp:variable _:b15 | ||
374 | + ] [ rdf:type sp:Bind ; | ||
375 | + sp:expression | ||
376 | + [ rdf:type rhspin:companyWithName ; | ||
377 | + arg:name _:b15 | ||
378 | + ] ; | ||
379 | + sp:variable _:b16 | ||
380 | + ] [ rdf:type sp:Bind ; | ||
381 | + sp:expression | ||
382 | + [ rdf:type rhspin:wellBoreById ; | ||
383 | + arg:id [ sp:varName "id"^^xsd:string | ||
384 | + ] | ||
385 | + ] ; | ||
386 | + sp:variable _:b17 | ||
387 | + ] [ rdf:type sp:Filter ; | ||
388 | + sp:expression | ||
389 | + [ rdf:type sp:and ; | ||
390 | + sp:arg1 [ rdf:type sp:bound ; | ||
391 | + sp:arg1 _:b17 | ||
392 | + ] ; | ||
393 | + sp:arg2 [ rdf:type sp:bound ; | ||
394 | + sp:arg1 _:b16 | ||
395 | + ] | ||
396 | + ] | ||
397 | + ] [ sp:object _:b17 ; | ||
398 | + sp:predicate rhspin:companyHasLicenceForWellBore ; | ||
399 | + sp:subject _:b16 | ||
400 | + ]) | ||
401 | + ] ; | ||
402 | + spin:constraint | ||
403 | + [ rdf:type spl:Argument ; | ||
404 | + rdfs:comment "The id of the well bore."^^xsd:string ; | ||
405 | + spl:predicate arg:id ; | ||
406 | + spl:valueType xsd:string | ||
407 | + ] ; | ||
408 | + spin:returnType xsd:boolean . | ||
409 | + | ||
363 | rhspin:ddrActivityStartDate | 410 | rhspin:ddrActivityStartDate |
364 | rdf:type spin:Function ; | 411 | rdf:type spin:Function ; |
365 | rdfs:comment "Gets the declared start time of the activity in a DDR, as an xsd:date literal."^^xsd:string ; | 412 | rdfs:comment "Gets the declared start time of the activity in a DDR, as an xsd:date literal."^^xsd:string ; |
... | @@ -368,10 +415,10 @@ rhspin:ddrActivityStartDate | ... | @@ -368,10 +415,10 @@ rhspin:ddrActivityStartDate |
368 | spin:body | 415 | spin:body |
369 | [ rdf:type sp:Select ; | 416 | [ rdf:type sp:Select ; |
370 | sp:resultVariables ([ rdf:type xsd:date ; | 417 | sp:resultVariables ([ rdf:type xsd:date ; |
371 | - sp:arg1 _:b15 | 418 | + sp:arg1 _:b18 |
372 | ]) ; | 419 | ]) ; |
373 | sp:where ([ rdf:type sp:TriplePath ; | 420 | sp:where ([ rdf:type sp:TriplePath ; |
374 | - sp:object _:b15 ; | 421 | + sp:object _:b18 ; |
375 | sp:path [ rdf:type sp:SeqPath ; | 422 | sp:path [ rdf:type sp:SeqPath ; |
376 | sp:path1 <http://www.reportinghub.no/ep/schema/activity#reportOn> ; | 423 | sp:path1 <http://www.reportinghub.no/ep/schema/activity#reportOn> ; |
377 | sp:path2 <http://www.reportinghub.no/ep/schema/activity#startedAt> | 424 | sp:path2 <http://www.reportinghub.no/ep/schema/activity#startedAt> |
... | @@ -396,9 +443,9 @@ rhspin:ddrWellBoreId | ... | @@ -396,9 +443,9 @@ rhspin:ddrWellBoreId |
396 | rdfs:subClassOf spin:Functions ; | 443 | rdfs:subClassOf spin:Functions ; |
397 | spin:body | 444 | spin:body |
398 | [ rdf:type sp:Select ; | 445 | [ rdf:type sp:Select ; |
399 | - sp:resultVariables (_:b16) ; | 446 | + sp:resultVariables (_:b19) ; |
400 | sp:where ([ rdf:type sp:TriplePath ; | 447 | sp:where ([ rdf:type sp:TriplePath ; |
401 | - sp:object _:b17 ; | 448 | + sp:object _:b20 ; |
402 | sp:path [ rdf:type sp:SeqPath ; | 449 | sp:path [ rdf:type sp:SeqPath ; |
403 | sp:path1 | 450 | sp:path1 |
404 | [ rdf:type sp:SeqPath ; | 451 | [ rdf:type sp:SeqPath ; |
... | @@ -411,9 +458,9 @@ rhspin:ddrWellBoreId | ... | @@ -411,9 +458,9 @@ rhspin:ddrWellBoreId |
411 | [ sp:varName "ddr"^^xsd:string | 458 | [ sp:varName "ddr"^^xsd:string |
412 | ] | 459 | ] |
413 | ] [ rdf:type sp:NamedGraph ; | 460 | ] [ rdf:type sp:NamedGraph ; |
414 | - sp:elements ([ sp:object _:b16 ; | 461 | + sp:elements ([ sp:object _:b19 ; |
415 | sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; | 462 | sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; |
416 | - sp:subject _:b17 | 463 | + sp:subject _:b20 |
417 | ]) ; | 464 | ]) ; |
418 | sp:graphNameNode npdata:npd | 465 | sp:graphNameNode npdata:npd |
419 | ]) | 466 | ]) |
... | @@ -455,26 +502,26 @@ rhspin:dtypeValue | ... | @@ -455,26 +502,26 @@ rhspin:dtypeValue |
455 | rdfs:subClassOf spl:OntologyFunctions ; | 502 | rdfs:subClassOf spl:OntologyFunctions ; |
456 | spin:body | 503 | spin:body |
457 | [ rdf:type sp:Select ; | 504 | [ rdf:type sp:Select ; |
458 | - sp:resultVariables (_:b18) ; | 505 | + sp:resultVariables (_:b21) ; |
459 | - sp:where ([ sp:object _:b19 ; | 506 | + sp:where ([ sp:object _:b22 ; |
460 | sp:predicate spin:_arg2 ; | 507 | sp:predicate spin:_arg2 ; |
461 | sp:subject spin:_arg1 | 508 | sp:subject spin:_arg1 |
462 | - ] [ sp:object _:b18 ; | 509 | + ] [ sp:object _:b21 ; |
463 | sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ; | 510 | sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ; |
464 | - sp:subject _:b19 | 511 | + sp:subject _:b22 |
465 | ]) | 512 | ]) |
466 | ] ; | 513 | ] ; |
467 | spin:constraint | 514 | spin:constraint |
468 | [ rdf:type spl:Argument ; | 515 | [ rdf:type spl:Argument ; |
469 | - rdfs:comment "The subject of the value."^^xsd:string ; | ||
470 | - spl:predicate sp:arg1 ; | ||
471 | - spl:valueType rdfs:Resource | ||
472 | - ] ; | ||
473 | - spin:constraint | ||
474 | - [ rdf:type spl:Argument ; | ||
475 | rdfs:comment "The predicate that points to the reified value."^^xsd:string ; | 516 | rdfs:comment "The predicate that points to the reified value."^^xsd:string ; |
476 | spl:predicate sp:arg2 ; | 517 | spl:predicate sp:arg2 ; |
477 | spl:valueType rdf:Property | 518 | spl:valueType rdf:Property |
519 | + ] ; | ||
520 | + spin:constraint | ||
521 | + [ rdf:type spl:Argument ; | ||
522 | + rdfs:comment "The subject of the value."^^xsd:string ; | ||
523 | + spl:predicate sp:arg1 ; | ||
524 | + spl:valueType rdfs:Resource | ||
478 | ] . | 525 | ] . |
479 | 526 | ||
480 | rhspin:facilityById | 527 | rhspin:facilityById |
... | @@ -529,10 +576,10 @@ rhspin:graphForDDR | ... | @@ -529,10 +576,10 @@ rhspin:graphForDDR |
529 | spin:body | 576 | spin:body |
530 | [ rdf:type sp:Select ; | 577 | [ rdf:type sp:Select ; |
531 | sp:resultVariables ([ rdf:type sp:iri ; | 578 | sp:resultVariables ([ rdf:type sp:iri ; |
532 | - sp:arg1 _:b20 | 579 | + sp:arg1 _:b23 |
533 | ]) ; | 580 | ]) ; |
534 | sp:where ([ rdf:type sp:TriplePath ; | 581 | sp:where ([ rdf:type sp:TriplePath ; |
535 | - sp:object _:b21 ; | 582 | + sp:object _:b24 ; |
536 | sp:path [ rdf:type sp:SeqPath ; | 583 | sp:path [ rdf:type sp:SeqPath ; |
537 | sp:path1 | 584 | sp:path1 |
538 | [ rdf:type sp:SeqPath ; | 585 | [ rdf:type sp:SeqPath ; |
... | @@ -545,21 +592,21 @@ rhspin:graphForDDR | ... | @@ -545,21 +592,21 @@ rhspin:graphForDDR |
545 | [ sp:varName "ddr"^^xsd:string | 592 | [ sp:varName "ddr"^^xsd:string |
546 | ] | 593 | ] |
547 | ] [ rdf:type sp:NamedGraph ; | 594 | ] [ rdf:type sp:NamedGraph ; |
548 | - sp:elements ([ sp:object _:b22 ; | 595 | + sp:elements ([ sp:object _:b25 ; |
549 | sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ; | 596 | sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ; |
550 | - sp:subject _:b21 | 597 | + sp:subject _:b24 |
551 | - ] [ sp:object _:b23 ; | 598 | + ] [ sp:object _:b26 ; |
552 | sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; | 599 | sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; |
553 | - sp:subject _:b22 | 600 | + sp:subject _:b25 |
554 | ]) ; | 601 | ]) ; |
555 | sp:graphNameNode npdata:npd | 602 | sp:graphNameNode npdata:npd |
556 | ] [ rdf:type sp:Bind ; | 603 | ] [ rdf:type sp:Bind ; |
557 | sp:expression | 604 | sp:expression |
558 | [ rdf:type fn:concat ; | 605 | [ rdf:type fn:concat ; |
559 | sp:arg1 "https://www.reportinghub.no/ep/graph/licence-" ; | 606 | sp:arg1 "https://www.reportinghub.no/ep/graph/licence-" ; |
560 | - sp:arg2 _:b23 | 607 | + sp:arg2 _:b26 |
561 | ] ; | 608 | ] ; |
562 | - sp:variable _:b20 | 609 | + sp:variable _:b23 |
563 | ]) | 610 | ]) |
564 | ] ; | 611 | ] ; |
565 | spin:constraint | 612 | spin:constraint |
... | @@ -600,9 +647,9 @@ rhspin:licenceForWellBore | ... | @@ -600,9 +647,9 @@ rhspin:licenceForWellBore |
600 | rdfs:subClassOf spin:Functions ; | 647 | rdfs:subClassOf spin:Functions ; |
601 | spin:body | 648 | spin:body |
602 | [ rdf:type sp:Select ; | 649 | [ rdf:type sp:Select ; |
603 | - sp:resultVariables (_:b24) ; | 650 | + sp:resultVariables (_:b27) ; |
604 | sp:where ([ rdf:type sp:NamedGraph ; | 651 | sp:where ([ rdf:type sp:NamedGraph ; |
605 | - sp:elements ([ sp:object _:b24 ; | 652 | + sp:elements ([ sp:object _:b27 ; |
606 | sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ; | 653 | sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ; |
607 | sp:subject | 654 | sp:subject |
608 | [ sp:varName "wellBore"^^xsd:string | 655 | [ sp:varName "wellBore"^^xsd:string |
... | @@ -626,7 +673,7 @@ rhspin:normalizeString | ... | @@ -626,7 +673,7 @@ rhspin:normalizeString |
626 | rdfs:subClassOf spl:StringFunctions ; | 673 | rdfs:subClassOf spl:StringFunctions ; |
627 | spin:body | 674 | spin:body |
628 | [ rdf:type sp:Select ; | 675 | [ rdf:type sp:Select ; |
629 | - sp:resultVariables (_:b25) ; | 676 | + sp:resultVariables (_:b28) ; |
630 | sp:where ([ rdf:type sp:Bind ; | 677 | sp:where ([ rdf:type sp:Bind ; |
631 | sp:expression | 678 | sp:expression |
632 | [ rdf:type spif:regex ; | 679 | [ rdf:type spif:regex ; |
... | @@ -634,67 +681,67 @@ rhspin:normalizeString | ... | @@ -634,67 +681,67 @@ rhspin:normalizeString |
634 | sp:arg2 "\\((.*)\\)" ; | 681 | sp:arg2 "\\((.*)\\)" ; |
635 | sp:arg3 "" | 682 | sp:arg3 "" |
636 | ] ; | 683 | ] ; |
637 | - sp:variable _:b26 | 684 | + sp:variable _:b29 |
638 | ] [ rdf:type sp:Bind ; | 685 | ] [ rdf:type sp:Bind ; |
639 | sp:expression | 686 | sp:expression |
640 | [ rdf:type spif:trim ; | 687 | [ rdf:type spif:trim ; |
641 | - sp:arg1 _:b26 | 688 | + sp:arg1 _:b29 |
642 | ] ; | 689 | ] ; |
643 | - sp:variable _:b27 | 690 | + sp:variable _:b30 |
644 | ] [ rdf:type sp:Bind ; | 691 | ] [ rdf:type sp:Bind ; |
645 | sp:expression | 692 | sp:expression |
646 | [ rdf:type spif:encodeURL ; | 693 | [ rdf:type spif:encodeURL ; |
647 | - sp:arg1 _:b27 | 694 | + sp:arg1 _:b30 |
648 | ] ; | 695 | ] ; |
649 | - sp:variable _:b28 | 696 | + sp:variable _:b31 |
650 | ] [ rdf:type sp:Bind ; | 697 | ] [ rdf:type sp:Bind ; |
651 | sp:expression | 698 | sp:expression |
652 | [ rdf:type spif:regex ; | 699 | [ rdf:type spif:regex ; |
653 | - sp:arg1 _:b28 ; | 700 | + sp:arg1 _:b31 ; |
654 | sp:arg2 "%2F" ; | 701 | sp:arg2 "%2F" ; |
655 | sp:arg3 "_" | 702 | sp:arg3 "_" |
656 | ] ; | 703 | ] ; |
657 | - sp:variable _:b29 | 704 | + sp:variable _:b32 |
658 | ] [ rdf:type sp:Bind ; | 705 | ] [ rdf:type sp:Bind ; |
659 | sp:expression | 706 | sp:expression |
660 | [ rdf:type spif:regex ; | 707 | [ rdf:type spif:regex ; |
661 | - sp:arg1 _:b29 ; | 708 | + sp:arg1 _:b32 ; |
662 | sp:arg2 "%[0-9A-F][0-9A-F]" ; | 709 | sp:arg2 "%[0-9A-F][0-9A-F]" ; |
663 | sp:arg3 "" | 710 | sp:arg3 "" |
664 | ] ; | 711 | ] ; |
665 | - sp:variable _:b30 | 712 | + sp:variable _:b33 |
666 | ] [ rdf:type sp:Bind ; | 713 | ] [ rdf:type sp:Bind ; |
667 | sp:expression | 714 | sp:expression |
668 | [ rdf:type spif:regex ; | 715 | [ rdf:type spif:regex ; |
669 | - sp:arg1 _:b30 ; | 716 | + sp:arg1 _:b33 ; |
670 | sp:arg2 "\\+" ; | 717 | sp:arg2 "\\+" ; |
671 | sp:arg3 "_" | 718 | sp:arg3 "_" |
672 | ] ; | 719 | ] ; |
673 | - sp:variable _:b31 | 720 | + sp:variable _:b34 |
674 | ] [ rdf:type sp:Bind ; | 721 | ] [ rdf:type sp:Bind ; |
675 | sp:expression | 722 | sp:expression |
676 | [ rdf:type spif:regex ; | 723 | [ rdf:type spif:regex ; |
677 | - sp:arg1 _:b31 ; | 724 | + sp:arg1 _:b34 ; |
678 | sp:arg2 "_+" ; | 725 | sp:arg2 "_+" ; |
679 | sp:arg3 "_" | 726 | sp:arg3 "_" |
680 | ] ; | 727 | ] ; |
681 | - sp:variable _:b32 | 728 | + sp:variable _:b35 |
682 | ] [ rdf:type sp:Bind ; | 729 | ] [ rdf:type sp:Bind ; |
683 | sp:expression | 730 | sp:expression |
684 | [ rdf:type spif:regex ; | 731 | [ rdf:type spif:regex ; |
685 | - sp:arg1 _:b32 ; | 732 | + sp:arg1 _:b35 ; |
686 | sp:arg2 "\\*" ; | 733 | sp:arg2 "\\*" ; |
687 | sp:arg3 "" | 734 | sp:arg3 "" |
688 | ] ; | 735 | ] ; |
689 | - sp:variable _:b33 | 736 | + sp:variable _:b36 |
690 | ] [ rdf:type sp:Bind ; | 737 | ] [ rdf:type sp:Bind ; |
691 | sp:expression | 738 | sp:expression |
692 | [ rdf:type xsd:string ; | 739 | [ rdf:type xsd:string ; |
693 | sp:arg1 [ rdf:type spif:upperCase ; | 740 | sp:arg1 [ rdf:type spif:upperCase ; |
694 | - sp:arg1 _:b33 | 741 | + sp:arg1 _:b36 |
695 | ] | 742 | ] |
696 | ] ; | 743 | ] ; |
697 | - sp:variable _:b25 | 744 | + sp:variable _:b28 |
698 | ]) | 745 | ]) |
699 | ] ; | 746 | ] ; |
700 | spin:constraint | 747 | spin:constraint |
... | @@ -711,9 +758,9 @@ rhspin:npdId | ... | @@ -711,9 +758,9 @@ rhspin:npdId |
711 | rdfs:subClassOf spl:StringFunctions ; | 758 | rdfs:subClassOf spl:StringFunctions ; |
712 | spin:body | 759 | spin:body |
713 | [ rdf:type sp:Select ; | 760 | [ rdf:type sp:Select ; |
714 | - sp:resultVariables (_:b34) ; | 761 | + sp:resultVariables (_:b37) ; |
715 | sp:where ([ rdf:type sp:NamedGraph ; | 762 | sp:where ([ rdf:type sp:NamedGraph ; |
716 | - sp:elements ([ sp:object _:b34 ; | 763 | + sp:elements ([ sp:object _:b37 ; |
717 | sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; | 764 | sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ; |
718 | sp:subject | 765 | sp:subject |
719 | [ sp:varName "resource"^^xsd:string | 766 | [ sp:varName "resource"^^xsd:string |
... | @@ -736,9 +783,9 @@ rhspin:npdName | ... | @@ -736,9 +783,9 @@ rhspin:npdName |
736 | rdfs:subClassOf spl:StringFunctions ; | 783 | rdfs:subClassOf spl:StringFunctions ; |
737 | spin:body | 784 | spin:body |
738 | [ rdf:type sp:Select ; | 785 | [ rdf:type sp:Select ; |
739 | - sp:resultVariables (_:b35) ; | 786 | + sp:resultVariables (_:b38) ; |
740 | sp:where ([ rdf:type sp:NamedGraph ; | 787 | sp:where ([ rdf:type sp:NamedGraph ; |
741 | - sp:elements ([ sp:object _:b35 ; | 788 | + sp:elements ([ sp:object _:b38 ; |
742 | sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; | 789 | sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; |
743 | sp:subject | 790 | sp:subject |
744 | [ sp:varName "resource"^^xsd:string | 791 | [ sp:varName "resource"^^xsd:string |
... | @@ -772,9 +819,8 @@ rhspin:npdTripleExists | ... | @@ -772,9 +819,8 @@ rhspin:npdTripleExists |
772 | ] ; | 819 | ] ; |
773 | spin:constraint | 820 | spin:constraint |
774 | [ rdf:type spl:Argument ; | 821 | [ rdf:type spl:Argument ; |
775 | - rdfs:comment "The subject to find"^^xsd:string ; | 822 | + rdfs:comment "The object to match."^^xsd:string ; |
776 | - spl:predicate sp:arg1 ; | 823 | + spl:predicate sp:arg3 |
777 | - spl:valueType rdfs:Resource | ||
778 | ] ; | 824 | ] ; |
779 | spin:constraint | 825 | spin:constraint |
780 | [ rdf:type spl:Argument ; | 826 | [ rdf:type spl:Argument ; |
... | @@ -784,8 +830,9 @@ rhspin:npdTripleExists | ... | @@ -784,8 +830,9 @@ rhspin:npdTripleExists |
784 | ] ; | 830 | ] ; |
785 | spin:constraint | 831 | spin:constraint |
786 | [ rdf:type spl:Argument ; | 832 | [ rdf:type spl:Argument ; |
787 | - rdfs:comment "The object to match."^^xsd:string ; | 833 | + rdfs:comment "The subject to find"^^xsd:string ; |
788 | - spl:predicate sp:arg3 | 834 | + spl:predicate sp:arg1 ; |
835 | + spl:valueType rdfs:Resource | ||
789 | ] ; | 836 | ] ; |
790 | spin:returnType xsd:boolean . | 837 | spin:returnType xsd:boolean . |
791 | 838 | ||
... | @@ -884,16 +931,16 @@ rhspin:wellBoreByName | ... | @@ -884,16 +931,16 @@ rhspin:wellBoreByName |
884 | rdfs:subClassOf spl:URIFunctions ; | 931 | rdfs:subClassOf spl:URIFunctions ; |
885 | spin:body | 932 | spin:body |
886 | [ rdf:type sp:Select ; | 933 | [ rdf:type sp:Select ; |
887 | - sp:resultVariables (_:b36) ; | 934 | + sp:resultVariables (_:b39) ; |
888 | sp:where ([ rdf:type sp:NamedGraph ; | 935 | sp:where ([ rdf:type sp:NamedGraph ; |
889 | sp:elements ([ sp:object | 936 | sp:elements ([ sp:object |
890 | [ sp:varName "wellBoreName"^^xsd:string | 937 | [ sp:varName "wellBoreName"^^xsd:string |
891 | ] ; | 938 | ] ; |
892 | sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; | 939 | sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; |
893 | - sp:subject _:b36 | 940 | + sp:subject _:b39 |
894 | ] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ; | 941 | ] [ sp:object <http://www.reportinghub.no/ep/schema/well#WellBore> ; |
895 | sp:predicate rdf:type ; | 942 | sp:predicate rdf:type ; |
896 | - sp:subject _:b36 | 943 | + sp:subject _:b39 |
897 | ]) ; | 944 | ]) ; |
898 | sp:graphNameNode npdata:npd | 945 | sp:graphNameNode npdata:npd |
899 | ]) | 946 | ]) |
... | @@ -932,70 +979,79 @@ rhspin:wellByName | ... | @@ -932,70 +979,79 @@ rhspin:wellByName |
932 | ] ; | 979 | ] ; |
933 | spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . | 980 | spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . |
934 | 981 | ||
935 | -_:b20 | 982 | +_:b17 |
936 | - sp:varName "uri"^^xsd:string . | 983 | + sp:varName "wellBore"^^xsd:string . |
937 | 984 | ||
938 | -_:b23 | 985 | +_:b16 |
939 | - sp:varName "id"^^xsd:string . | 986 | + sp:varName "company"^^xsd:string . |
940 | 987 | ||
941 | -_:b22 | 988 | +_:b15 |
942 | - sp:varName "licence"^^xsd:string . | 989 | + sp:varName "companyName"^^xsd:string . |
943 | 990 | ||
944 | -_:b21 | 991 | +_:b39 |
945 | sp:varName "wellBore"^^xsd:string . | 992 | sp:varName "wellBore"^^xsd:string . |
946 | 993 | ||
994 | +_:b38 | ||
995 | + sp:varName "name"^^xsd:string . | ||
996 | + | ||
997 | +_:b37 | ||
998 | + sp:varName "id"^^xsd:string . | ||
999 | + | ||
947 | _:b36 | 1000 | _:b36 |
948 | - sp:varName "wellBore"^^xsd:string . | 1001 | + sp:varName "t4"^^xsd:string . |
949 | 1002 | ||
950 | _:b35 | 1003 | _:b35 |
951 | - sp:varName "name"^^xsd:string . | 1004 | + sp:varName "t3"^^xsd:string . |
952 | 1005 | ||
953 | _:b34 | 1006 | _:b34 |
954 | - sp:varName "id"^^xsd:string . | 1007 | + sp:varName "t2"^^xsd:string . |
955 | 1008 | ||
956 | _:b33 | 1009 | _:b33 |
957 | - sp:varName "t4"^^xsd:string . | 1010 | + sp:varName "t1"^^xsd:string . |
958 | 1011 | ||
959 | _:b32 | 1012 | _:b32 |
960 | - sp:varName "t3"^^xsd:string . | 1013 | + sp:varName "t0b"^^xsd:string . |
961 | 1014 | ||
962 | _:b31 | 1015 | _:b31 |
963 | - sp:varName "t2"^^xsd:string . | 1016 | + sp:varName "t0a"^^xsd:string . |
964 | 1017 | ||
965 | _:b30 | 1018 | _:b30 |
966 | - sp:varName "t1"^^xsd:string . | 1019 | + sp:varName "s2"^^xsd:string . |
967 | 1020 | ||
968 | _:b29 | 1021 | _:b29 |
969 | - sp:varName "t0b"^^xsd:string . | 1022 | + sp:varName "s1"^^xsd:string . |
970 | 1023 | ||
971 | _:b28 | 1024 | _:b28 |
972 | - sp:varName "t0a"^^xsd:string . | 1025 | + sp:varName "normalizedStr"^^xsd:string . |
973 | 1026 | ||
974 | _:b27 | 1027 | _:b27 |
975 | - sp:varName "s2"^^xsd:string . | 1028 | + sp:varName "licence"^^xsd:string . |
976 | 1029 | ||
977 | _:b26 | 1030 | _:b26 |
978 | - sp:varName "s1"^^xsd:string . | 1031 | + sp:varName "id"^^xsd:string . |
979 | 1032 | ||
980 | _:b25 | 1033 | _:b25 |
981 | - sp:varName "normalizedStr"^^xsd:string . | 1034 | + sp:varName "licence"^^xsd:string . |
982 | 1035 | ||
983 | _:b24 | 1036 | _:b24 |
984 | - sp:varName "licence"^^xsd:string . | 1037 | + sp:varName "wellBore"^^xsd:string . |
985 | 1038 | ||
986 | -_:b19 | 1039 | +_:b23 |
1040 | + sp:varName "uri"^^xsd:string . | ||
1041 | + | ||
1042 | +_:b22 | ||
987 | sp:varName "reif"^^xsd:string . | 1043 | sp:varName "reif"^^xsd:string . |
988 | 1044 | ||
989 | -_:b18 | 1045 | +_:b21 |
990 | sp:varName "value"^^xsd:string . | 1046 | sp:varName "value"^^xsd:string . |
991 | 1047 | ||
992 | -_:b17 | 1048 | +_:b20 |
993 | sp:varName "wellBore"^^xsd:string . | 1049 | sp:varName "wellBore"^^xsd:string . |
994 | 1050 | ||
995 | -_:b16 | 1051 | +_:b19 |
996 | sp:varName "id"^^xsd:string . | 1052 | sp:varName "id"^^xsd:string . |
997 | 1053 | ||
998 | -_:b15 | 1054 | +_:b18 |
999 | sp:varName "startedAt"^^xsd:string . | 1055 | sp:varName "startedAt"^^xsd:string . |
1000 | 1056 | ||
1001 | _:b14 | 1057 | _:b14 | ... | ... |
1 | +# baseURI: http://www.reportinghub.no/system/schema/reporting | ||
2 | +# imports: http://purl.org/dc/terms/ | ||
3 | + | ||
4 | +@prefix foaf: <http://xmlns.com/foaf/0.1/> . | ||
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 report: <http://www.reportinghub.no/system/schema/reporting#> . | ||
9 | +@prefix sioc: <http://rdfs.org/sioc/ns#> . | ||
10 | +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
11 | + | ||
12 | +sioc:id | ||
13 | + rdf:type owl:DatatypeProperty ; | ||
14 | + rdfs:label "id"^^xsd:string . | ||
15 | + | ||
16 | +<http://www.reportinghub.no/system/schema/reporting> | ||
17 | + 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 | + owl:imports <http://purl.org/dc/terms/> ; | ||
20 | + owl:versionInfo "0.1.0"^^xsd:string . | ||
21 | + | ||
22 | +report:DDR | ||
23 | + rdf:type rdfs:Class ; | ||
24 | + rdfs:comment "The metadata about a Daily Drilling Report."^^xsd:string ; | ||
25 | + rdfs:label "DDR"^^xsd:string ; | ||
26 | + rdfs:subClassOf foaf:Document ; | ||
27 | + rdfs:subClassOf | ||
28 | + [ rdf:type owl:Restriction ; | ||
29 | + owl:allValuesFrom xsd:string ; | ||
30 | + owl:onProperty sioc:id | ||
31 | + ] ; | ||
32 | + rdfs:subClassOf | ||
33 | + [ rdf:type owl:Restriction ; | ||
34 | + owl:cardinality "1"^^xsd:nonNegativeInteger ; | ||
35 | + owl:onProperty <http://purl.org/dc/terms/date> | ||
36 | + ] ; | ||
37 | + rdfs:subClassOf | ||
38 | + [ rdf:type owl:Restriction ; | ||
39 | + owl:cardinality "1"^^xsd:nonNegativeInteger ; | ||
40 | + owl:onProperty report:wellBoreId | ||
41 | + ] ; | ||
42 | + rdfs:subClassOf | ||
43 | + [ rdf:type owl:Restriction ; | ||
44 | + owl:cardinality "1"^^xsd:nonNegativeInteger ; | ||
45 | + owl:onProperty <http://purl.org/dc/terms/created> | ||
46 | + ] ; | ||
47 | + rdfs:subClassOf | ||
48 | + [ rdf:type owl:Restriction ; | ||
49 | + owl:cardinality "1"^^xsd:nonNegativeInteger ; | ||
50 | + owl:onProperty sioc:id | ||
51 | + ] . | ||
52 | + | ||
53 | +report:wellBoreId | ||
54 | + rdf:type owl:DatatypeProperty ; | ||
55 | + rdfs:label "well bore id"^^xsd:string . | ||
56 | + | ||
57 | +foaf:Document | ||
58 | + rdf:type rdfs:Class ; | ||
59 | + rdfs:label "Document"^^xsd:string . |
1 | +# baseURI: http://www.reportinghub.no/system/spin/reporting | ||
2 | +# imports: http://spinrdf.org/spin | ||
3 | +# imports: http://www.reportinghub.no/system/schema/reporting | ||
4 | + | ||
5 | +@prefix fn: <http://www.w3.org/2005/xpath-functions#> . | ||
6 | +@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
7 | +@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . | ||
8 | +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
9 | +@prefix reportspin: <http://www.reportinghub.no/system/spin/reporting#> . | ||
10 | +@prefix sp: <http://spinrdf.org/sp#> . | ||
11 | +@prefix spin: <http://spinrdf.org/spin#> . | ||
12 | +@prefix spl: <http://spinrdf.org/spl#> . | ||
13 | +@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
14 | + | ||
15 | +<http://spinrdf.org/arg#date> | ||
16 | + rdf:type rdf:Property ; | ||
17 | + rdfs:label "date"^^xsd:string ; | ||
18 | + rdfs:subPropertyOf sp:arg . | ||
19 | + | ||
20 | +<http://spinrdf.org/arg#id> | ||
21 | + rdf:type rdf:Property ; | ||
22 | + rdfs:label "id"^^xsd:string ; | ||
23 | + rdfs:subPropertyOf sp:arg . | ||
24 | + | ||
25 | +<http://spinrdf.org/arg#wellBoreId> | ||
26 | + rdf:type rdf:Property ; | ||
27 | + rdfs:label "well bore id"^^xsd:string ; | ||
28 | + rdfs:subPropertyOf sp:arg . | ||
29 | + | ||
30 | +<http://www.reportinghub.no/system/spin/reporting> | ||
31 | + rdf:type owl:Ontology ; | ||
32 | + rdfs:comment "SPIN functions and templates to support querying report metadata."^^xsd:string ; | ||
33 | + owl:imports <http://spinrdf.org/spin> , <http://www.reportinghub.no/system/schema/reporting> ; | ||
34 | + owl:versionInfo "0.1.0"^^xsd:string . | ||
35 | + | ||
36 | +reportspin:graphByDDRId | ||
37 | + 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 ; | ||
39 | + rdfs:label "graph by DDRId"^^xsd:string ; | ||
40 | + rdfs:subClassOf spin:Functions ; | ||
41 | + spin:body | ||
42 | + [ rdf:type sp:Select ; | ||
43 | + sp:resultVariables ([ rdf:type sp:iri ; | ||
44 | + sp:arg1 [ sp:varName "uri"^^xsd:string | ||
45 | + ] | ||
46 | + ]) ; | ||
47 | + sp:where ([ rdf:type sp:Bind ; | ||
48 | + sp:expression | ||
49 | + [ rdf:type fn:concat ; | ||
50 | + sp:arg1 "http://www.reportinghub.no/system/ddr/" ; | ||
51 | + sp:arg2 [ sp:varName "id"^^xsd:string | ||
52 | + ] | ||
53 | + ] ; | ||
54 | + sp:variable | ||
55 | + [ sp:varName "uri"^^xsd:string | ||
56 | + ] | ||
57 | + ]) | ||
58 | + ] ; | ||
59 | + spin:constraint | ||
60 | + [ rdf:type spl:Argument ; | ||
61 | + rdfs:comment "The id of the DDR metadata."^^xsd:string ; | ||
62 | + spl:predicate <http://spinrdf.org/arg#id> ; | ||
63 | + spl:valueType xsd:string | ||
64 | + ] ; | ||
65 | + spin:returnType rdfs:Resource . | ||
66 | + | ||
67 | +reportspin:idOfDDRByDateAndWellBoreId | ||
68 | + 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 ; | ||
70 | + rdfs:label "id of DDR by date and well bore id"^^xsd:string ; | ||
71 | + rdfs:subClassOf spin:Functions ; | ||
72 | + spin:body | ||
73 | + [ rdf:type sp:Select ; | ||
74 | + sp:orderBy ([ rdf:type sp:Desc ; | ||
75 | + sp:expression | ||
76 | + [ sp:varName "created"^^xsd:string | ||
77 | + ] | ||
78 | + ]) ; | ||
79 | + sp:resultVariables ([ sp:varName "id"^^xsd:string | ||
80 | + ]) ; | ||
81 | + sp:where ([ sp:object | ||
82 | + [ sp:varName "wellBoreId"^^xsd:string | ||
83 | + ] ; | ||
84 | + sp:predicate <http://www.reportinghub.no/system/schema/reporting#wellBoreId> ; | ||
85 | + sp:subject | ||
86 | + [ sp:varName "report"^^xsd:string | ||
87 | + ] | ||
88 | + ] [ sp:object | ||
89 | + [ sp:varName "date"^^xsd:string | ||
90 | + ] ; | ||
91 | + sp:predicate <http://purl.org/dc/terms/date> ; | ||
92 | + sp:subject | ||
93 | + [ sp:varName "report"^^xsd:string | ||
94 | + ] | ||
95 | + ] [ sp:object | ||
96 | + [ sp:varName "created"^^xsd:string | ||
97 | + ] ; | ||
98 | + sp:predicate <http://purl.org/dc/terms/created> ; | ||
99 | + sp:subject | ||
100 | + [ sp:varName "report"^^xsd:string | ||
101 | + ] | ||
102 | + ] [ sp:object | ||
103 | + [ sp:varName "id"^^xsd:string | ||
104 | + ] ; | ||
105 | + sp:predicate <http://rdfs.org/sioc/ns#id> ; | ||
106 | + sp:subject | ||
107 | + [ sp:varName "report"^^xsd:string | ||
108 | + ] | ||
109 | + ]) | ||
110 | + ] ; | ||
111 | + spin:constraint | ||
112 | + [ 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 ; | ||
114 | + spl:predicate <http://spinrdf.org/arg#date> ; | ||
115 | + spl:valueType xsd:date | ||
116 | + ] ; | ||
117 | + spin:constraint | ||
118 | + [ rdf:type spl:Argument ; | ||
119 | + rdfs:comment "The id of the well bore."^^xsd:string ; | ||
120 | + spl:predicate <http://spinrdf.org/arg#wellBoreId> ; | ||
121 | + spl:valueType xsd:string | ||
122 | + ] ; | ||
123 | + spin:returnType xsd:string . |
-
Please register or login to post a comment