Create custom datatypes for currencies
(copy of FND-361) This would supplement not replace the current currencies and codes, but would allow the use of simple triples for monetary values. At the moment we have to represent amounts as an individual consisting of value and currency. And either have to coin a URI or use a blank node. Neither very desirable. For example: <fibo-fnd-acc-b="&fibo-der-rtd-irsind;ContractLeg1-IY7VKEUR45886-NotionalAmount"/> <owl:NamedIndividual rdf:about="&fibo-der-rtd-irsind;ContractLeg1-IY7VKEUR45886-NotionalAmount"> <rdf:type rdf:resource="&fibo-fnd-acc-cur;MonetaryAmount"/> rdfs:labelcontract leg 1 IY7VKEUR45886 notional amount</rdfs:label> <fibo-fnd-acc-cur:hasAmount rdf:datatype="&xsd;decimal">1286805</fibo-fnd-acc-cur:hasAmount> <fibo-fnd-acc-cur:hasCurrency rdf:resource="&fibo-fnd-acc-4217;Euro"/> </owl:NamedIndividual> Or, more concisely using a blank node and omitting the label: fibo-fnd-acc-cur:hasNotionalAmount <rdf:type rdf:resource="&fibo-fnd-acc-cur;MonetaryAmount"/> <fibo-fnd-acc-cur:hasAmount rdf:datatype="&xsd;decimal">1286805</fibo-fnd-acc-cur:hasAmount> <fibo-fnd-acc-cur:hasCurrency rdf:resource="&fibo-fnd-acc-4217;Euro"/> </fibo-fnd-acc-cur:hasNotionalAmount> I was looking here https://patterns.dataincubator.org/book/custom-datatype.html and wondered whether we could use the custom datatype approach for currency values which would be far more concise and efficient <fibo-fnd-acc-cur:hasNotionalAmount rdf:datatype="&fibo-fnd-acc-4217;EuroAmount">1286805</fibo-fnd-acc-cur:hasNotionalAmount> So that would mean we would declare a datatype for each currency. In addition to the current individual: <owl:NamedIndividual rdf:about="&fibo-fnd-acc-4217;Euro"> <rdf:type rdf:resource="&fibo-fnd-acc-cur;Currency"/> rdfs:labelEuro</rdfs:label> skos:definitionthe currency Euro</skos:definition> fibo-fnd-acc-cur:hasMinorUnit2</fibo-fnd-acc-cur:hasMinorUnit> fibo-fnd-acc-cur:hasNumericCode978</fibo-fnd-acc-cur:hasNumericCode> <lcc-cr:isUsedBy rdf:resource="&lcc-3166-1;AlandIslands"/> <lcc-cr:isUsedBy rdf:resource="&lcc-3166-1;Andorra"/> We would add the following triple to Euro above using an annotation property to link the individual to the datatype used for expressing values in it: <dct:hasFormat rdf:resource="&fibo-fnd-acc-4217;EuroAmount"/>
and then also have: rdfs:Datatype rdf:about="&fibo-fnd-acc-4217;EuroAmount" rdfs:labelEuro amount</rdfs:label> <rdfs:subClassOf rdf:resource="&fibo-fnd-acc-cur;MoneyAmount> skos:definitiondatatype for expressing amounts in the currency Euro</skos:definition> and generically rdfs:Datatype rdf:about="&fibo-fnd-acc-cur;MoneyAmount" rdfs:labelmoney amount</rdfs:label> <rdfs:subClassOf rdf:resource="&xsd;decimal/> skos:definitiondatatype for expressing an amount of money </skos:definition>
It's largely additive so in principle would not have a huge impact except that to take full advantage we'd need to change lots of ObjectProperties to DatatypeProperties, so maybe make that last step a FIBO 2.0 thing? Or we could introduce the datatype properties with different URIs in parallel.