[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [ubl-dev] UBL Extensions
Hi Miguel The problem gets interesting (in terms of XML Schema usage) when you try to extend both Delivery (say to add EarliestDeliveryDate) and Despatch (say to add EarliestDespatchDate) because Delivery itself contains the Despatch type. You could make things easier if you just extend Delivery with both the EarliestDeliveryDate and the EarliestDespatchDate but that is a little like giving in. If you did it this way you'd do something like create a new ExtendedDeliveryType which aggregated the dates and DeliveryType. You might instead try XML Schema derivation such as a substitution group. I'm not sure whether the anticipated Customization Guidelines will cover this need in terms of XML Schema usage. This means trying to do the above extension of DeliveryType with just the one date and trying to extend DespatchType with the other date (qualifying the names of both Delivery and Despatch of course) but doing so in such a way that you could substitute Despatch in ExtendedDeliveryType with ExtendedDespatch while ensuring ExtendedDeliveryType is still valid in a resulting schema set. In either method you would create an ExtendedOrder document, say and in it replace Delivery with ExtendedDelivery. If you get it right with substitution groups you might have the unextended Order documents still be valid according to your new schema. Question is, is it still a UBL 2.0 Order? Not exactly if the instance uses the added dates. It's not conformant UBL but it may be compliant with UBL if you get the customization mechanism right (and it complies with the forthcoming Customization Guidelines). If your needs are for full UBL conformance (validity of extended orders with out-of- box UBL 2.0 Order schema) then you'd either have to make do with the existing dates (such as using ItemInstance to get the expiry date for food and making do with LatestDeliveryDate, etc in Delivery and Despatch types) or maybe add further ones in an extension schema which you use in the extension point of the order (ext:UBLExtensions). Another way is to group the extra dates into a new combined type which you add to the end of the Order document and call it ExtendedOrder. The trouble is, it seems to me, this doesn't give you much or any advantage over simply using the UBLExtension with the same new type in an extension schema - the UBLExtension will at least not break UBL conformance, plus in both cases you still need to create and distribute a new schema. All this deliberation persuaded me to abandon changing UBL schemas for this use case and create an Extension schema as you requested. See example attached. -- Stephen D. Green Partner SystML, http://www.systml.co.uk Tel: +44 (0) 117 9541606 http://www.biblegateway.com/passage/?search=matthew+22:37 .. and voice Quoting Miguel Pérez E <mape1082@hotmail.com>: > Hi All, > > > We are currently evaluating UBL to possibly adopt it into our next > generation of business tools. We are facing a problem consisting > mainly of the following: > > The standard does not cover all the possible data fields/structures > we need to deal with. We basically need to map from EDI X.12 > messages to UBL and viceversa. The EDI is, as you know, really wide > and is many times customized to the own purposes of who transmits. > > Example: > A shipment may have many different associated dates: Ship Date, > Deliver Date, Do not Deliver After, Do not ship after, Do not ship > before, Do not deliver before, Expiration date for foods etc.. We > found at least 20 different DateTime qualifiers that may have us map > the DTM valua to a corresponding field in the UBL schema. It > happens that the UBL does not contemplate all of those fields. In > this case we would be forced to extend the standard to our own > purposes. > > So, my questions are at this point: > > 1. Can you provide an example of how to extend a UBL Purchase Order > with a date of expiration for an item that is food? > > 2. Is there a guide to map common EDI documents to their > corresponding UBL documents? > > 3. Can you provide an small example of code list extension? > > > Thanks a lot for your help, > > > Miguel > _________________________________________________________________ > Create a handy button so your friends can add U to their buddy list. > Try it now! > http://g.msn.ca/ca55/211
<?xml version="1.0" encoding="UTF-8"?> <!-- Document Type: SampleCustomOrderExtensionType Edited On: Fri Mar 14 18:27 2008 --> <!-- ===== xsd:schema Element With Namespaces Declarations ===== --> <!-- ===== Copyright Notice ===== --> <!-- Portions Copyright (C) OASIS Open 2001-2006. All Rights Reserved. --> <!-- Copyright (C) SystML 2008. All Rights Reserved. --> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://purl.oclc.org/NET/systml#sample1:ubl:schema:xsd:CustomOrderExtensionOne-2" xmlns:udt="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" xmlns:ccts="urn:un:unece:uncefact:documentation:2" xmlns:qdt="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" targetNamespace="http://purl.oclc.org/NET/systml#sample1:ubl:schema:xsd:CustomOrderExtensionOne-2" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.0"> <!-- ===== Imports ===== --> <xsd:import namespace="urn:un:unece:uncefact:data:specification:UnqualifiedDataTypesSchemaModule:2" schemaLocation="http://docs.oasis-open.org/ubl/os-UBL-2.0/xsd/common/UnqualifiedDataTypeSchemaModule-2.0.xsd"/> <xsd:import namespace="urn:oasis:names:specification:ubl:schema:xsd:QualifiedDatatypes-2" schemaLocation="http://docs.oasis-open.org/ubl/os-UBL-2.0/xsd/common/UBL-QualifiedDatatypes-2.0.xsd"/> <!-- ===== Element Declarations ===== --> <xsd:element name="CustomOrderExtension" type="CustomOrderExtensionType"/> <xsd:element name="EarliestDespatchDate" type="EarliestDespatchDateType"/> <xsd:element name="EarliestDespatchTime" type="EarliestDespatchTimeType"/> <xsd:element name="EarliestDeliveryDate" type="EarliestDeliveryDateType"/> <xsd:element name="EarliestDeliveryTime" type="EarliestDeliveryTimeType"/> <!-- ===== Type Definitions ===== --> <xsd:complexType name="CustomOrderExtensionType"> <xsd:annotation> <xsd:documentation> <ccts:Component> <ccts:ComponentType>ABIE</ccts:ComponentType> <ccts:DictionaryEntryName>Custom Order Extension. Details</ccts:DictionaryEntryName> <ccts:Definition>Information which extends the Order document.</ccts:Definition> <ccts:ObjectClass>Despatch</ccts:ObjectClass> </ccts:Component> </xsd:documentation> </xsd:annotation> <xsd:sequence> <xsd:element ref="EarliestDeliveryDate" minOccurs="0"> <xsd:annotation> <xsd:documentation> <ccts:Component> <ccts:ComponentType>BBIE</ccts:ComponentType> <ccts:DictionaryEntryName>Custom Order Extension. Earliest_ Delivery Date. Date</ccts:DictionaryEntryName> <ccts:Definition>The earliest delivery date allowed by the buyer.</ccts:Definition> <ccts:Cardinality>0..1</ccts:Cardinality> <ccts:ObjectClass>Custom Order Extension</ccts:ObjectClass> <ccts:PropertyTermQualifier>Earliest</ccts:PropertyTermQualifier> <ccts:PropertyTerm>Delivery Date</ccts:PropertyTerm> <ccts:RepresentationTerm>Date</ccts:RepresentationTerm> <ccts:DataType>Date. Type</ccts:DataType> </ccts:Component> </xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element ref="EarliestDeliveryTime" minOccurs="0"> <xsd:annotation> <xsd:documentation> <ccts:Component> <ccts:ComponentType>BBIE</ccts:ComponentType> <ccts:DictionaryEntryName>Custom Order Extension. Earliest_ Delivery Time. Time</ccts:DictionaryEntryName> <ccts:Definition>The earliest delivery time allowed by the buyer.</ccts:Definition> <ccts:Cardinality>0..1</ccts:Cardinality> <ccts:ObjectClass>Custom Order Extension</ccts:ObjectClass> <ccts:PropertyTermQualifier>Earliest</ccts:PropertyTermQualifier> <ccts:PropertyTerm>Delivery Time</ccts:PropertyTerm> <ccts:RepresentationTerm>Time</ccts:RepresentationTerm> <ccts:DataType>Time. Type</ccts:DataType> </ccts:Component> </xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element ref="EarliestDespatchDate" minOccurs="0"> <xsd:annotation> <xsd:documentation> <ccts:Component> <ccts:ComponentType>BBIE</ccts:ComponentType> <ccts:DictionaryEntryName>Custom Order Extension. Earliest_ Despatch Date. Date</ccts:DictionaryEntryName> <ccts:Definition>The earliest despatch date allowed by the buyer.</ccts:Definition> <ccts:Cardinality>0..1</ccts:Cardinality> <ccts:ObjectClass>Custom Order Extension</ccts:ObjectClass> <ccts:PropertyTermQualifier>Earliest</ccts:PropertyTermQualifier> <ccts:PropertyTerm>Despatch Date</ccts:PropertyTerm> <ccts:RepresentationTerm>Date</ccts:RepresentationTerm> <ccts:DataType>Date. Type</ccts:DataType> </ccts:Component> </xsd:documentation> </xsd:annotation> </xsd:element> <xsd:element ref="EarliestDespatchTime" minOccurs="0"> <xsd:annotation> <xsd:documentation> <ccts:Component> <ccts:ComponentType>BBIE</ccts:ComponentType> <ccts:DictionaryEntryName>Custom Order Extension. Earliest_ Despatch Time. Time</ccts:DictionaryEntryName> <ccts:Definition>The latest despatch time allowed by the buyer.</ccts:Definition> <ccts:Cardinality>0..1</ccts:Cardinality> <ccts:ObjectClass>Custom Order Extension</ccts:ObjectClass> <ccts:PropertyTermQualifier>Earliest</ccts:PropertyTermQualifier> <ccts:PropertyTerm>Despatch Time</ccts:PropertyTerm> <ccts:RepresentationTerm>Time</ccts:RepresentationTerm> <ccts:DataType>Time. Type</ccts:DataType> </ccts:Component> </xsd:documentation> </xsd:annotation> </xsd:element> </xsd:sequence> </xsd:complexType> <!-- ===== Basic Business Information Entity Type Definitions ===== --> <xsd:complexType name="EarliestDespatchDateType"> <xsd:simpleContent> <xsd:extension base="udt:DateType"/> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="EarliestDespatchTimeType"> <xsd:simpleContent> <xsd:extension base="udt:TimeType"/> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="EarliestDeliveryDateType"> <xsd:simpleContent> <xsd:extension base="udt:DateType"/> </xsd:simpleContent> </xsd:complexType> <xsd:complexType name="EarliestDeliveryTimeType"> <xsd:simpleContent> <xsd:extension base="udt:TimeType"/> </xsd:simpleContent> </xsd:complexType> </xsd:schema>
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]