attribute

Attributes map to RDF properties. An instance of an attribute maps to an RDF statement. A qualified attribute is defined in the target namespace of the schema. The target namespace is the namespace of the corresponding RDF property.

e.g. The following schema declares a global and therefore qualified attribute 'foo' defined in the target namespace.

<?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:attribute name="foo" />
</xs:schema>

By default, we take the closure over global attributes, assuming that all uses of the property conform to this global declaration. This means that 'foo' globally ranges over rdfs:Literal (the datatype corresponding to xs:anySimpleType). If this assumption is false, attribute closure may be disabled (closed=false), and global ranges are not asserted.

# Base: http://example.org/attribute1.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 rdfs:Literal .

Like elements, if the target namespace ends with an alpha-numeric a fragment separator '#' is introduced.

Unqualified attributes are not defined in the target namespace. Unqualified attributes occur if no target namespace is defined, or where the attribute is defined locally and its form is unqualified. The example below defines the attribute 'foo' locally within an attributeGroup; it's form is unqualified by default.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://example.org/">
        <xs:attributeGroup name="myGroup">
                <xs:attribute name="foo"/>
        </xs:attributeGroup>
</xs:schema>

All we can say about the attribute is that it is a property, for the same name may be re-used where its range is a different datatype or even an object type. Closure doesn't apply to local attributes.

The following OWL was produced with lang=N3. The unqualified attribute is defined in the user-supplied default namespace, with xmlns=http://example.org/def/ .

# Base: http://example.org/attribute2.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#> .

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

<>    a       owl:Ontology .

In xml schema, attributes have their own symbol space, distinct from other components such as elements 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 attribute named 'foo' and type named 'foo' in the target namespace http://example.org/ will clash. Introducing a symbolic prefix '@' (at the command line) for attributes 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 attribute=@

# Base: http://example.org/attribute3.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#> .

<http://example.org/@foo>
      a       owl:DatatypeProperty , rdf:Property ;
      rdfs:range rdfs:Literal .

<>    a       owl:Ontology .

Child components


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