David Price

Improved product inventory

...@@ -397,3 +397,351 @@ mpr-tables:ProductionFlows ...@@ -397,3 +397,351 @@ mpr-tables:ProductionFlows
397 ]) 397 ])
398 ] ; 398 ] ;
399 rhspin:tableHeaders ("facility"^^xsd:string "flow name"^^xsd:string "type"^^xsd:string "subtype"^^xsd:string "purpose"^^xsd:string "product"^^xsd:string "material type"^^xsd:string "gross or net"^^xsd:string "duration type"^^xsd:string "mass (kg)"^^xsd:string "pressure (atm)"^^xsd:string "temperature (C)"^^xsd:string "volume (m^3"^^xsd:string "gross calorific value (MJ/m^3)"^^xsd:string) . 399 rhspin:tableHeaders ("facility"^^xsd:string "flow name"^^xsd:string "type"^^xsd:string "subtype"^^xsd:string "purpose"^^xsd:string "product"^^xsd:string "material type"^^xsd:string "gross or net"^^xsd:string "duration type"^^xsd:string "mass (kg)"^^xsd:string "pressure (atm)"^^xsd:string "temperature (C)"^^xsd:string "volume (m^3"^^xsd:string "gross calorific value (MJ/m^3)"^^xsd:string) .
400 +
401 +mpr-tables:ProductionInventory
402 + rdf:type rhspin:TableTemplate ;
403 + rdfs:label "Production inventory"^^xsd:string ;
404 + rdfs:subClassOf rhspin:MPRGTableTemplates ;
405 + spin:body
406 + [ rdf:type sp:Select ;
407 + sp:resultVariables ([ sp:varName "wholeName"^^xsd:string
408 + ] [ sp:varName "wholeTypeName"^^xsd:string
409 + ] [ sp:varName "materialQuantityName"^^xsd:string
410 + ] [ sp:varName "materialPropertyName"^^xsd:string
411 + ] [ sp:varName "materialValue"^^xsd:string
412 + ]) ;
413 + sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
414 + sp:predicate rdf:type ;
415 + sp:subject
416 + [ sp:varName "productionReport"^^xsd:string
417 + ]
418 + ] [ sp:object
419 + [ sp:varName "productionReport"^^xsd:string
420 + ] ;
421 + sp:predicate <http://www.reportinghub.no/ep/schema/core#partOf> ;
422 + sp:subject
423 + [ sp:varName "productVolumeReport"^^xsd:string
424 + ]
425 + ] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductVolumeReport> ;
426 + sp:predicate rdf:type ;
427 + sp:subject
428 + [ sp:varName "productVolumeReport"^^xsd:string
429 + ]
430 + ] [ sp:object
431 + [ sp:varName "productionInventorysInPeriod"^^xsd:string
432 + ] ;
433 + sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
434 + sp:subject
435 + [ sp:varName "productVolumeReport"^^xsd:string
436 + ]
437 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionInventory> ;
438 + sp:predicate rdf:type ;
439 + sp:subject
440 + [ sp:varName "productionInventorysInPeriod"^^xsd:string
441 + ]
442 + ] [ sp:object
443 + [ sp:varName "productionInventoryInPeriod"^^xsd:string
444 + ] ;
445 + sp:predicate <http://www.reportinghub.no/ep/schema/core#hasSpatialPart> ;
446 + sp:subject
447 + [ sp:varName "productionInventorysInPeriod"^^xsd:string
448 + ]
449 + ] [ sp:object
450 + [ sp:varName "component"^^xsd:string
451 + ] ;
452 + sp:predicate <http://www.reportinghub.no/ep/schema/material#hasComponent> ;
453 + sp:subject
454 + [ sp:varName "productionInventoryInPeriod"^^xsd:string
455 + ]
456 + ] [ sp:object
457 + [ sp:varName "component"^^xsd:string
458 + ] ;
459 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
460 + sp:subject
461 + [ sp:varName "monthobject"^^xsd:string
462 + ]
463 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ObjectThatLastsOneMonth> ;
464 + sp:predicate rdf:type ;
465 + sp:subject
466 + [ sp:varName "monthobject"^^xsd:string
467 + ]
468 + ] [ sp:object
469 + [ sp:varName "mq"^^xsd:string
470 + ] ;
471 + sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialInInventory> ;
472 + sp:subject
473 + [ sp:varName "monthobject"^^xsd:string
474 + ]
475 + ] [ sp:object
476 + [ sp:varName "materialQuantityValue"^^xsd:string
477 + ] ;
478 + sp:predicate rdf:type ;
479 + sp:subject
480 + [ sp:varName "mq"^^xsd:string
481 + ]
482 + ] [ sp:object
483 + [ sp:varName "materialValue"^^xsd:string
484 + ] ;
485 + sp:predicate
486 + [ sp:varName "materialProperty"^^xsd:string
487 + ] ;
488 + sp:subject
489 + [ sp:varName "materialQuantityValue"^^xsd:string
490 + ]
491 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
492 + sp:predicate rdf:type ;
493 + sp:subject
494 + [ sp:varName "materialProperty"^^xsd:string
495 + ]
496 + ] [ sp:object
497 + [ sp:varName "materialPropertyName"^^xsd:string
498 + ] ;
499 + sp:predicate rdfs:label ;
500 + sp:subject
501 + [ sp:varName "materialProperty"^^xsd:string
502 + ]
503 + ] [ sp:object
504 + [ sp:varName "materialQuantity"^^xsd:string
505 + ] ;
506 + sp:predicate rdf:type ;
507 + sp:subject
508 + [ sp:varName "materialQuantityValue"^^xsd:string
509 + ]
510 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#PropertySpace> ;
511 + sp:predicate rdf:type ;
512 + sp:subject
513 + [ sp:varName "materialQuantity"^^xsd:string
514 + ]
515 + ] [ sp:object
516 + [ sp:varName "materialQuantityName"^^xsd:string
517 + ] ;
518 + sp:predicate rdfs:label ;
519 + sp:subject
520 + [ sp:varName "materialQuantity"^^xsd:string
521 + ]
522 + ] [ rdf:type sp:Optional ;
523 + sp:elements ([ sp:object
524 + [ sp:varName "piPart"^^xsd:string
525 + ] ;
526 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
527 + sp:subject
528 + [ sp:varName "monthobject"^^xsd:string
529 + ]
530 + ] [ sp:object
531 + [ sp:varName "piWholeMaterial"^^xsd:string
532 + ] ;
533 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
534 + sp:subject
535 + [ sp:varName "piPart"^^xsd:string
536 + ]
537 + ] [ sp:object
538 + [ sp:varName "wholeType"^^xsd:string
539 + ] ;
540 + sp:predicate rdf:type ;
541 + sp:subject
542 + [ sp:varName "piWholeMaterial"^^xsd:string
543 + ]
544 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
545 + sp:predicate rdf:type ;
546 + sp:subject
547 + [ sp:varName "wholeType"^^xsd:string
548 + ]
549 + ] [ sp:object
550 + [ sp:varName "wholeTypeName"^^xsd:string
551 + ] ;
552 + sp:predicate rdfs:label ;
553 + sp:subject
554 + [ sp:varName "wholeType"^^xsd:string
555 + ]
556 + ] [ sp:object
557 + [ sp:varName "piWholeMaterial"^^xsd:string
558 + ] ;
559 + sp:predicate <http://www.reportinghub.no/ep/schema/material#hasComponent> ;
560 + sp:subject
561 + [ sp:varName "piWhole"^^xsd:string
562 + ]
563 + ] [ sp:object
564 + [ sp:varName "wholeName"^^xsd:string
565 + ] ;
566 + sp:predicate <http://www.reportinghub.no/ep/schema/core#name> ;
567 + sp:subject
568 + [ sp:varName "piWhole"^^xsd:string
569 + ]
570 + ])
571 + ])
572 + ] ;
573 + rhspin:tableHeaders ("Material"^^xsd:string "Type"^^xsd:string "Quantity"^^xsd:string "Unit"^^xsd:string "Value"^^xsd:string) .
574 +
575 +mpr-tables:ProductionInventoryAll
576 + rdf:type rhspin:TableTemplate ;
577 + rdfs:label "Production inventory - All"^^xsd:string ;
578 + rdfs:subClassOf rhspin:MPRGTableTemplates ;
579 + spin:body
580 + [ rdf:type sp:Select ;
581 + sp:resultVariables ([ sp:varName "wholeName"^^xsd:string
582 + ] [ sp:varName "wholeTypeName"^^xsd:string
583 + ] [ sp:varName "materialQuantityName"^^xsd:string
584 + ] [ sp:varName "materialPropertyName"^^xsd:string
585 + ] [ sp:varName "materialValue"^^xsd:string
586 + ]) ;
587 + sp:where ([ sp:object <http://www.reportinghub.no/ep/schema/report#ProductionReport> ;
588 + sp:predicate rdf:type ;
589 + sp:subject
590 + [ sp:varName "productionReport"^^xsd:string
591 + ]
592 + ] [ sp:object
593 + [ sp:varName "productionReport"^^xsd:string
594 + ] ;
595 + sp:predicate <http://www.reportinghub.no/ep/schema/core#partOf> ;
596 + sp:subject
597 + [ sp:varName "productVolumeReport"^^xsd:string
598 + ]
599 + ] [ sp:object <http://www.reportinghub.no/ep/schema/report#ProductVolumeReport> ;
600 + sp:predicate rdf:type ;
601 + sp:subject
602 + [ sp:varName "productVolumeReport"^^xsd:string
603 + ]
604 + ] [ sp:object
605 + [ sp:varName "productionInventorysInPeriod"^^xsd:string
606 + ] ;
607 + sp:predicate <http://www.reportinghub.no/ep/schema/report#reportOn> ;
608 + sp:subject
609 + [ sp:varName "productVolumeReport"^^xsd:string
610 + ]
611 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionInventory> ;
612 + sp:predicate rdf:type ;
613 + sp:subject
614 + [ sp:varName "productionInventorysInPeriod"^^xsd:string
615 + ]
616 + ] [ sp:object
617 + [ sp:varName "productionInventoryInPeriod"^^xsd:string
618 + ] ;
619 + sp:predicate <http://www.reportinghub.no/ep/schema/core#hasSpatialPart> ;
620 + sp:subject
621 + [ sp:varName "productionInventorysInPeriod"^^xsd:string
622 + ]
623 + ] [ sp:object
624 + [ sp:varName "component"^^xsd:string
625 + ] ;
626 + sp:predicate <http://www.reportinghub.no/ep/schema/material#hasComponent> ;
627 + sp:subject
628 + [ sp:varName "productionInventoryInPeriod"^^xsd:string
629 + ]
630 + ] [ sp:object
631 + [ sp:varName "component"^^xsd:string
632 + ] ;
633 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
634 + sp:subject
635 + [ sp:varName "monthobject"^^xsd:string
636 + ]
637 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ObjectThatLastsOneMonth> ;
638 + sp:predicate rdf:type ;
639 + sp:subject
640 + [ sp:varName "monthobject"^^xsd:string
641 + ]
642 + ] [ sp:object
643 + [ sp:varName "mq"^^xsd:string
644 + ] ;
645 + sp:predicate <http://www.reportinghub.no/ep/schema/flow#materialInInventory> ;
646 + sp:subject
647 + [ sp:varName "monthobject"^^xsd:string
648 + ]
649 + ] [ sp:object
650 + [ sp:varName "materialQuantityValue"^^xsd:string
651 + ] ;
652 + sp:predicate rdf:type ;
653 + sp:subject
654 + [ sp:varName "mq"^^xsd:string
655 + ]
656 + ] [ sp:object
657 + [ sp:varName "materialValue"^^xsd:string
658 + ] ;
659 + sp:predicate
660 + [ sp:varName "materialProperty"^^xsd:string
661 + ] ;
662 + sp:subject
663 + [ sp:varName "materialQuantityValue"^^xsd:string
664 + ]
665 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#Scale> ;
666 + sp:predicate rdf:type ;
667 + sp:subject
668 + [ sp:varName "materialProperty"^^xsd:string
669 + ]
670 + ] [ sp:object
671 + [ sp:varName "materialPropertyName"^^xsd:string
672 + ] ;
673 + sp:predicate rdfs:label ;
674 + sp:subject
675 + [ sp:varName "materialProperty"^^xsd:string
676 + ]
677 + ] [ sp:object
678 + [ sp:varName "materialQuantity"^^xsd:string
679 + ] ;
680 + sp:predicate rdf:type ;
681 + sp:subject
682 + [ sp:varName "materialQuantityValue"^^xsd:string
683 + ]
684 + ] [ sp:object <http://www.reportinghub.no/ep/schema/core#PropertySpace> ;
685 + sp:predicate rdf:type ;
686 + sp:subject
687 + [ sp:varName "materialQuantity"^^xsd:string
688 + ]
689 + ] [ sp:object
690 + [ sp:varName "materialQuantityName"^^xsd:string
691 + ] ;
692 + sp:predicate rdfs:label ;
693 + sp:subject
694 + [ sp:varName "materialQuantity"^^xsd:string
695 + ]
696 + ] [ rdf:type sp:Optional ;
697 + sp:elements ([ sp:object
698 + [ sp:varName "piPart"^^xsd:string
699 + ] ;
700 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
701 + sp:subject
702 + [ sp:varName "monthobject"^^xsd:string
703 + ]
704 + ] [ sp:object
705 + [ sp:varName "piWholeMaterial"^^xsd:string
706 + ] ;
707 + sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
708 + sp:subject
709 + [ sp:varName "piPart"^^xsd:string
710 + ]
711 + ] [ sp:object
712 + [ sp:varName "wholeType"^^xsd:string
713 + ] ;
714 + sp:predicate rdf:type ;
715 + sp:subject
716 + [ sp:varName "piWholeMaterial"^^xsd:string
717 + ]
718 + ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductMaterialType> ;
719 + sp:predicate rdf:type ;
720 + sp:subject
721 + [ sp:varName "wholeType"^^xsd:string
722 + ]
723 + ] [ sp:object
724 + [ sp:varName "wholeTypeName"^^xsd:string
725 + ] ;
726 + sp:predicate rdfs:label ;
727 + sp:subject
728 + [ sp:varName "wholeType"^^xsd:string
729 + ]
730 + ] [ sp:object
731 + [ sp:varName "piWholeMaterial"^^xsd:string
732 + ] ;
733 + sp:predicate <http://www.reportinghub.no/ep/schema/material#hasComponent> ;
734 + sp:subject
735 + [ sp:varName "piWhole"^^xsd:string
736 + ]
737 + ] [ sp:object
738 + [ sp:varName "wholeName"^^xsd:string
739 + ] ;
740 + sp:predicate <http://www.reportinghub.no/ep/schema/core#name> ;
741 + sp:subject
742 + [ sp:varName "piWhole"^^xsd:string
743 + ]
744 + ])
745 + ])
746 + ] ;
747 + rhspin:tableHeaders ("Material"^^xsd:string "Material Type"^^xsd:string "Quantity"^^xsd:string "Unit"^^xsd:string "Value"^^xsd:string) .
......
...@@ -157,8 +157,9 @@ OPTIONAL { ...@@ -157,8 +157,9 @@ OPTIONAL {
157 </ui:forEach> --> 157 </ui:forEach> -->
158 158
159 159
160 - <mprgswp:Table arg:report="{= ?report }" arg:template="mpr-tables:ProductionFlows" /> 160 + <mprgswp:Table arg:report="{= ?report }" arg:template="mpr-tables:ProductionFlows" />
161 - 161 + <mprgswp:Table arg:report="{= ?report }" arg:template="mpr-tables:ProductionInventory" />
162 + <mprgswp:Table arg:report="{= ?report }" arg:template="mpr-tables:ProductionInventoryAll" />
162 163
163 </ui:group> 164 </ui:group>
164 165
...\ No newline at end of file ...\ No newline at end of file
......