Interface Schema

  • All Superinterfaces:
    Map<Name,​AttributeType>
    All Known Implementing Classes:
    GCOSchema, GMDSchema, GMLSchema, GMLSchema, GMLSchema, GMXSchema, GSRSchema, GSSSchema, GTSSchema, ProfileImpl, SchemaImpl, SimpleSchema, SMIL20LANGSchema, SMIL20Schema, XLINKSchema, XSSchema

    public interface Schema
    extends Map<Name,​AttributeType>
    A collection of AttributeType.

    A schema is organized as a map of Name to AttributeType. In each name,type tuple, the name matches the name of the type.

       //create some attribute types
       AttributeType pointType =
         new AttributeTypeImpl( new NameImpl( "http://www.opengis.net/gml", "PointType" ), ... );
       AttributeType lineStringType =
         new AttributeTypeImpl( new NameImpl( "http://www.opengis.net/gml", "LineStringType" ), ... );
       AttributeType polygonType =
         new AttributeTypeImpl( new NameImpl( "http://www.opengis.net/gml", "PolygonType" ), ... );
    
       //create a schema
       Schema schema = new SchemaImpl( "http://www.opengis.net/gml" );
    
       //add types to the schema
       schema.add( pointType );
       schema.add( lineStringType );
       schema.add( polygonType );
     

    The intention of a schema is to provide a resuable set of attribute types. These types are used when building attribute instances.

    Author:
    Jody Garnett, Refractions Research, Inc., Justin Deoliveira, The Open Planning Project
    • Method Detail

      • getURI

        String getURI()
        The uri of the schema.

        This method is a convenience for keySet().getURI().

        Returns:
        The uri of the schema.
      • add

        void add​(AttributeType type)
        Adds a type to the schema.

        This method is a convenience for put(type.getName(),type).

        Parameters:
        type - The type to add.
      • profile

        Schema profile​(Set<Name> profile)
        Profiles the schema, creating a new schema in the process.

        A profile of a schema is a subset of the schema, and it also a schema itself.

        Used to select a subset of types for a specific application. Profiles often are used to express limitiations of a source of data.

        Parameters:
        profile - The set of names which corresond to entries that will make up the profile.
        Returns:
        The profile of the original schema.