<?xml version="1.0" encoding="UTF-8"?> <union xmlns="http://example.org/">foobar</union>
This XML conforms to the schema below. The content is either an xs:int or an xs:string.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org/"> <xs:element name="union"> <xs:simpleType> <xs:union memberTypes="xs:int xs:string" /> </xs:simpleType> </xs:element> </xs:schema>
The XML content is validated against both xs:int and xs:string to determine its type. In this case it is an xs:string.
# Base: http://example.org/union.xml @prefix ns1: <http://example.org/def/> . @prefix xs: <http://www.w3.org/2001/XMLSchema> . @prefix ns2: <http://example.org/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix xs_: <http://www.w3.org/2001/XMLSchema#> . @prefix : <#> . <> ns2:union "foobar" .
There's little to say about the range of the property. A simple type may sometimes map to an object type (e.g. QNames), so a union is not necessarily a datatype property. In this case, both member types map to datatype properties so 'union' is a datatype property.
# Base: http://example.org/union.owl @prefix ns1: <http://example.org/def/> . @prefix xs: <http://www.w3.org/2001/XMLSchema> . @prefix ns2: <http://example.org/> . @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#> . ns2:union a owl:DatatypeProperty , rdf:Property . <> a owl:Ontology . (xs_:int xs_:string) .