com.mkdoc.schema
Class DublinCoreElements

java.lang.Object
  |
  +--com.mkdoc.schema.AbstractSchema
        |
        +--com.mkdoc.schema.DublinCoreElements
All Implemented Interfaces:
Resolver, Schema

public class DublinCoreElements
extends AbstractSchema
implements Schema

The Dublin Core metadata elements schema.

Version:
1.5 2005-09-15
Author:
Philip Shaw
See Also:

Field Summary
static java.lang.String BASE
          The base URI for the Dublin Core element set.
static java.lang.String LABL_CONTRB
          The Contributor element label.
static java.lang.String LABL_COVRGE
          The Coverage element label.
static java.lang.String LABL_CREATR
          The Creator element URI suffix and name.
static java.lang.String LABL_DATE
          The Date element label.
static java.lang.String LABL_DESCRN
          The Description element label.
static java.lang.String LABL_FORMAT
          The Format element label.
static java.lang.String LABL_IDNTFR
          The Identifier element label.
static java.lang.String LABL_LNGAGE
          The Language element URI suffix.
static java.lang.String LABL_PUBSHR
          The Publisher element label.
static java.lang.String LABL_RELATN
          The relation element label.
static java.lang.String LABL_RIGHTS
          The Rights element label.
static java.lang.String LABL_SOURCE
          The Source element label.
static java.lang.String LABL_SUBJCT
          The Subject element label.
static java.lang.String LABL_TITLE
          The Title element label.
static java.lang.String LABL_TYPE
          The Type element label.
static java.lang.String NAME
          The common name of the schema.
static java.lang.String NAME_CONTRB
          The Contributor element URI suffix.
static java.lang.String NAME_COVRGE
          The Coverage element URI suffix.
static java.lang.String NAME_CREATR
          The Creator element URI suffix and name.
static java.lang.String NAME_DATE
          The Date element URI suffix.
static java.lang.String NAME_DESCRN
          The Description element URI suffix.
static java.lang.String NAME_FORMAT
          The Format element URI suffix.
static java.lang.String NAME_IDNTFR
          The Identifier element URI suffix.
static java.lang.String NAME_LNGAGE
          The Language element URI suffix.
static java.lang.String NAME_PUBSHR
          The Publisher element URI suffix.
static java.lang.String NAME_RELATN
          The relation element URI suffix.
static java.lang.String NAME_RIGHTS
          The Rights element URI suffix.
static java.lang.String NAME_SOURCE
          The Source element URI suffix.
static java.lang.String NAME_SUBJCT
          The Subject element URI suffix.
static java.lang.String NAME_TITLE
          The Title element URI suffix and name.
static java.lang.String NAME_TYPE
          The Type element URI suffix.
static java.lang.String[] PREFIXES
          The metadata prefixes recognised by this schema.
 
Constructor Summary
DublinCoreElements()
           
 
Method Summary
protected static void addPredicate(SchemaProperty predicate)
          Add a predicate to the schema mapping.
 java.lang.String expandPredicate(java.lang.String name, java.lang.String predicate)
          Expand an encoded predicate name to a URI.
protected  java.lang.String expandScheme(java.lang.String name, java.lang.String scheme)
          Expand an encoded scheme value to a URI.
 java.lang.String[] getAllPrefixes()
          Get the HTML metadata prefixes recognised by this schema.
 java.lang.String getDefaultPrefix()
          Get the default namespace prefix for the schema.
 java.lang.String getName()
          Get the common name for the schema.
 SchemaProperty getNamedPredicateProperty(java.lang.String name)
          Get the schema property for a given predicate.
 java.util.Collection getPredicates()
          Get a collection of schema property predicates for this schema.
protected  java.lang.String getPredicateUri(java.lang.String predicate)
          Get the URI mapped to the predicate.
 java.lang.String getUri()
          Get the base URI for the metadata schema.
protected static SchemaProperty newSchemaProperty(java.lang.String uri, java.lang.String label, java.lang.String name)
          Get a new schema property without encoding schemes.
protected static SchemaProperty newSchemaProperty(java.lang.String uri, java.lang.String label, java.lang.String name, boolean encoding)
          Get a new schema property with optional encoding schemes.
protected static SchemaProperty newSchemaProperty(java.lang.String uri, java.lang.String label, java.lang.String name, boolean encoding, boolean uriEncoding)
          Get a new schema property.
 boolean providesQualifiers()
          Signal whether the schema provides element qualifiers.
 boolean providesQualifiersFor(java.lang.String uri)
          Check whether the schema provides qualifiers for a specific schema.
 
