-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Composed product with offers #170
Comments
We discussed with @Alcoz this afternoon and we found that what I'm searching for is probably an Offer composition: the ability for one offer to be made by sub offers. I will try to implement it and provide feedback and we can discuss to include it in the ontology. |
I need to save the quantity of the sub-offer. @Alcoz suggested to use the variant feature for that. Here is an example of a catalog containing a share with sub-offers (I reused the @prefix dfc-b: <https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#>.
<>
dfc-b:lists <#share1CatalogItem>.
<#share1CatalogItem> a dfc-b:CatalogItem;
dfc-b:offeredThrough <#share1Offer>;
dfc-b:references <../../supplied-products/share1/index>.
<#share1Offer> a dfc-b:Offer;
dfc-b:offers <#share1CatalogItem>;
dfc-b:hasPrice [ a dfc-b:Price;
dfc-b:value 10.00;
dfc-b:vatRate 5.5
];
dfc-b:constitutedBy [
a dfc-b:Offer;
dfc-b:hasPrice [ a dfc-b:Price;
dfc-b:value 4.0;
dfc-b:vatRate 5.5
];
dfc-b:offers [
a dfc-b:CatalogItem;
dfc-b:references [
a dfc-b:SuppliedProduct;
dfc-b:quantity 3.0;
dfc-b:isVariantOf <../../supplied-products/tomato/index>;
];
]
], [
a dfc-b:Offer;
dfc-b:hasPrice [ a dfc-b:Price;
dfc-b:value 2.20;
dfc-b:vatRate 5.5
];
dfc-b:offers [
a dfc-b:CatalogItem;
dfc-b:references [
a dfc-b:SuppliedProduct;
dfc-b:quantity 1.25;
dfc-b:isVariantOf <../../supplied-products/carrot/index>;
];
]
]. I used blank nodes to avoid to create many variants (in the supplied-products container) which are only changing the quantity. We can also factorize using the existing offers in another catalog: @prefix dfc-b: <https://github.com/datafoodconsortium/ontology/releases/latest/download/DFC_BusinessOntology.owl#>.
<>
dfc-b:lists <#share1CatalogItem>.
<#share1CatalogItem> a dfc-b:CatalogItem;
dfc-b:offeredThrough <#share1Offer>;
dfc-b:references <../../supplied-products/share1/index>.
<#share1Offer> a dfc-b:Offer;
dfc-b:offers <#share1CatalogItem>;
dfc-b:hasPrice [ a dfc-b:Price;
dfc-b:value 10.00;
dfc-b:vatRate 5.5
];
dfc-b:constitutedBy <../catalogDefault/index#tomatoOffer>, <../catalogDefault/index#carrotOffer>.
<../catalogDefault/index#tomatoOffer> dfc-b:offers [
a dfc-b:CatalogItem;
dfc-b:references [
a dfc-b:SuppliedProduct;
dfc-b:quantity 3.0;
dfc-b:isVariantOf <../../supplied-products/tomato/index>;
];
].
<../catalogDefault/index#carrotOffer> dfc-b:offers [
a dfc-b:CatalogItem;
dfc-b:references [
a dfc-b:SuppliedProduct;
dfc-b:quantity 1.25;
dfc-b:isVariantOf <../../supplied-products/carrot/index>;
];
]. |
For my CSA app I need the ability to save a share information. A share is composed by different sub products like for instance 3kg of tomato, 1kg of carrot, 1p salad. In addition the user must be able to save an offer for each sub product. This is required to compute and show the amount of each sub product of the share:
I was trying to implement this using the transformation loop (
AsPlannedTransformation
). However the transformation loop does not save offers but only products.How could I save the offer part of each product contained in a share?
The text was updated successfully, but these errors were encountered: