:DirectObservation[?ID] ,
[?ID, :objectDirectlyDefinedBy, ?PRCCode] ,
# TODO Generalise the region (not just the UK)
[?ID, :hasRegion, gnd:2635167] ,
[?ID, :hasTimePeriod, ?TimePeriod] ,
[?ID, :hasRole, :SoldProduction] ,
[?ID, :partOfDataset, ?Dataset] ,
[?ID, :bound, :ExactBound] ,
ufu:NG(?ID, ufu:unit, ?UnitID)
        :- ufrd:PRODCOM_DATA(?IDstring, ?PRCCODEstring, ?PRODQNT, ?QNTUNIT),

        [ufu:CurrentImport, :hasTimePeriod, ?TimePeriod],
        [ufu:CurrentImport, :partOfDataset, ?Dataset],
        [ufu:CurrentImport, :useDataPrefix, ?DataPrefix],  # STR(ufpcd2016:)
        [ufu:CurrentImport, :useObjectPrefix, ?ObjectPrefix],  # STR(ufpc2016:)

        # TODO Fix the prefix with the year
        BIND(IRI(CONCAT(STR(?DataPrefix), "Observation-", SHA256(?IDstring))) AS ?ID) ,
        BIND(IRI(CONCAT(STR(?ObjectPrefix), "Object-", SHA256(?PRCCODEstring))) AS ?PRCCode) ,
        BIND(IRI(CONCAT(STR(:), "Unit-", SHA256(?QNTUNIT))) AS ?UnitID) .

# if ?PRODQNT is not "absent"
ufu:NG(?ID, ufu:measurementUnit, ?PRODQNT)
        :- ufrd:PRODCOM_DATA(?IDstring, ?PRCCODEstring, ?PRODQNT, ?QNTUNIT), FILTER(BOUND(?PRODQNT)),
        [ufu:CurrentImport, :useDataPrefix, ?DataPrefix],  # STR(ufpcd2016:)
        BIND(IRI(CONCAT(STR(?DataPrefix), "Observation-", SHA256(?IDstring))) AS ?ID).


