TRANSFORM_dpr-productVolume-v1.1.1.ttl 46.2 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854
# baseURI: http://www.reportinghub.no/ep/transform/1.0/dpr/productVolume
# imports: http://spinrdf.org/spin
# imports: http://www.reportinghub.no/ep/dpr/spin/1.1/lib
# imports: http://www.reportinghub.no/ep/schema/1.0/core
# imports: http://www.reportinghub.no/ep/schema/1.0/facility
# imports: http://www.reportinghub.no/ep/schema/1.0/production-core
# imports: http://www.reportinghub.no/ep/schema/1.0/production-facility
# imports: http://www.reportinghub.no/ep/spin/1.1/lib
# imports: http://www.witsml.org/schemas/131/addendum/combo

@prefix :        <http://www.reportinghub.no/ep/transform/1.0/dpr/productVolume#> .
@prefix afn:     <http://jena.hpl.hp.com/ARQ/function#> .
@prefix arg:     <http://spinrdf.org/arg#> .
@prefix ep-dpr-spin-lib:  <http://www.reportinghub.no/ep/dpr/spin/1.1/lib#> .
@prefix ep-spin-lib:  <http://www.reportinghub.no/ep/spin/lib#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix rhspin:  <http://www.reportinghub.no/spin/rh#> .
@prefix smf:     <http://topbraid.org/sparqlmotionfunctions#> .
@prefix sp:      <http://spinrdf.org/sp#> .
@prefix spin:    <http://spinrdf.org/spin#> .
@prefix spl:     <http://spinrdf.org/spl#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://www.reportinghub.no/ep/transform/1.0/dpr/productVolume>
      rdf:type owl:Ontology ;
      owl:imports <http://www.reportinghub.no/ep/schema/1.0/production-facility> , <http://www.reportinghub.no/ep/schema/1.0/facility> , <http://www.reportinghub.no/ep/dpr/spin/1.1/lib> , <http://www.witsml.org/schemas/131/addendum/combo> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/spin/1.1/lib> , <http://www.reportinghub.no/ep/schema/1.0/production-core> , <http://www.reportinghub.no/ep/schema/1.0/core> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .

