David Price

Added to Flow All table

...@@ -4,12 +4,15 @@ ...@@ -4,12 +4,15 @@
4 # imports: http://www.reportinghub.no/ep/spin/1.1/lib 4 # imports: http://www.reportinghub.no/ep/spin/1.1/lib
5 # imports: http://www.reportinghub.no/ep/transform/transform-helper-schema 5 # imports: http://www.reportinghub.no/ep/transform/transform-helper-schema
6 6
7 +@prefix arg: <http://spinrdf.org/arg#> .
8 +@prefix fn: <http://www.w3.org/2005/xpath-functions#> .
7 @prefix mpr-tables: <http://www.reportinghub.no/ep/spin/mpr-tables#> . 9 @prefix mpr-tables: <http://www.reportinghub.no/ep/spin/mpr-tables#> .
8 @prefix owl: <http://www.w3.org/2002/07/owl#> . 10 @prefix owl: <http://www.w3.org/2002/07/owl#> .
9 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . 11 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
10 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . 12 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
11 @prefix rhspin: <http://www.reportinghub.no/spin/rh#> . 13 @prefix rhspin: <http://www.reportinghub.no/spin/rh#> .
12 @prefix sp: <http://spinrdf.org/sp#> . 14 @prefix sp: <http://spinrdf.org/sp#> .
15 +@prefix spif: <http://spinrdf.org/spif#> .
13 @prefix spin: <http://spinrdf.org/spin#> . 16 @prefix spin: <http://spinrdf.org/spin#> .
14 @prefix spl: <http://spinrdf.org/spl#> . 17 @prefix spl: <http://spinrdf.org/spl#> .
15 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . 18 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
...@@ -405,15 +408,18 @@ mpr-tables:ProductionFlowsAll ...@@ -405,15 +408,18 @@ mpr-tables:ProductionFlowsAll
405 rdfs:subClassOf rhspin:MPRGTableTemplates ; 408 rdfs:subClassOf rhspin:MPRGTableTemplates ;
406 spin:body 409 spin:body
407 [ rdf:type sp:Select ; 410 [ rdf:type sp:Select ;
408 - sp:orderBy ([ sp:varName "productionFlowFacilityName"^^xsd:string 411 + sp:orderBy ([ sp:varName "facilityName"^^xsd:string
409 - ] [ sp:varName "productionFlowPurposeTypeName"^^xsd:string 412 + ] [ sp:varName "purposeTypeName"^^xsd:string
410 ]) ; 413 ]) ;
411 - sp:resultVariables ([ sp:varName "productionFlowFacilityName"^^xsd:string 414 + sp:resultVariables ([ sp:varName "facilityName"^^xsd:string
412 - ] [ sp:varName "productionFlowPurposeTypeName"^^xsd:string 415 + ] [ sp:varName "purposeTypeName"^^xsd:string
413 - ] [ sp:varName "productFlowMaterialTypeName"^^xsd:string 416 + ] [ sp:varName "materialTypeName"^^xsd:string
414 - ] [ sp:varName "productionFlowDefinitionTypeName"^^xsd:string 417 + ] [ sp:varName "massValueString"^^xsd:string
415 - ] [ sp:varName "productionFlowDefinitionSubTypeName"^^xsd:string 418 + ] [ sp:varName "volumeValueString"^^xsd:string
416 - ] [ sp:varName "productionFlowPartGrossOrNetTypeName"^^xsd:string 419 + ] [ sp:varName "temperatureInCelcius"^^xsd:string
420 + ] [ sp:varName "definitionTypeName"^^xsd:string
421 + ] [ sp:varName "definitionSubTypeName"^^xsd:string
422 + ] [ sp:varName "grossOrNet"^^xsd:string
417 ]) ; 423 ]) ;
418 sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ; 424 sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
419 sp:predicate rdf:type ; 425 sp:predicate rdf:type ;
...@@ -457,7 +463,7 @@ mpr-tables:ProductionFlowsAll ...@@ -457,7 +463,7 @@ mpr-tables:ProductionFlowsAll
457 [ sp:varName "productionFlowInReportingPeriod"^^xsd:string 463 [ sp:varName "productionFlowInReportingPeriod"^^xsd:string
458 ] 464 ]
459 ] [ sp:object 465 ] [ sp:object
460 - [ sp:varName "productionFlow"^^xsd:string 466 + [ sp:varName "productionFlowWhole"^^xsd:string
461 ] ; 467 ] ;
462 sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ; 468 sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
463 sp:subject 469 sp:subject
...@@ -466,17 +472,24 @@ mpr-tables:ProductionFlowsAll ...@@ -466,17 +472,24 @@ mpr-tables:ProductionFlowsAll
466 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#WholeLifeProductionFlow> ; 472 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#WholeLifeProductionFlow> ;
467 sp:predicate rdf:type ; 473 sp:predicate rdf:type ;
468 sp:subject 474 sp:subject
469 - [ sp:varName "productionFlow"^^xsd:string 475 + [ sp:varName "productionFlowWhole"^^xsd:string
476 + ]
477 + ] [ sp:object
478 + [ sp:varName "productionFlowMixedPart"^^xsd:string
479 + ] ;
480 + sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
481 + sp:subject
482 + [ sp:varName "productionFlowWhole"^^xsd:string
470 ] 483 ]
471 ] [ sp:object 484 ] [ sp:object
472 [ sp:varName "productionFlowFacility"^^xsd:string 485 [ sp:varName "productionFlowFacility"^^xsd:string
473 ] ; 486 ] ;
474 sp:predicate <http://www.reportinghub.no/ep/schema/flow#flowIntoOrOutOf> ; 487 sp:predicate <http://www.reportinghub.no/ep/schema/flow#flowIntoOrOutOf> ;
475 sp:subject 488 sp:subject
476 - [ sp:varName "productionFlow"^^xsd:string 489 + [ sp:varName "productionFlowWhole"^^xsd:string
477 ] 490 ]
478 ] [ sp:object 491 ] [ sp:object
479 - [ sp:varName "productionFlowFacilityName"^^xsd:string 492 + [ sp:varName "facilityName"^^xsd:string
480 ] ; 493 ] ;
481 sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ; 494 sp:predicate <http://www.reportinghub.no/np/schema/npd#name> ;
482 sp:subject 495 sp:subject
...@@ -484,121 +497,278 @@ mpr-tables:ProductionFlowsAll ...@@ -484,121 +497,278 @@ mpr-tables:ProductionFlowsAll
484 ] 497 ]
485 ] [ rdf:type sp:Optional ; 498 ] [ rdf:type sp:Optional ;
486 sp:elements ([ sp:object 499 sp:elements ([ sp:object
487 - [ sp:varName "productionFlowPurposeType"^^xsd:string 500 + [ sp:varName "productionFlowMixedPart"^^xsd:string
488 ] ; 501 ] ;
502 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
503 + sp:subject
504 + [ sp:varName "productFlowMixedPart"^^xsd:string
505 + ]
506 + ] [ sp:object
507 + [ sp:varName "productFlowMixedPart"^^xsd:string
508 + ] ;
509 + sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ;
510 + sp:subject
511 + [ sp:varName "productionFlowInReportingPeriod"^^xsd:string
512 + ]
513 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlow> ;
489 sp:predicate rdf:type ; 514 sp:predicate rdf:type ;
490 sp:subject 515 sp:subject
491 - [ sp:varName "productionFlow"^^xsd:string 516 + [ sp:varName "productFlowMixedPart"^^xsd:string
492 ] 517 ]
493 - ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowPurposeType> ; 518 + ] [ sp:object
519 + [ sp:varName "productFlowMixedPart"^^xsd:string
520 + ] ;
521 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
522 + sp:subject
523 + [ sp:varName "flowDuringMonth"^^xsd:string
524 + ]
525 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#FlowDuringMonth> ;
494 sp:predicate rdf:type ; 526 sp:predicate rdf:type ;
495 sp:subject 527 sp:subject
496 - [ sp:varName "productionFlowPurposeType"^^xsd:string 528 + [ sp:varName "flowDuringMonth"^^xsd:string
497 ] 529 ]
498 ] [ sp:object 530 ] [ sp:object
499 - [ sp:varName "productionFlowPurposeTypeName"^^xsd:string 531 + [ sp:varName "flowDuringMonthMaterial"^^xsd:string
532 + ] ;
533 + sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialThatFlows> ;
534 + sp:subject
535 + [ sp:varName "flowDuringMonth"^^xsd:string
536 + ]
537 + ] [ sp:object
538 + [ sp:varName "materialQuantityValue"^^xsd:string
539 + ] ;
540 + sp:predicate rdf:type ;
541 + sp:subject
542 + [ sp:varName "flowDuringMonthMaterial"^^xsd:string
543 + ]
544 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Mass> ;
545 + sp:predicate rdf:type ;
546 + sp:subject
547 + [ sp:varName "materialQuantityValue"^^xsd:string
548 + ]
549 + ] [ sp:object
550 + [ sp:varName "materialValue"^^xsd:string
551 + ] ;
552 + sp:predicate
553 + [ sp:varName "materialProperty"^^xsd:string
554 + ] ;
555 + sp:subject
556 + [ sp:varName "materialQuantityValue"^^xsd:string
557 + ]
558 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
559 + sp:predicate rdf:type ;
560 + sp:subject
561 + [ sp:varName "materialProperty"^^xsd:string
562 + ]
563 + ] [ sp:object
564 + [ sp:varName "materialPropertyName"^^xsd:string
500 ] ; 565 ] ;
501 sp:predicate rdfs:label ; 566 sp:predicate rdfs:label ;
502 sp:subject 567 sp:subject
503 - [ sp:varName "productionFlowPurposeType"^^xsd:string 568 + [ sp:varName "materialProperty"^^xsd:string
504 ] 569 ]
505 - ]) 570 + ] [ rdf:type sp:Bind ;
506 - ] [ rdf:type sp:Optional ; 571 + sp:expression
507 - sp:elements ([ sp:object 572 + [ rdf:type fn:concat ;
508 - [ sp:varName "productionFlowPart"^^xsd:string 573 + sp:arg1 [ rdf:type spif:decimalFormat ;
574 + arg:number
575 + [ sp:varName "materialValue"^^xsd:string
576 + ] ;
577 + arg:pattern "#.##"
578 + ] ;
579 + sp:arg2 " " ;
580 + sp:arg3 [ sp:varName "materialPropertyName"^^xsd:string
581 + ]
509 ] ; 582 ] ;
510 - sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ; 583 + sp:variable
584 + [ sp:varName "massValueString"^^xsd:string
585 + ]
586 + ] [ sp:object
587 + [ sp:varName "flowDuringMonthMaterial"^^xsd:string
588 + ] ;
589 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
511 sp:subject 590 sp:subject
512 - [ sp:varName "productionFlow"^^xsd:string 591 + [ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
513 ] 592 ]
514 ] [ rdf:type sp:Optional ; 593 ] [ rdf:type sp:Optional ;
515 sp:elements ([ sp:object 594 sp:elements ([ sp:object
516 - [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string 595 + [ sp:varName "temperature"^^xsd:string
517 - ] ;
518 - sp:predicate rdf:type ;
519 - sp:subject
520 - [ sp:varName "productionFlowPart"^^xsd:string
521 - ]
522 - ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowGrossOrNetType> ;
523 - sp:predicate rdf:type ;
524 - sp:subject
525 - [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
526 - ]
527 - ] [ sp:object
528 - [ sp:varName "productionFlowPartGrossOrNetTypeName"^^xsd:string
529 - ] ;
530 - sp:predicate rdfs:label ;
531 - sp:subject
532 - [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
533 - ]
534 - ])
535 - ] [ rdf:type sp:Optional ;
536 - sp:elements ([ sp:object
537 - [ sp:varName "productFlowMaterialType"^^xsd:string
538 - ] ;
539 - sp:predicate rdf:type ;
540 - sp:subject
541 - [ sp:varName "productionFlowPart"^^xsd:string
542 - ]
543 - ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
544 - sp:predicate rdf:type ;
545 - sp:subject
546 - [ sp:varName "productFlowMaterialType"^^xsd:string
547 - ]
548 - ] [ sp:object
549 - [ sp:varName "productFlowMaterialTypeName"^^xsd:string
550 - ] ;
551 - sp:predicate rdfs:label ;
552 - sp:subject
553 - [ sp:varName "productFlowMaterialType"^^xsd:string
554 - ]
555 - ])
556 - ] [ rdf:type sp:Optional ;
557 - sp:elements ([ sp:object
558 - [ sp:varName "productionFlowDefinitionType"^^xsd:string
559 ] ; 596 ] ;
560 sp:predicate rdf:type ; 597 sp:predicate rdf:type ;
561 sp:subject 598 sp:subject
562 - [ sp:varName "productionFlowPart"^^xsd:string 599 + [ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
563 ] 600 ]
564 - ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionType> ; 601 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Temperature> ;
565 sp:predicate rdf:type ; 602 sp:predicate rdf:type ;
566 sp:subject 603 sp:subject
567 - [ sp:varName "productionFlowDefinitionType"^^xsd:string 604 + [ sp:varName "temperature"^^xsd:string
568 ] 605 ]
569 ] [ sp:object 606 ] [ sp:object
570 - [ sp:varName "productionFlowDefinitionTypeName"^^xsd:string 607 + [ sp:varName "temperatureInCelcius"^^xsd:string
571 ] ; 608 ] ;
572 - sp:predicate rdfs:label ; 609 + sp:predicate <http://www.reportinghub.no/ep/schema/core#celsius> ;
573 sp:subject 610 sp:subject
574 - [ sp:varName "productionFlowDefinitionType"^^xsd:string 611 + [ sp:varName "temperature"^^xsd:string
575 - ]
576 - ])
577 - ] [ rdf:type sp:Optional ;
578 - sp:elements ([ sp:object
579 - [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
580 - ] ;
581 - sp:predicate rdf:type ;
582 - sp:subject
583 - [ sp:varName "productionFlowPart"^^xsd:string
584 - ]
585 - ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionSubType> ;
586 - sp:predicate rdf:type ;
587 - sp:subject
588 - [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
589 - ]
590 - ] [ sp:object
591 - [ sp:varName "productionFlowDefinitionSubTypeName"^^xsd:string
592 - ] ;
593 - sp:predicate rdfs:label ;
594 - sp:subject
595 - [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
596 ] 612 ]
597 ]) 613 ])
614 + ] [ sp:object
615 + [ sp:varName "volume"^^xsd:string
616 + ] ;
617 + sp:predicate rdf:type ;
618 + sp:subject
619 + [ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
620 + ]
621 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Volume> ;
622 + sp:predicate rdf:type ;
623 + sp:subject
624 + [ sp:varName "volume"^^xsd:string
625 + ]
626 + ] [ sp:object
627 + [ sp:varName "volumeValue"^^xsd:string
628 + ] ;
629 + sp:predicate
630 + [ sp:varName "volumePredicate"^^xsd:string
631 + ] ;
632 + sp:subject
633 + [ sp:varName "volume"^^xsd:string
634 + ]
635 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
636 + sp:predicate rdf:type ;
637 + sp:subject
638 + [ sp:varName "volumePredicate"^^xsd:string
639 + ]
640 + ] [ sp:object
641 + [ sp:varName "volumeUnit"^^xsd:string
642 + ] ;
643 + sp:predicate rdfs:label ;
644 + sp:subject
645 + [ sp:varName "volumePredicate"^^xsd:string
646 + ]
647 + ] [ rdf:type sp:Bind ;
648 + sp:expression
649 + [ rdf:type fn:concat ;
650 + sp:arg1 [ rdf:type spif:decimalFormat ;
651 + arg:number
652 + [ sp:varName "volumeValue"^^xsd:string
653 + ] ;
654 + arg:pattern "#.##"
655 + ] ;
656 + sp:arg2 " " ;
657 + sp:arg3 [ sp:varName "volumeUnit"^^xsd:string
658 + ]
659 + ] ;
660 + sp:variable
661 + [ sp:varName "volumeValueString"^^xsd:string
662 + ]
663 + ])
664 + ] [ rdf:type sp:Optional ;
665 + sp:elements ([ sp:object
666 + [ sp:varName "productionFlowPurposeType"^^xsd:string
667 + ] ;
668 + sp:predicate rdf:type ;
669 + sp:subject
670 + [ sp:varName "productionFlowWhole"^^xsd:string
671 + ]
672 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowPurposeType> ;
673 + sp:predicate rdf:type ;
674 + sp:subject
675 + [ sp:varName "productionFlowPurposeType"^^xsd:string
676 + ]
677 + ] [ sp:object
678 + [ sp:varName "purposeTypeName"^^xsd:string
679 + ] ;
680 + sp:predicate rdfs:label ;
681 + sp:subject
682 + [ sp:varName "productionFlowPurposeType"^^xsd:string
683 + ]
684 + ])
685 + ] [ rdf:type sp:Optional ;
686 + sp:elements ([ sp:object
687 + [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
688 + ] ;
689 + sp:predicate rdf:type ;
690 + sp:subject
691 + [ sp:varName "productionFlowMixedPart"^^xsd:string
692 + ]
693 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowGrossOrNetType> ;
694 + sp:predicate rdf:type ;
695 + sp:subject
696 + [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
697 + ]
698 + ] [ sp:object
699 + [ sp:varName "grossOrNet"^^xsd:string
700 + ] ;
701 + sp:predicate rdfs:label ;
702 + sp:subject
703 + [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
704 + ]
705 + ])
706 + ] [ rdf:type sp:Optional ;
707 + sp:elements ([ sp:object
708 + [ sp:varName "productFlowMaterialType"^^xsd:string
709 + ] ;
710 + sp:predicate rdf:type ;
711 + sp:subject
712 + [ sp:varName "productionFlowMixedPart"^^xsd:string
713 + ]
714 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
715 + sp:predicate rdf:type ;
716 + sp:subject
717 + [ sp:varName "productFlowMaterialType"^^xsd:string
718 + ]
719 + ] [ sp:object
720 + [ sp:varName "materialTypeName"^^xsd:string
721 + ] ;
722 + sp:predicate rdfs:label ;
723 + sp:subject
724 + [ sp:varName "productFlowMaterialType"^^xsd:string
725 + ]
726 + ])
727 + ] [ rdf:type sp:Optional ;
728 + sp:elements ([ sp:object
729 + [ sp:varName "productionFlowDefinitionType"^^xsd:string
730 + ] ;
731 + sp:predicate rdf:type ;
732 + sp:subject
733 + [ sp:varName "productionFlowMixedPart"^^xsd:string
734 + ]
735 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionType> ;
736 + sp:predicate rdf:type ;
737 + sp:subject
738 + [ sp:varName "productionFlowDefinitionType"^^xsd:string
739 + ]
740 + ] [ sp:object
741 + [ sp:varName "definitionTypeName"^^xsd:string
742 + ] ;
743 + sp:predicate rdfs:label ;
744 + sp:subject
745 + [ sp:varName "productionFlowDefinitionType"^^xsd:string
746 + ]
747 + ])
748 + ] [ rdf:type sp:Optional ;
749 + sp:elements ([ sp:object
750 + [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
751 + ] ;
752 + sp:predicate rdf:type ;
753 + sp:subject
754 + [ sp:varName "productionFlowMixedPart"^^xsd:string
755 + ]
756 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionSubType> ;
757 + sp:predicate rdf:type ;
758 + sp:subject
759 + [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
760 + ]
761 + ] [ sp:object
762 + [ sp:varName "definitionSubTypeName"^^xsd:string
763 + ] ;
764 + sp:predicate rdfs:label ;
765 + sp:subject
766 + [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
767 + ]
598 ]) 768 ])
599 ]) 769 ])
600 ] ; 770 ] ;
601 - rhspin:tableHeaders ("Facility"^^xsd:string "Purpose"^^xsd:string "Material"^^xsd:string "Flow type"^^xsd:string "Flow subtype"^^xsd:string "Gross/Net"^^xsd:string) . 771 + rhspin:tableHeaders ("Facility"^^xsd:string "Purpose"^^xsd:string "Material"^^xsd:string "Mass"^^xsd:string "Volume"^^xsd:string "Temperature C"^^xsd:string "Flow type"^^xsd:string "Flow subtype"^^xsd:string "Gross/Net"^^xsd:string) .
602 772
603 mpr-tables:ProductionInventory 773 mpr-tables:ProductionInventory
604 rdf:type rhspin:TableTemplate ; 774 rdf:type rhspin:TableTemplate ;
......