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,40 +497,198 @@ mpr-tables:ProductionFlowsAll ...@@ -484,40 +497,198 @@ 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
569 + ]
570 + ] [ rdf:type sp:Bind ;
571 + sp:expression
572 + [ rdf:type fn:concat ;
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 + ]
582 + ] ;
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> ;
590 + sp:subject
591 + [ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
592 + ]
593 + ] [ rdf:type sp:Optional ;
594 + sp:elements ([ sp:object
595 + [ sp:varName "temperature"^^xsd:string
596 + ] ;
597 + sp:predicate rdf:type ;
598 + sp:subject
599 + [ sp:varName "stateOfMaterialThatFlowsInPeriod"^^xsd:string
600 + ]
601 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Temperature> ;
602 + sp:predicate rdf:type ;
603 + sp:subject
604 + [ sp:varName "temperature"^^xsd:string
605 + ]
606 + ] [ sp:object
607 + [ sp:varName "temperatureInCelcius"^^xsd:string
608 + ] ;
609 + sp:predicate <http://www.reportinghub.no/ep/schema/core#celsius> ;
610 + sp:subject
611 + [ sp:varName "temperature"^^xsd:string
612 + ]
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
504 ] 662 ]
505 ]) 663 ])
506 ] [ rdf:type sp:Optional ; 664 ] [ rdf:type sp:Optional ;
507 sp:elements ([ sp:object 665 sp:elements ([ sp:object
508 - [ sp:varName "productionFlowPart"^^xsd:string 666 + [ sp:varName "productionFlowPurposeType"^^xsd:string
509 ] ; 667 ] ;
510 - sp:predicate <http://www.reportinghub.no/ep/schema/flow#hasMixedPart> ; 668 + sp:predicate rdf:type ;
511 sp:subject 669 sp:subject
512 - [ sp:varName "productionFlow"^^xsd:string 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
513 ] 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 + ])
514 ] [ rdf:type sp:Optional ; 685 ] [ rdf:type sp:Optional ;
515 sp:elements ([ sp:object 686 sp:elements ([ sp:object
516 [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string 687 [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
517 ] ; 688 ] ;
518 sp:predicate rdf:type ; 689 sp:predicate rdf:type ;
519 sp:subject 690 sp:subject
520 - [ sp:varName "productionFlowPart"^^xsd:string 691 + [ sp:varName "productionFlowMixedPart"^^xsd:string
521 ] 692 ]
522 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowGrossOrNetType> ; 693 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductFlowGrossOrNetType> ;
523 sp:predicate rdf:type ; 694 sp:predicate rdf:type ;
...@@ -525,7 +696,7 @@ mpr-tables:ProductionFlowsAll ...@@ -525,7 +696,7 @@ mpr-tables:ProductionFlowsAll
525 [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string 696 [ sp:varName "productionFlowPartGrossOrNetType"^^xsd:string
526 ] 697 ]
527 ] [ sp:object 698 ] [ sp:object
528 - [ sp:varName "productionFlowPartGrossOrNetTypeName"^^xsd:string 699 + [ sp:varName "grossOrNet"^^xsd:string
529 ] ; 700 ] ;
530 sp:predicate rdfs:label ; 701 sp:predicate rdfs:label ;
531 sp:subject 702 sp:subject
...@@ -538,7 +709,7 @@ mpr-tables:ProductionFlowsAll ...@@ -538,7 +709,7 @@ mpr-tables:ProductionFlowsAll
538 ] ; 709 ] ;
539 sp:predicate rdf:type ; 710 sp:predicate rdf:type ;
540 sp:subject 711 sp:subject
541 - [ sp:varName "productionFlowPart"^^xsd:string 712 + [ sp:varName "productionFlowMixedPart"^^xsd:string
542 ] 713 ]
543 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ; 714 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
544 sp:predicate rdf:type ; 715 sp:predicate rdf:type ;
...@@ -546,7 +717,7 @@ mpr-tables:ProductionFlowsAll ...@@ -546,7 +717,7 @@ mpr-tables:ProductionFlowsAll
546 [ sp:varName "productFlowMaterialType"^^xsd:string 717 [ sp:varName "productFlowMaterialType"^^xsd:string
547 ] 718 ]
548 ] [ sp:object 719 ] [ sp:object
549 - [ sp:varName "productFlowMaterialTypeName"^^xsd:string 720 + [ sp:varName "materialTypeName"^^xsd:string
550 ] ; 721 ] ;
551 sp:predicate rdfs:label ; 722 sp:predicate rdfs:label ;
552 sp:subject 723 sp:subject
...@@ -559,7 +730,7 @@ mpr-tables:ProductionFlowsAll ...@@ -559,7 +730,7 @@ mpr-tables:ProductionFlowsAll
559 ] ; 730 ] ;
560 sp:predicate rdf:type ; 731 sp:predicate rdf:type ;
561 sp:subject 732 sp:subject
562 - [ sp:varName "productionFlowPart"^^xsd:string 733 + [ sp:varName "productionFlowMixedPart"^^xsd:string
563 ] 734 ]
564 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionType> ; 735 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionType> ;
565 sp:predicate rdf:type ; 736 sp:predicate rdf:type ;
...@@ -567,7 +738,7 @@ mpr-tables:ProductionFlowsAll ...@@ -567,7 +738,7 @@ mpr-tables:ProductionFlowsAll
567 [ sp:varName "productionFlowDefinitionType"^^xsd:string 738 [ sp:varName "productionFlowDefinitionType"^^xsd:string
568 ] 739 ]
569 ] [ sp:object 740 ] [ sp:object
570 - [ sp:varName "productionFlowDefinitionTypeName"^^xsd:string 741 + [ sp:varName "definitionTypeName"^^xsd:string
571 ] ; 742 ] ;
572 sp:predicate rdfs:label ; 743 sp:predicate rdfs:label ;
573 sp:subject 744 sp:subject
...@@ -580,7 +751,7 @@ mpr-tables:ProductionFlowsAll ...@@ -580,7 +751,7 @@ mpr-tables:ProductionFlowsAll
580 ] ; 751 ] ;
581 sp:predicate rdf:type ; 752 sp:predicate rdf:type ;
582 sp:subject 753 sp:subject
583 - [ sp:varName "productionFlowPart"^^xsd:string 754 + [ sp:varName "productionFlowMixedPart"^^xsd:string
584 ] 755 ]
585 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionSubType> ; 756 ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowDefinitionSubType> ;
586 sp:predicate rdf:type ; 757 sp:predicate rdf:type ;
...@@ -588,7 +759,7 @@ mpr-tables:ProductionFlowsAll ...@@ -588,7 +759,7 @@ mpr-tables:ProductionFlowsAll
588 [ sp:varName "productionFlowDefinitionSubType"^^xsd:string 759 [ sp:varName "productionFlowDefinitionSubType"^^xsd:string
589 ] 760 ]
590 ] [ sp:object 761 ] [ sp:object
591 - [ sp:varName "productionFlowDefinitionSubTypeName"^^xsd:string 762 + [ sp:varName "definitionSubTypeName"^^xsd:string
592 ] ; 763 ] ;
593 sp:predicate rdfs:label ; 764 sp:predicate rdfs:label ;
594 sp:subject 765 sp:subject
...@@ -596,9 +767,8 @@ mpr-tables:ProductionFlowsAll ...@@ -596,9 +767,8 @@ mpr-tables:ProductionFlowsAll
596 ] 767 ]
597 ]) 768 ])
598 ]) 769 ])
599 - ])
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 ;
......