e.g. for target namespace http://example.org/ and element named 'foo', the RDF property name is http://example.org/foo
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org/"> <xs:element name="foo" type="xs:string" /> </xs:schema>
The OWL mapping was produced with lang=N3. This shows the property definition for 'foo'. It is a datatype property ranging over xs:string.
# Base: http://example.org/element1.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#> . <> a owl:Ontology . ns2:foo a owl:DatatypeProperty , rdf:Property ; rdfs:range xs_:string .
Where the target namespace ends with an alphanumeric character, a fragment separator is introduced. e.g. for target namespace http://example.org and element named 'foo', the RDF property name is http://example.org#foo
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org"> <xs:element name="foo" type="xs:string" /> </xs:schema>
This OWL was produced with lang=N3
# Base: http://example.org/element2.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#> . <> a owl:Ontology . ns2:foo a owl:DatatypeProperty , rdf:Property ; rdfs:range xs_:string .
Unqualified elements are not defined in the target namespace, but the mapping to RDF requires an absolute URI. Unqualified elements occur if no target namespace is defined, or if an element is declared locally and its form is unqualified. The properties corresponding to unqualified elements will be declared in the user-defined default namespace (xmlns) of the schema. This is a command line parameter (not the xmlns defined on the document element).
e.g. for default namespace http://example.com/def/ and unqualified element named 'foo', the RDF property name is http://example.org/def/foo
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="foo" type="xs:string" /> </xs:schema>
The OWL mapping was produced with lang=N3 and xmlns=http://example.com/def/
# Base: http://example.org/element3.owl @prefix ns1: <http://example.org/def/> . @prefix xs: <http://www.w3.org/2001/XMLSchema> . @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#> . ns1:foo a owl:DatatypeProperty , rdf:Property ; rdfs:range xs_:string . <> a owl:Ontology .
In xml schema, elements have their own symbol space, distinct from other components such as attributes and types. If there are overlaps between these symbol spaces, it is advisable to introduce a symbolic prefix to keep them distinct.
e.g. the element named 'foo' and type named 'foo' in the target namespace http://example.org/ will clash. Introducing a symbolic prefix '~' (at the command line) for elements resolves the clash giving us an RDF property name http://example.org/~foo.
The OWL mapping below was generated from the first schema above, but with element=~
# Base: http://example.org/element4.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#> . <http://example.org/~foo> a owl:DatatypeProperty , rdf:Property ; rdfs:range xs_:string . <> a owl:Ontology .
The schema below defines a simple typed property 'foo' and a complex type property 'bar'.
<?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/"> <xs:element name="foo" type="xs:string" /> <xs:element name="bar"> <xs:complexType mixed="true" /> </xs:element> </xs:schema>
With a corresponding OWL mapping:
# Base: http://example.org/element5.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#> . ns1:bar a owl:ObjectProperty . ns1:foo a owl:DatatypeProperty , rdf:Property ; rdfs:range xs_:string . <> a owl:Ontology .
An element may reference or directly include a simple type declaration.