all

The 'all' compositor allows all combinations of its child elements. The ordering of these elements may be significant. Child elements may be optional (with minimum occurrences of 0) as in the example below with an element 'bar', but a missing 'foo' element..

<?xml version="1.0"?>
<foobar xmlns="http://example.org/">
        <bar>foobar</bar>
</foobar>


# Base: http://example.org/all.xml
@prefix ns1:     <http://example.org/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/def/> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .

<>    ns1:foobar
              [ ns1:bar "foobar"^^xs_:string
              ] .

This example demonstrates that compositors like 'all' don't explicitly appear in the RDF model nor in the OWL ontology. In the schema below, 'foo' and 'bar' are defined locally so are not included in the (global elements and attributes) closure. They are described as datatype properties with unknown range. The types that appear in the schema are translated as 'allValuesFrom' restrictions in the context of a class definition.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://example.org/" xmlns="http://example.org/" 
        elementFormDefault="qualified">

        <xs:element name="foobar">
                <xs:complexType mixed="true">
                        <xs:all>
                                <xs:element name="foo" type="xs:string" minOccurs="0"/>
                                <xs:element name="bar" type="xs:string"/>
                        </xs:all>
                </xs:complexType>
        </xs:element>

</xs:schema>

Because 'foo' is optional, it has a maximum cardinality of 1 but an implied minimum cardinality of 0.

# Base: http://example.org/all.owl
@prefix ns1:     <http://example.org/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/def/> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix daml:    <http://www.daml.org/2001/03/daml+oil#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .

<>    a       owl:Ontology .

ns1:bar
      a       owl:DatatypeProperty , rdf:Property .

ns1:foobar
      a       owl:ObjectProperty ;
      rdfs:range
              [ a       owl:Class ;
                rdfs:subClassOf
                        [ a       owl:Restriction ;
                          owl:allValuesFrom xs_:string ;
                          owl:onProperty ns1:bar
                        ] ;
                rdfs:subClassOf
                        [ a       owl:Restriction ;
                          owl:maxCardinality "1"^^xs_:int ;
                          owl:onProperty ns1:foo
                        ] ;
                rdfs:subClassOf
                        [ a       owl:Restriction ;
                          owl:allValuesFrom xs_:string ;
                          owl:onProperty ns1:foo
                        ] ;
                rdfs:subClassOf
                        [ a       owl:Restriction ;
                          owl:cardinality "1"^^xs_:int ;
                          owl:onProperty ns1:bar
                        ]
              ] .

ns1:foo
      a       owl:DatatypeProperty , rdf:Property .

Child components


Generated on Mon Jun 18 16:02:37 2007 for Gloze by  doxygen 1.5.0