-
Notifications
You must be signed in to change notification settings - Fork 1
PriceComponent
PriceComponents are fees included in a PricePlan, which subject to conditions Functions) may contribute to the total amount charged. Components within the same plan are summed together in order to get the total amount (price of the service). Common examples of PriceComponents that may coexist in the same PricePlan are: startup or membership charges (to access the service), periodic subscription fees (with a certain recurrence - e.g. monthly - as long as committed to by the contract), pay-per-unit charges (whose total will be proportional to the metered usage), options or feature dependent charges. The final value of the component will depend on the Variables values (determined by the evaluation of the PriceFunction) and the Price Adjustments that may apply (e.g. discounts).
There are three ways to define a Price for a PriceComponent:
- Simply by specifying the
usdl-price:hasPrice
property with a defined price. (Example 1) - Using the
usdl-price:hasTextFuntion
to express in natural language a price function to calculate the final price. (Example 2) - Using the
Spin:Function
extension to declare a price function that calculates the price based onusdl-price:PriceVariables
. (Example 3)
:PriceComponent_Premium_Support
rdf:type usdl-price:PriceComponent ;
rdfs:label "Premium Support"^^xsd:string ;
usdl-price:hasPrice
[ rdf:type gr:PriceSpecification ;
gr:hasCurrency "USD" ;
gr:hasCurrencyValue "10"^^xsd:string ;
gr:hasUnitOfMeasurement "MON"
] .
In this example we have a Price Component for the Premium Support that costs exactly 10 US Dollars a month. In this case directly defining the price is sufficient. This means that this priceComponent has a static price.
:PriceComponent_Web_Hosting
rdf:type usdl-price:PriceComponent ;
rdfs:label "Usage Discount"^^xsd:string ;
usdl-price:hasTextFuntion
"Number of hosted web-sites * price per hosted web-site"^^xsd:string .
If we want to define a dynamic price the property usdl-price:hasPrice
is not the way to do it. We need to calculate this price based on some other values. Our PriceComponent price is based on two Variables, the number of web-sites the customer wants to host and the price for each web-site hosting.
With the property usdl-price:hasTextFuntion
we can define these kind of price calculations. Note that we use natural language so virtually any kind of price calculation can be used.
:PriceComponent_Web_Hosting
rdf:type usdl-price:PriceComponent ;
rdfs:label "Usage Discount"^^xsd:string ;
usdl-price:hasTextFuntion
"Number of hosted websites * price per hosted web-site"^^xsd:string .
usdl-price:hasPriceFuntion
:Function_Web_Hosting ;
For using the Spin:Function capabilities and define PriceFunction we use the property usdl-price:hasPriceFuntion
which links a Spin:Function
to our PriceComponent. These Function should be the Spin implementation of out PriceFunction defined in the usdl-price:hasTextFuntion
property.