Pim, given this discussion it seems to me that Semantic XML may be more appropriate in this case. No schema file is needed. Just open the .xml file with TopBraid (Semantic XML documents). This will create class definitions for each element, each instance of the element is an instance of the class, attributes are mapped to datatypes, etc. This will also catch the value 2.2 as a child element (composite:child / sxml:TextNode) of the Azimuth element.
See Help > Import and Export > Creating, Importing, Querying, Saving XML documents with Semantic XML for more. >From there, you can query the structure or create transformations using SPARQLMotion scripts to encode the transformation semantics you need. The disadvantage is that semantic definitions of the xsd are not provided, but it is unclear whether this is necessary for your purposes. Some answers to the questions posed: <but the value 2.2 I would expect somewhere in this instance is gone.> Indeed, this was not converted to the rdf file. See Help > Import and Export > Import external information > Import XML, particularly the last paragraph. <Why is this AzimuthDataType class created?> This is representing the type restriction in the xsd as a subclass of xsd:double. <The restrictions on the Azimuth element I can't find either.> OWL 2 datatype restrictions have not yet been implemented for Import XML. <subelements named "Process" of type ProcessType will be shown as instances of class Process and not of class ProcessType what I would expect.> This is per the xsd definition. ProcessType is an xsd type, but the name of the element is Process. I.e. ProcessType is used by xsd to specify the contents of a valid Process tag. Semantic XML specifies this relationship directly with a Process class. -- Scott On Jan 5, 8:02 am, "Helm, P.W. (Pim) van den" <[email protected]> wrote: > Hi Scott, > > I created a smaller example based on your example. The xsd now contains > an extra element/propery. > > <?xml version="1.0" encoding="UTF-8"?> > <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" > elementFormDefault="qualified"> > <xsd:element name="Process"> > <xsd:complexType> > <xsd:choice minOccurs="0" maxOccurs="unbounded"> > <xsd:element name="Process" type="ProcessType" /> > <xsd:element name="Activity" type="ActivityType" /> > <xsd:element ref="Azimuth" /> > </xsd:choice> > <xsd:attribute name="name" type="xsd:string"/> > </xsd:complexType> > </xsd:element> > > <xsd:complexType name="ProcessType"> > <xsd:sequence minOccurs="0" maxOccurs="unbounded"> > <xsd:element name="Activity" type="ActivityType"/> > </xsd:sequence> > <xsd:attribute name="name" type="xsd:string"/> > </xsd:complexType> > > <xsd:complexType name="ActivityType"> > <xsd:attribute name="name" type="xsd:string"/> > <xsd:attribute name="efficiency" type="xsd:string"/> > </xsd:complexType> > > <xsd:element name="Azimuth"> > <xsd:simpleType> > <xsd:restriction base="xsd:double"> > <xsd:minInclusive value="0" /> > <xsd:maxInclusive value="360" /> > </xsd:restriction> > </xsd:simpleType> > </xsd:element> > </xsd:schema> > > The xml file also contains this element and fills it with a value, > leading to the following xml implementation: > <?xml version="1.0" encoding="UTF-8"?> > <Process name="Pizza Order" timeNeeded="2"> > <Azimuth>2.2</Azimuth> > <Process name="Select Pizza Service"> > <Activity name="Browse Yellow Pages" efficiency="5" /> > <Activity name="Search Google" efficiency="10" /> > </Process> > <Process name="Order"> > <Activity name="Dial phone number" /> > <Activity name="Select pizzas" /> > <Activity name="Provide address" /> > </Process> > <Activity name="Wait for Delivery" /> > <Process name="Receipt and Payment"> > <Activity name="Pay delivery"/> > <Activity name="Pay tip"/> > </Process> > </Process> > > The result in topbraid contains an owl "schema" shows the Azimuth as a > class. Also an instance of Azimuth is created in the RDF-file, but the > value 2.2 I would expect somewhere in this instance is gone. Further > more the class Azimuth is a subbclass with a restriction "rdf:value only > AzimuthDataType". And this AzimuthDataType is a subClassOf xsd:double. > Why is this AzimuthDataType class created? > The restrictions on the Azimuth element I can't find either. > > Can you explain why I miss things? > > Another thing I like to point out is the behavior even visible in your > original example is that the subelements named "Process" of type > ProcessType will be shown as instances of class Process and not of class > ProcessType what I would expect. > > Kind regards, > Pim
-- You received this message because you are subscribed to the Google Groups "TopBraid Composer Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/topbraid-composer-users?hl=en.
