com.mkdoc.schema
Class AbstractApplicationProfile

java.lang.Object
  |
  +--com.mkdoc.schema.AbstractApplicationProfile
Direct Known Subclasses:
DublinCoreProfile, UKeGMSProfile

public abstract class AbstractApplicationProfile
extends java.lang.Object

A base implementation of application profile methods.

Version:
0.4 2005-06-28
Author:
Philip Shaw

Field Summary
static java.lang.String DCTERMS
          The Dublin Core metadata scheme prefix.
protected  java.util.Map schemas
          A number of schemes that may be handled by a profile.
 
Constructor Summary
AbstractApplicationProfile()
           
 
Method Summary
protected  void addSchema(Schema schema)
          Add a schema to the handler.
 java.lang.String expandPredicate(java.lang.String predicate)
          Expand a schema encoded value to a URI.
protected abstract  java.lang.String expandPredicateProfile(java.lang.String predicate)
          Template method for falling back to profile-specific algorithms.
 java.lang.String expandScheme(java.lang.String scheme)
          Expand an encoding scheme to a URI.
protected abstract  java.lang.String expandSchemeProfile(java.lang.String scheme)
          Template method for falling back to profile-specific algorithms.
 SchemaProperty getPredicateProperty(java.lang.String predicate)
          Get the schema property for a given predicate.
protected  Schema getPrimarySchema(java.lang.String prefix)
          Get the primary schema indicated by a metadata prefix.
 java.util.Map getSchemaMap()
          Get a mapping of schemas with their default prefixes.
protected  boolean hasPrimarySchema(java.lang.String prefix)
          Get the primary schema signified by a metadata prefix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DCTERMS

public static final java.lang.String DCTERMS
The Dublin Core metadata scheme prefix.

Since:
Version 0.2 2005-05-27
See Also:
Constant Field Values

schemas

protected java.util.Map schemas
A number of schemes that may be handled by a profile.

Schemas are stored by their encoding prefix in lower case. For example, metadata with the Dublin Core schema prefix "DC" are matched by the key "dc".

Since:
Version 0.1 2005-05-25
Constructor Detail

AbstractApplicationProfile

public AbstractApplicationProfile()
Method Detail

expandPredicate

public final java.lang.String expandPredicate(java.lang.String predicate)
Expand a schema encoded value to a URI.

Parameters:
predicate - The encoded triple predicate to expand in the form "DC.Title" for instance.
Returns:
The expanded URI reference for the triple predicate or the original string if it is not matched.
Since:
Version 0.1 2005-05-25

expandPredicateProfile

protected abstract java.lang.String expandPredicateProfile(java.lang.String predicate)
Template method for falling back to profile-specific algorithms.

Parameters:
predicate - A predicate that has not been matched using default schema prefixes.
Returns:
A predicate URI or null if not matched.
Since:
Version 0.2 2005-05-27

hasPrimarySchema

protected final boolean hasPrimarySchema(java.lang.String prefix)
Get the primary schema signified by a metadata prefix.

Parameters:
prefix - The prefix for the metadata element.
Returns:
true if the profile includes a schema with this default prefix.
Since:
Version 0.2 2005-05-27

getPrimarySchema

protected final Schema getPrimarySchema(java.lang.String prefix)
Get the primary schema indicated by a metadata prefix.

Parameters:
prefix - The prefix for the metadata element.
Returns:
The schema whose default prefix matches this or null if not found.
Since:
Version 0.2 2005-05-27

expandScheme

public final java.lang.String expandScheme(java.lang.String scheme)
Expand an encoding scheme to a URI.

Parameters:
scheme - The encoded triple component to expand in the form "DCTERMS.W3CDTF" for instance.
Returns:
The expanded URI reference for the triple component or the original string if it is not matched.
Since:
Version 0.1 2005-05-25

expandSchemeProfile

protected abstract java.lang.String expandSchemeProfile(java.lang.String scheme)
Template method for falling back to profile-specific algorithms.

Parameters:
scheme - A scheme that has not been matched using default schema prefixes.
Returns:
A scheme URI or null if not matched.
Since:
Version 0.2 2005-05-27

addSchema

protected final void addSchema(Schema schema)
Add a schema to the handler.

Parameters:
schema - The schema instance to be added.
Since:
Version 1.0 2005-05-25

getSchemaMap

public final java.util.Map getSchemaMap()
Get a mapping of schemas with their default prefixes.

Returns:
A map in which lower case default schema prefixes are keys to the schemas themselves.
Since:
Version 0.7 2005-06-10

getPredicateProperty

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

Parameters:
predicate - The predicate name with schema prefix
Returns:
The schema property for the predicate or null if no mapping exists.
Since:
Version 0.7 2005-06-10