Methods inherited from class com.mkdoc.schema.AbstractSchema
copyPrefixes, expandPredicate, expandScheme
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.mkdoc.schema.Resolver
expandPredicate, expandScheme
 

Field Detail

NAME

public static final java.lang.String NAME
The common name of the schema.

Since:
Version 1.3 2005-06-17
See Also:
Constant Field Values

BASE

public static final java.lang.String BASE
The base URI for the Dublin Core element set.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

PREFIXES

public static final java.lang.String[] PREFIXES
The metadata prefixes recognised by this schema.

Since:
Version 0.5 2005-03-01

NAME_TITLE

public static final java.lang.String NAME_TITLE
The Title element URI suffix and name.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_TITLE

public static final java.lang.String LABL_TITLE
The Title element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_CREATR

public static final java.lang.String NAME_CREATR
The Creator element URI suffix and name.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_CREATR

public static final java.lang.String LABL_CREATR
The Creator element URI suffix and name.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_SUBJCT

public static final java.lang.String NAME_SUBJCT
The Subject element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_SUBJCT

public static final java.lang.String LABL_SUBJCT
The Subject element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_DESCRN

public static final java.lang.String NAME_DESCRN
The Description element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_DESCRN

public static final java.lang.String LABL_DESCRN
The Description element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_PUBSHR

public static final java.lang.String NAME_PUBSHR
The Publisher element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_PUBSHR

public static final java.lang.String LABL_PUBSHR
The Publisher element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_CONTRB

public static final java.lang.String NAME_CONTRB
The Contributor element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_CONTRB

public static final java.lang.String LABL_CONTRB
The Contributor element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_DATE

public static final java.lang.String NAME_DATE
The Date element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_DATE

public static final java.lang.String LABL_DATE
The Date element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_TYPE

public static final java.lang.String NAME_TYPE
The Type element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_TYPE

public static final java.lang.String LABL_TYPE
The Type element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_FORMAT

public static final java.lang.String NAME_FORMAT
The Format element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_FORMAT

public static final java.lang.String LABL_FORMAT
The Format element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_IDNTFR

public static final java.lang.String NAME_IDNTFR
The Identifier element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_IDNTFR

public static final java.lang.String LABL_IDNTFR
The Identifier element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_SOURCE

public static final java.lang.String NAME_SOURCE
The Source element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_SOURCE

public static final java.lang.String LABL_SOURCE
The Source element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_LNGAGE

public static final java.lang.String NAME_LNGAGE
The Language element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_LNGAGE

public static final java.lang.String LABL_LNGAGE
The Language element URI suffix.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_RELATN

public static final java.lang.String NAME_RELATN
The relation element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_RELATN

public static final java.lang.String LABL_RELATN
The relation element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values

NAME_COVRGE

public static final java.lang.String NAME_COVRGE
The Coverage element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_COVRGE

public static final java.lang.String LABL_COVRGE
The Coverage element label.

Since:
Version 1.0 2005-06-16
See Also:
Constant Field Values

NAME_RIGHTS

public static final java.lang.String NAME_RIGHTS
The Rights element URI suffix.

Since:
Version 0.1 2004-12-22
See Also:
Constant Field Values

LABL_RIGHTS

public static final java.lang.String LABL_RIGHTS
The Rights element label.

Since:
Version 1.0 2005-06-15
See Also:
Constant Field Values
Constructor Detail

DublinCoreElements

public DublinCoreElements()
Method Detail

newSchemaProperty

protected static final SchemaProperty newSchemaProperty(java.lang.String uri,
                                                        java.lang.String label,
                                                        java.lang.String name)
Get a new schema property without encoding schemes.

Parameters:
uri - The resource URI.
label - The resource label.
name - The unique resource name.
Returns:
A new schema property constructed from the arguments.
Since:
Version 0.7 2005-06-15

newSchemaProperty

protected static final SchemaProperty newSchemaProperty(java.lang.String uri,
                                                        java.lang.String label,
                                                        java.lang.String name,
                                                        boolean encoding)
Get a new schema property with optional encoding schemes.

Parameters:
uri - The resource URI.
label - The resource label.
name - The unique resource name.
encoding - Whether the property has encoding schemes that may be applied to it.
Returns:
A new schema property constructed from the arguments.
Since:
Version 1.4 2005-09-14

newSchemaProperty

