Holger Knublauch

Added rhspin:graphForWellBoreWithId

...@@ -98,15 +98,15 @@ arg:wellName ...@@ -98,15 +98,15 @@ arg:wellName
98 ] ; 98 ] ;
99 spin:constraint 99 spin:constraint
100 [ rdf:type spl:Argument ; 100 [ rdf:type spl:Argument ;
101 - rdfs:comment "The value to match against."^^xsd:string ;
102 - spl:predicate sp:arg1
103 - ] ;
104 - spin:constraint
105 - [ rdf:type spl:Argument ;
106 rdfs:comment "The property that must be used in the result resource."^^xsd:string ; 101 rdfs:comment "The property that must be used in the result resource."^^xsd:string ;
107 spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ; 102 spl:predicate <http://topbraid.org/spin/spinmapl#predicate> ;
108 spl:valueType rdf:Property 103 spl:valueType rdf:Property
109 ] ; 104 ] ;
105 + spin:constraint
106 + [ rdf:type spl:Argument ;
107 + rdfs:comment "The value to match against."^^xsd:string ;
108 + spl:predicate sp:arg1
109 + ] ;
110 spin:returnType rdfs:Resource . 110 spin:returnType rdfs:Resource .
111 111
112 npdata:npd 112 npdata:npd
...@@ -513,15 +513,15 @@ rhspin:dtypeValue ...@@ -513,15 +513,15 @@ rhspin:dtypeValue
513 ] ; 513 ] ;
514 spin:constraint 514 spin:constraint
515 [ rdf:type spl:Argument ; 515 [ rdf:type spl:Argument ;
516 - rdfs:comment "The predicate that points to the reified value."^^xsd:string ;
517 - spl:predicate sp:arg2 ;
518 - spl:valueType rdf:Property
519 - ] ;
520 - spin:constraint
521 - [ rdf:type spl:Argument ;
522 rdfs:comment "The subject of the value."^^xsd:string ; 516 rdfs:comment "The subject of the value."^^xsd:string ;
523 spl:predicate sp:arg1 ; 517 spl:predicate sp:arg1 ;
524 spl:valueType rdfs:Resource 518 spl:valueType rdfs:Resource
519 + ] ;
520 + spin:constraint
521 + [ rdf:type spl:Argument ;
522 + rdfs:comment "The predicate that points to the reified value."^^xsd:string ;
523 + spl:predicate sp:arg2 ;
524 + spl:valueType rdf:Property
525 ] . 525 ] .
526 526
527 rhspin:facilityById 527 rhspin:facilityById
...@@ -570,7 +570,7 @@ rhspin:fieldById ...@@ -570,7 +570,7 @@ rhspin:fieldById
570 570
571 rhspin:graphForDDR 571 rhspin:graphForDDR
572 rdf:type spin:Function ; 572 rdf:type spin:Function ;
573 - rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given DDR."^^xsd:string ; 573 + rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given DDR. This function needs to be called on the (in-memory) graph that contains the newly generated DDR triples. To get the graph for a DDR later, fetch the well bore id from the reports metadata graph and then call rhspin:graphForWellBoreWithId."^^xsd:string ;
574 rdfs:label "graph for DDR"^^xsd:string ; 574 rdfs:label "graph for DDR"^^xsd:string ;
575 rdfs:subClassOf spin:Functions ; 575 rdfs:subClassOf spin:Functions ;
576 spin:body 576 spin:body
...@@ -617,6 +617,61 @@ rhspin:graphForDDR ...@@ -617,6 +617,61 @@ rhspin:graphForDDR
617 ] ; 617 ] ;
618 spin:returnType rdfs:Resource . 618 spin:returnType rdfs:Resource .
619 619
620 +rhspin:graphForWellBoreWithId
621 + rdf:type spin:Function ;
622 + rdfs:comment "Gets the URI resource of the named graph that holds the reports for a given well bore."^^xsd:string ;
623 + rdfs:label "graph for well bore with id"^^xsd:string ;
624 + rdfs:subClassOf spin:Functions ;
625 + spin:body
626 + [ rdf:type sp:Select ;
627 + sp:resultVariables ([ rdf:type sp:iri ;
628 + sp:arg1 [ sp:varName "uri"^^xsd:string
629 + ]
630 + ]) ;
631 + sp:where ([ rdf:type sp:NamedGraph ;
632 + sp:elements ([ sp:object
633 + [ sp:varName "id"^^xsd:string
634 + ] ;
635 + sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
636 + sp:subject
637 + [ sp:varName "wellBore"^^xsd:string
638 + ]
639 + ] [ sp:object
640 + [ sp:varName "licence"^^xsd:string
641 + ] ;
642 + sp:predicate <http://www.reportinghub.no/np/schema/npd#drilledInProductionLicence> ;
643 + sp:subject
644 + [ sp:varName "wellBore"^^xsd:string
645 + ]
646 + ] [ sp:object
647 + [ sp:varName "licenceId"^^xsd:string
648 + ] ;
649 + sp:predicate <http://www.reportinghub.no/np/schema/npd#id> ;
650 + sp:subject
651 + [ sp:varName "licence"^^xsd:string
652 + ]
653 + ]) ;
654 + sp:graphNameNode npdata:npd
655 + ] [ rdf:type sp:Bind ;
656 + sp:expression
657 + [ rdf:type fn:concat ;
658 + sp:arg1 "https://www.reportinghub.no/ep/graph/licence-" ;
659 + sp:arg2 [ sp:varName "licenceId"^^xsd:string
660 + ]
661 + ] ;
662 + sp:variable
663 + [ sp:varName "uri"^^xsd:string
664 + ]
665 + ])
666 + ] ;
667 + spin:constraint
668 + [ rdf:type spl:Argument ;
669 + rdfs:comment "The id of the well bore to get the graph for."^^xsd:string ;
670 + spl:predicate arg:id ;
671 + spl:valueType xsd:string
672 + ] ;
673 + spin:returnType rdfs:Resource .
674 +
620 rhspin:licenceById 675 rhspin:licenceById
621 rdf:type spin:Function ; 676 rdf:type spin:Function ;
622 rdfs:label "license by id"^^xsd:string ; 677 rdfs:label "license by id"^^xsd:string ;
...@@ -819,8 +874,9 @@ rhspin:npdTripleExists ...@@ -819,8 +874,9 @@ rhspin:npdTripleExists
819 ] ; 874 ] ;
820 spin:constraint 875 spin:constraint
821 [ rdf:type spl:Argument ; 876 [ rdf:type spl:Argument ;
822 - rdfs:comment "The object to match."^^xsd:string ; 877 + rdfs:comment "The subject to find"^^xsd:string ;
823 - spl:predicate sp:arg3 878 + spl:predicate sp:arg1 ;
879 + spl:valueType rdfs:Resource
824 ] ; 880 ] ;
825 spin:constraint 881 spin:constraint
826 [ rdf:type spl:Argument ; 882 [ rdf:type spl:Argument ;
...@@ -830,9 +886,8 @@ rhspin:npdTripleExists ...@@ -830,9 +886,8 @@ rhspin:npdTripleExists
830 ] ; 886 ] ;
831 spin:constraint 887 spin:constraint
832 [ rdf:type spl:Argument ; 888 [ rdf:type spl:Argument ;
833 - rdfs:comment "The subject to find"^^xsd:string ; 889 + rdfs:comment "The object to match."^^xsd:string ;
834 - spl:predicate sp:arg1 ; 890 + spl:predicate sp:arg3
835 - spl:valueType rdfs:Resource
836 ] ; 891 ] ;
837 spin:returnType xsd:boolean . 892 spin:returnType xsd:boolean .
838 893
...@@ -979,15 +1034,6 @@ rhspin:wellByName ...@@ -979,15 +1034,6 @@ rhspin:wellByName
979 ] ; 1034 ] ;
980 spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> . 1035 spin:returnType <http://www.reportinghub.no/ep/schema/well#Well> .
981 1036
982 -_:b17
983 - sp:varName "wellBore"^^xsd:string .
984 -
985 -_:b16
986 - sp:varName "company"^^xsd:string .
987 -
988 -_:b15
989 - sp:varName "companyName"^^xsd:string .
990 -
991 _:b39 1037 _:b39
992 sp:varName "wellBore"^^xsd:string . 1038 sp:varName "wellBore"^^xsd:string .
993 1039
...@@ -1054,6 +1100,15 @@ _:b19 ...@@ -1054,6 +1100,15 @@ _:b19
1054 _:b18 1100 _:b18
1055 sp:varName "startedAt"^^xsd:string . 1101 sp:varName "startedAt"^^xsd:string .
1056 1102
1103 +_:b17
1104 + sp:varName "wellBore"^^xsd:string .
1105 +
1106 +_:b16
1107 + sp:varName "company"^^xsd:string .
1108 +
1109 +_:b15
1110 + sp:varName "companyName"^^xsd:string .
1111 +
1057 _:b14 1112 _:b14
1058 sp:varName "company"^^xsd:string . 1113 sp:varName "company"^^xsd:string .
1059 1114
......