TRANSFORM_mpr-productVolume-v1.0.ttl 18.9 KB
# baseURI: http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-productVolume-v1.0
# imports: http://spinrdf.org/spin
# imports: http://www.epim.no/schemas/mprml/1
# imports: http://www.reportinghub.no/ep/dpr/spin/1.1/lib
# imports: http://www.reportinghub.no/ep/mpr/spin/1.1/lib

@prefix :        <http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-productVolume-v1.0#> .
@prefix arg:     <http://spinrdf.org/arg#> .
@prefix ep-dpr-spin-lib:  <http://www.reportinghub.no/ep/dpr/spin/1.1/lib#> .
@prefix ep-mpr-spin-lib:  <http://www.reportinghub.no/ep/mpr/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 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.epim.no/schemas/mprml/1#A_Global-Objects>
      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 _:b1
                          ] [ sp:object <http://www.reportinghub.no/ep/schema/flow#ProductionFlowToDate> ;
                            sp:predicate rdf:type ;
                            sp:subject _:b1
                          ] [ sp:object _:b1 ;
                            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 _:b1
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#objectRef> ;
                            sp:subject spin:_this
                          ] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_productVolume> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#derivedFrom> ;
                            sp:subject
                                    [ sp:varName "reportingPeriodProductionFlows"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFlowsToDate"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.reportinghub.no/ep/schema/core#temporalPartOf> ;
                            sp:subject
                                    [ sp:varName "reportingPeriodProductionFlows"^^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.epim.no/schemas/mprml/1#facilityRef> ;
                            sp:subject
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "facilityNameRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#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.epim.no/schemas/mprml/1#flowRef> ;
                            sp:subject
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowName"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#name> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowKind"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
                            sp:subject
                                    [ sp:varName "flowRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "flowDirection"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#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.epim.no/schemas/mprml/1#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-mpr-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-mpr-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-mpr-spin-lib:selectProductionFlowDirectionRelationshipType ;
                                      sp:arg1 [ sp:varName "flowDirection"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFlowDirectionRelationshipType"^^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
                                    [ sp:varName "productionFacility"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "productionFacilityType"^^xsd:string
                                    ] ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productionFacility"^^xsd:string
                                    ]
                          ]) ;
                sp:where ([ sp:object
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#objectRef> ;
                            sp:subject spin:_this
                          ] [ sp:object <http://www.epim.no/schemas/mprml/1#Obj_productVolume> ;
                            sp:predicate rdf:type ;
                            sp:subject
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "facilityRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#facilityRef> ;
                            sp:subject
                                    [ sp:varName "productVolumeRef"^^xsd:string
                                    ]
                          ] [ sp:object
                                    [ sp:varName "facilityNameRef"^^xsd:string
                                    ] ;
                            sp:predicate <http://www.epim.no/schemas/mprml/1#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
                                    ]
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "facilityNamingSystem"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.epim.no/schemas/mprml/1#namingSystem> ;
                                        sp:subject
                                                [ sp:varName "facilityNameRef"^^xsd:string
                                                ]
                                      ])
                          ] [ rdf:type sp:Optional ;
                            sp:elements ([ sp:object
                                                [ sp:varName "facilityKind"^^xsd:string
                                                ] ;
                                        sp:predicate <http://www.epim.no/schemas/mprml/1#kindRef> ;
                                        sp:subject
                                                [ sp:varName "facilityNameRef"^^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-mpr-spin-lib:selectProductionFacilityType ;
                                      sp:arg1 [ sp:varName "facilityKind"^^xsd:string
                                              ]
                                    ] ;
                            sp:variable
                                    [ sp:varName "productionFacilityType"^^xsd:string
                                    ]
                          ])
              ] .

<http://www.reportinghub.no/ep/transform/TRANSFORM_mpr-productVolume-v1.0>
      rdf:type owl:Ontology ;
      owl:imports <http://www.epim.no/schemas/mprml/1> , <http://spinrdf.org/spin> , <http://www.reportinghub.no/ep/dpr/spin/1.1/lib> , <http://www.reportinghub.no/ep/mpr/spin/1.1/lib> ;
      owl:versionInfo "Created with TopBraid Composer"^^xsd:string .