protected static final SchemaProperty newSchemaProperty(java.lang.String uri,
                                                        java.lang.String label,
                                                        java.lang.String name,
                                                        boolean encoding,
                                                        boolean uriEncoding)
Get a new schema property.

Parameters:
uri - The resource URI.
label - The resource label.
name - The unique resource name.
encoding - Whether the property has encoding schemes that may be applied to it.
uriEncoding - Whether the instance may have a URI encoding scheme.
Returns:
A new schema property constructed from the arguments.
Since:
Version 1.5 2005-09-15

addPredicate

protected static final void addPredicate(SchemaProperty predicate)
Add a predicate to the schema mapping.

Parameters:
predicate - The schema property to add to the mapping.
Since:
Version 1.0 2005-06-15

expandPredicate

public final java.lang.String expandPredicate(java.lang.String name,
                                              java.lang.String predicate)
Expand an encoded predicate name to a URI.

Allows recursive handling of schema prefixes.

Specified by:
expandPredicate in class AbstractSchema
Parameters:
name - The predicate name to expand. Initially, this may include a schema prefix (i.e. DC.Identifier), but may be processed recursively without its schema prefix to handle refined elements that use the dot separator scheme DC.Date.modified or eGMS.Addressee.addresseeCopy.
predicate - The original predicate to fall back to if there is no match.
Returns:
The expanded URI reference for the predicate name, or the original predicate if the name part is not matched.
Since:
Version 0.2 2004-12-23

getPredicateUri

protected final java.lang.String getPredicateUri(java.lang.String predicate)
Get the URI mapped to the predicate.

Parameters:
predicate - The predicate name without any prefix.
Returns:
The URI mapped to the predicate or null if not found.
Since:
Version 0.8 2005-05-27

getNamedPredicateProperty

public final SchemaProperty getNamedPredicateProperty(java.lang.String name)
Get the schema property for a given predicate.

Specified by:
getNamedPredicateProperty in interface Schema
Parameters:
name - The predicate name without prefix.
Returns:
The schema property for the predicate or null if no mapping exists.
Since:
Version 1.2 2005-06-16

expandScheme

protected final java.lang.String expandScheme(java.lang.String name,
                                              java.lang.String scheme)
Expand an encoded scheme value to a URI.

Passes calls to a DublinCoreTerms instance.

Specified by:
expandScheme in class AbstractSchema
Parameters:
name - The encoding scheme name to expand. Initially, this may include a schema prefix (i.e. DCTERMS.URI), but may be processed recursively without its schema prefix.
scheme - The scheme to expand.
Returns:
The expanded URI reference for the scheme, or the original string if it is not matched.
Since:
Version 0.2 2004-12-23

getUri

public final java.lang.String getUri()
Get the base URI for the metadata schema.

Specified by:
getUri in interface Schema
Returns:
The namespace URI for the metadata schema.
Since:
Version 0.2 2004-12-23

getDefaultPrefix

public final java.lang.String getDefaultPrefix()
Get the default namespace prefix for the schema.

Specified by:
getDefaultPrefix in interface Schema
Returns:
The default namepace prefix for the schema.
Since:
Version 0.5 2005-03-01

getAllPrefixes

public final java.lang.String[] getAllPrefixes()
Get the HTML metadata prefixes recognised by this schema.

Specified by:
getAllPrefixes in interface Schema
Returns:
An array of one or more schema prefixes in mixed case.
Since:
Version 0.8 2005-05-27

providesQualifiers

public final boolean providesQualifiers()
Signal whether the schema provides element qualifiers.

Specified by:
providesQualifiers in interface Schema
Returns:
true if the schema
Since:
Version 0.6 2005-03-10

providesQualifiersFor

public final boolean providesQualifiersFor(java.lang.String uri)
Check whether the schema provides qualifiers for a specific schema.

Specified by:
providesQualifiersFor in interface Schema
Parameters:
uri - The URI of another schema to check for extensions.
Returns:
true if the schema provieds qualifiers for the schema signified by the URI.
Since:
Version 0.6 2005-03-10

getPredicates

public final java.util.Collection getPredicates()
Get a collection of schema property predicates for this schema.

Specified by:
getPredicates in interface Schema
Returns:
A collection of predicate names.
Since:
Version 0.9 2005-06-10

getName

public final java.lang.String getName()
Get the common name for the schema.

Specified by:
getName in interface Schema
Returns:
The common name for the schema.
Since:
Version 1.3 2005-06-17