<?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:simpleType name="mySimpleType"> <xs:restriction base="xs:string" /> </xs:simpleType> <xs:element name="foo" type="mySimpleType" /> </xs:schema>
# Base: http://example.org/simpleType1.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:foo a owl:DatatypeProperty , rdf:Property ; rdfs:range ns1:mySimpleType . ns1:mySimpleType a owl:Class ; rdfs:subClassOf xs_:string .
Gloze avoids using simple types in typed literals by instead using the datatype it is derived from. In the XML instance and below the lifted value 'bar' has type xs:string rather than the user-defined simple type 'mySimpleType'.
<?xml version="1.0" encoding="UTF-8"?> <foo xmlns="http://example.org/">bar</foo>
# Base: http://example.org/simpleType1.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:foo "bar"^^xs_:string .