<http://www.witsml.org/schemas/131/addendum/combo#Co_productVolume>
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "STEP 20105 record the temporal parts of product flows"^^xsd:string ;
                sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/flow#TemporalPartOfAProductFlow> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b1
                          ] [ sp:object
                                    [ sp:varName "temporalPartOfAFlowDurationType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject _:b1
                          ] [ sp:object
                                    [ sp:varName "productFlowToDate"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject _:b1
                          ] [ sp:object
                                    [ sp:varName "endTime"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/activity#finishedAt> ;
                            sp:subject _:b1
                          ] [ sp:object _:b2 ;
                            sp:predicate
                                    [ sp:varName "relationshipToMeasure"^^xsd:string
                                    ] ;
                            sp:subject _:b1
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Volume> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b2
                          ] [ sp:object
                                    [ sp:varName "realVolume"^^xsd:string
                                    ] ;
                            sp:predicate
                                    [ sp:varName "volumeScale"^^xsd:string
                                    ] ;
                            sp:subject _:b2
                          ] [ sp:object _:b3 ;
                            sp:predicate
                                    [ sp:varName "relationshipToMeasure"^^xsd:string
                                    ] ;
                            sp:subject _:b1
                          ] [ sp:object
                                    [ sp:varName "volumeStdType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject _:b3
                          ] [ sp:object
                                    [ sp:varName "realVolumeStd"^^xsd:string
                                    ] ;
                            sp:predicate
                                    [ sp:varName "volumeStdScale"^^xsd:string
                                    ] ;
                            sp:subject _:b3
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "standardTempPres"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#standardTempPresRef> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#facilityRef> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "flowRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#flowRef> ;
                            sp:subject
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#productRef> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject
                                    [ sp:varName "productFlowToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "periodRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#periodRef> ;
                            sp:subject
                                    [ sp:varName "productRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "periodKindRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
                            sp:subject
                                    [ sp:varName "periodRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "endTime"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#dTimEnd> ;
                            sp:subject
                                    [ sp:varName "periodRef"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "volumeRef"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#volumeRef> ;
                                        sp:subject
                                                [ sp:varName "periodRef"^^xsd:string
                                                ]
                                      ] [ sp:object
                                                [ sp:varName "realVolume"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                                        sp:subject
                                                [ sp:varName "volumeRef"^^xsd:string
                                                ]
                                      ] [ sp:object
                                                [ sp:varName "uomVolume"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#uomRef> ;
                                        sp:subject
                                                [ sp:varName "volumeRef"^^xsd:string
                                                ]
                                      ])
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "volumeStdRef"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#volumeStdRef> ;
                                        sp:subject
                                                [ sp:varName "periodRef"^^xsd:string
                                                ]
                                      ] [ sp:object
                                                [ sp:varName "realVolumeStd"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                                        sp:subject
                                                [ sp:varName "volumeStdRef"^^xsd:string
                                                ]
                                      ] [ sp:object
                                                [ sp:varName "uomVolumeStd"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#uomRef> ;
                                        sp:subject
                                                [ sp:varName "volumeStdRef"^^xsd:string
                                                ]
                                      ])
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectRelationshipToMeasure ;
                                      sp:arg1 [ sp:varName "periodKindRef"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "relationshipToMeasure"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectTemporalPartOfAFlowDurationType ;
                                      sp:arg1 [ sp:varName "periodKindRef"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "temporalPartOfAFlowDurationType"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectVolumeAtStandardTemperaturePressureType ;
                                      sp:arg1 [ sp:varName "standardTempPres"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "volumeStdType"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectVolumeScale ;
                                      sp:arg1 [ sp:varName "uomVolume"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "volumeScale"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectVolumeScale ;
                                      sp:arg1 [ sp:varName "uomVolumeStd"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "volumeStdScale"^^xsd:string
                                    ]
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment """STEP 20102 Record the Facility that has the flows
Nothing is done with the namingSystem!"""^^xsd:string ;
                sp:templates ([ sp:object <http://www.reportinghub.no/ep/schema/facility#ProductionFacility> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b4
                          ] [ sp:object _:b5 ;
                            sp:predicate rdf:type ;
                            sp:subject _:b4
                          ]) ;
                sp:where ([ sp:object _:b6 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#facilityRef> ;
                            sp:subject spin:_this
                          ] [ sp:object _:b7 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#nameRef> ;
                            sp:subject _:b6
                          ] [ sp:object _:b8 ;
                            sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                            sp:subject _:b7
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "facilityNamingSystem"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#namingSystem> ;
                                        sp:subject _:b7
                                      ])
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object _:b9 ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
                                        sp:subject _:b7
                                      ])
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 _:b8
                                    ] ;
                            sp:variable _:b10
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductionFacilityURI ;
                                      sp:arg1 _:b10
                                    ] ;
                            sp:variable _:b4
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFacilityType ;
                                      sp:arg1 _:b9
                                    ] ;
                            sp:variable _:b5
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment """STEP 20103b record the related facility
nothing is done with the facilityParent1 or facilityParent2 of the related facility"""^^xsd:string ;
                sp:templates ([ sp:object _:b11 ;
                            sp:predicate _:b12 ;
                            sp:subject _:b13
                          ] [ sp:object _:b14 ;
                            sp:predicate rdf:type ;
                            sp:subject _:b11
                          ]) ;
                sp:where ([ sp:object _:b15 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#facilityRef> ;
                            sp:subject spin:_this
                          ] [ sp:object _:b16 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#flowRef> ;
                            sp:subject _:b15
                          ] [ sp:object _:b17 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#name> ;
                            sp:subject _:b16
                          ] [ sp:object _:b18 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#directionRef> ;
                            sp:subject _:b16
                          ] [ sp:object _:b19 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#relatedFacilityRef> ;
                            sp:subject _:b16
                          ] [ sp:object _:b20 ;
                            sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                            sp:subject _:b19
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object _:b21 ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
                                        sp:subject _:b19
                                      ])
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 _:b17
                                    ] ;
                            sp:variable _:b22
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductionFlowURI ;
                                      sp:arg1 _:b22
                                    ] ;
                            sp:variable _:b13
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 _:b20
                                    ] ;
                            sp:variable _:b23
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductionFacilityURI ;
                                      sp:arg1 _:b23
                                    ] ;
                            sp:variable _:b11
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFacilityType ;
                                      sp:arg1 _:b21
                                    ] ;
                            sp:variable _:b14
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFlowDirectionInverseRelationshipType ;
                                      sp:arg1 _:b18
                                    ] ;
                            sp:variable _:b12
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment """STEP 20104 record the product flows
namingSystem not processed"""^^xsd:string ;
                sp:templates ([ sp:object
                                    [ sp:varName "productFlow"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
                            sp:subject
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlow> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productFlowName"^^xsd:string
                                    ] ;
                            sp:predicate rdfs:label ;
                            sp:subject
                                    [ sp:varName "productFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productFlow"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject _:b24
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowToDate> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b24
                          ] [ sp:object _:b24 ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
                            sp:subject
                                    [ sp:varName "productionFlowToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject _:b24
                          ]) ;
                sp:where ([ sp:object spin:_this ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject
                                    [ sp:varName "productionFlowsToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#facilityRef> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "flowRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#flowRef> ;
                            sp:subject
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowName"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#name> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#productRef> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject
                                    [ sp:varName "productionFlowToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject
                                    [ sp:varName "productionFlowToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productKind"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
                            sp:subject
                                    [ sp:varName "productRef"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "productNameRef"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#nameRef> ;
                                        sp:subject
                                                [ sp:varName "productRef"^^xsd:string
                                                ]
                                      ] [ sp:object
                                                [ sp:varName "productFlowName"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                                        sp:subject
                                                [ sp:varName "productNameRef"^^xsd:string
                                                ]
                                      ])
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductType ;
                                      sp:arg1 [ sp:varName "productKind"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productType"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type spl:object ;
                                      sp:arg1 [ sp:varName "productType"^^xsd:string
                                              ] ;
                                      sp:arg2 rdfs:label
                                    ] ;
                            sp:variable
                                    [ sp:varName "productTypeName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "productTypeName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedProductTypeName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "flowName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedFlowName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductFlowURI ;
                                      sp:arg1 [ sp:varName "normalizedFlowName"^^xsd:string
                                              ] ;
                                      sp:arg2 [ sp:varName "normalizedProductTypeName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productFlow"^^xsd:string
                                    ]
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "STEP 20103b record the related facility - only its kind is specified"^^xsd:string ;
                sp:templates ([ sp:object _:b25 ;
                            sp:predicate _:b26 ;
                            sp:subject _:b27
                          ] [ sp:object _:b28 ;
                            sp:predicate rdf:type ;
                            sp:subject _:b25
                          ]) ;
                sp:where ([ sp:object _:b29 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#facilityRef> ;
                            sp:subject spin:_this
                          ] [ sp:object _:b30 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#flowRef> ;
                            sp:subject _:b29
                          ] [ sp:object _:b31 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#name> ;
                            sp:subject _:b30
                          ] [ sp:object _:b32 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#directionRef> ;
                            sp:subject _:b30
                          ] [ sp:object _:b33 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#relatedFacilityRef> ;
                            sp:subject _:b30
                          ] [ sp:object _:b34 ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
                            sp:subject _:b33
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 _:b31
                                    ] ;
                            sp:variable _:b35
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductionFlowURI ;
                                      sp:arg1 _:b35
                                    ] ;
                            sp:variable _:b27
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFacilityType ;
                                      sp:arg1 _:b34
                                    ] ;
                            sp:variable _:b28
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFlowDirectionInverseRelationshipType ;
                                      sp:arg1 _:b32
                                    ] ;
                            sp:variable _:b26
                          ])
              ] ;
      spin:rule
              [ rdf:type sp:Construct ;
                rdfs:comment "STEP 20103a record the flows"^^xsd:string ;
                sp:templates ([ sp:object
                                    [ sp:varName "productionFacility"^^xsd:string
                                    ] ;
                            sp:predicate
                                    [ sp:varName "productionFlowDirectionRelationshipType"^^xsd:string
                                    ] ;
                            sp:subject
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlow> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFlowPurposeType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFlowDefinitionType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowName"^^xsd:string
                                    ] ;
                            sp:predicate rdfs:label ;
                            sp:subject
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject _:b36
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowToDate> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b36
                          ] [ sp:object _:b36 ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasNetworkPart> ;
                            sp:subject
                                    [ sp:varName "productionFlowsToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject _:b36
                          ]) ;
                sp:where ([ sp:object spin:_this ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject
                                    [ sp:varName "dailyProductionFlows"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFlowsToDate"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject
                                    [ sp:varName "dailyProductionFlows"^^xsd:string
                                    ]
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowToDate> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productionFlowsToDate"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#facilityRef> ;
                            sp:subject spin:_this
                          ] [ sp:object
                                    [ sp:varName "facilityNameRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#nameRef> ;
                            sp:subject
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "facilityName"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.linkedmodel.org/schema/dtype#value> ;
                            sp:subject
                                    [ sp:varName "facilityNameRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#flowRef> ;
                            sp:subject
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowName"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#name> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowKind"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#kindRef> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowDirection"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#directionRef> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "flowQualifier"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.witsml.org/schemas/131/addendum/combo#qualifierRef> ;
                                        sp:subject
                                                [ sp:varName "flowRef"^^xsd:string
                                                ]
                                      ])
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "facilityName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedFacilityName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductionFacilityURI ;
                                      sp:arg1 [ sp:varName "normalizedFacilityName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFacility"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-spin-lib:normalizeString ;
                                      sp:arg1 [ sp:varName "flowName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "normalizedFlowName"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:buildProductionFlowURI ;
                                      sp:arg1 [ sp:varName "normalizedFlowName"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFlow"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFlowPurposeType ;
                                      sp:arg1 [ sp:varName "flowKind"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFlowPurposeType"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFlowDefinitionType ;
                                      sp:arg1 [ sp:varName "flowQualifier"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFlowDefinitionType"^^xsd:string
                                    ]
                          ] [ rdf:type sp:Bind ;
                            sp:expression
                                    [ rdf:type ep-dpr-spin-lib:selectProductionFlowDirectionRelationshipType ;
                                      sp:arg1 [ sp:varName "flowDirection"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFlowDirectionRelationshipType"^^xsd:string
                                    ]
                          ])
              ] .

_:b11
      sp:varName "relatedFacility"^^xsd:string .

_:b12
      sp:varName "productionFlowDirectionInverseRelationshipType"^^xsd:string .

_:b13
      sp:varName "productionFlow"^^xsd:string .

_:b14
      sp:varName "relatedFacilityType"^^xsd:string .

_:b15
      sp:varName "facilityRef"^^xsd:string .

_:b16
      sp:varName "flowRef"^^xsd:string .

_:b17
      sp:varName "flowName"^^xsd:string .

_:b18
      sp:varName "flowDirection"^^xsd:string .

_:b19
      sp:varName "relatedFacilityRef"^^xsd:string .

_:b20
      sp:varName "relatedFacilityName"^^xsd:string .

_:b21
      sp:varName "relatedFacilityKind"^^xsd:string .

_:b22
      sp:varName "normalizedFlowName"^^xsd:string .

_:b23
      sp:varName "normalizedRelatedFacilityName"^^xsd:string .

_:b4  sp:varName "productionFacility"^^xsd:string .

_:b5  sp:varName "productionFacilityType"^^xsd:string .

_:b6  sp:varName "facilityRef"^^xsd:string .

_:b7  sp:varName "facilityNameRef"^^xsd:string .

_:b8  sp:varName "facilityName"^^xsd:string .

_:b9  sp:varName "facilityKind"^^xsd:string .

_:b10
      sp:varName "normalizedFacilityName"^^xsd:string .

_:b26
      sp:varName "productionFlowDirectionInverseRelationshipType"^^xsd:string .

_:b27
      sp:varName "productionFlow"^^xsd:string .

_:b28
      sp:varName "relatedFacilityType"^^xsd:string .

_:b29
      sp:varName "facilityRef"^^xsd:string .

_:b30
      sp:varName "flowRef"^^xsd:string .

_:b31
      sp:varName "flowName"^^xsd:string .

_:b32
      sp:varName "flowDirection"^^xsd:string .

_:b33
      sp:varName "relatedFacilityRef"^^xsd:string .

_:b34
      sp:varName "relatedFacilityKind"^^xsd:string .

_:b35
      sp:varName "normalizedFlowName"^^xsd:string .