SMILA (incubation) API documentation

org.eclipse.smila.ontology.records
Class SesameRecordHelper

java.lang.Object
  extended by org.eclipse.smila.ontology.records.SesameRecordHelper

public abstract class SesameRecordHelper
extends java.lang.Object

Helper class defining constants and utility methods for the mapping of SMILA records to Sesame ontology objects.

Author:
jschumacher

Field Summary
static java.lang.String ANNOTATION_LANG
          name of annotation containing the locale of a statement.
static java.lang.String ANNOTATION_MODE
          name of the attribute annotation that describes additional modes for writing properties.
static java.lang.String ANNOVALUE_REVERSE
          value of annotation describing that a property should be written reverse.
static java.lang.String ANNOVALUENAME_CLEAR
          name of annotation value describing that a property should be cleared before adding new values.
static java.lang.String ATTRIBUTE_TYPE
          name of attribute that contains the RDF type of the resource represented by a record.
static java.lang.String ATTRIBUTE_URI
          name of attribute that contains the URI of the resource represented by a record.
static java.lang.String LOCALE_ALL
          locale value for "all locales".
static Path PATH_TYPE
          path of attribute that contains the RDF type of the resource represented by a record.
static Path PATH_URI
          path of attribute that contains the URI of the resource represented by a record.
static java.lang.String SEMTYPE_RESOURCE
          semantic type of string literals that correspond to resource property values in MDS.
static java.lang.String SESAME_SOURCE
          dummy source value for IDs of newly created records.
 
Method Summary
static Annotation addClearFlag(MObject mobject)
          add clear flag to metadata object.
static Annotation addClearFlag(MObject mobject, java.lang.String attributeName)
          add clear flag to attribute of metadata object.
static Annotation addClearFlag(MObject mobject, java.lang.String attributeName, java.lang.String language)
          add clear flag for given language to attribute of metadata object.
static Annotation addReverseFlag(MObject mobject, java.lang.String attributeName)
          add reverse flag to mode annotation of attribute.
static Attribute getAttribute(MObject mobject, java.lang.String attributeName)
          create or reuse an attribute.
static java.lang.String getLanguage(Literal literal)
          get language annotation from literal, if present.
static Annotation getModeAnnotation(Annotatable annotatable)
          access or create a new annotation to the annotatable (usually an attribute, literal or mobject) used to modify the operation of SesameRecordWriter.
static Annotation getModeAnnotation(MObject mobject, java.lang.String attributeName)
          access or create a new annotation to named attribute of mobject.
static void setLanguage(Literal literal, java.lang.String language)
          set language annotation to literal.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SESAME_SOURCE

public static final java.lang.String SESAME_SOURCE
dummy source value for IDs of newly created records.

See Also:
Constant Field Values

ATTRIBUTE_URI

public static final java.lang.String ATTRIBUTE_URI
name of attribute that contains the URI of the resource represented by a record.

See Also:
Constant Field Values

PATH_URI

public static final Path PATH_URI
path of attribute that contains the URI of the resource represented by a record.


ATTRIBUTE_TYPE

public static final java.lang.String ATTRIBUTE_TYPE
name of attribute that contains the RDF type of the resource represented by a record.

See Also:
Constant Field Values

PATH_TYPE

public static final Path PATH_TYPE
path of attribute that contains the RDF type of the resource represented by a record.


SEMTYPE_RESOURCE

public static final java.lang.String SEMTYPE_RESOURCE
semantic type of string literals that correspond to resource property values in MDS.

See Also:
Constant Field Values

ANNOTATION_LANG

public static final java.lang.String ANNOTATION_LANG
name of annotation containing the locale of a statement.

See Also:
Constant Field Values

ANNOTATION_MODE

public static final java.lang.String ANNOTATION_MODE
name of the attribute annotation that describes additional modes for writing properties.

See Also:
Constant Field Values

ANNOVALUENAME_CLEAR

public static final java.lang.String ANNOVALUENAME_CLEAR
name of annotation value describing that a property should be cleared before adding new values.

See Also:
Constant Field Values

ANNOVALUE_REVERSE

public static final java.lang.String ANNOVALUE_REVERSE
value of annotation describing that a property should be written reverse.

See Also:
Constant Field Values

LOCALE_ALL

public static final java.lang.String LOCALE_ALL
locale value for "all locales".

See Also:
Constant Field Values
Method Detail

setLanguage

public static void setLanguage(Literal literal,
                               java.lang.String language)
set language annotation to literal.

Parameters:
literal - literal
language - language string

getLanguage

public static java.lang.String getLanguage(Literal literal)
get language annotation from literal, if present.

Parameters:
literal - literal
Returns:
language of literal, or null, if not set.

getAttribute

public static Attribute getAttribute(MObject mobject,
                                     java.lang.String attributeName)
create or reuse an attribute.

Parameters:
mobject - metadata object
attributeName - name of attribute (no path)
Returns:
the attribute instance or null, if attribute name is null.

getModeAnnotation

public static Annotation getModeAnnotation(Annotatable annotatable)
access or create a new annotation to the annotatable (usually an attribute, literal or mobject) used to modify the operation of SesameRecordWriter.

Parameters:
annotatable - annotatable object
Returns:
the annotation

getModeAnnotation

public static Annotation getModeAnnotation(MObject mobject,
                                           java.lang.String attributeName)
access or create a new annotation to named attribute of mobject.

Parameters:
mobject - metadata object
attributeName - name of attribute (no path)
Returns:
the annotation or null, if attribute name was null.

addClearFlag

public static Annotation addClearFlag(MObject mobject)
add clear flag to metadata object.

Parameters:
mobject - metadata object.
Returns:
the mode annotation of the metadata object

addClearFlag

public static Annotation addClearFlag(MObject mobject,
                                      java.lang.String attributeName)
add clear flag to attribute of metadata object.

Parameters:
mobject - metadata object
attributeName - name of attribute (no path)
Returns:
the mode annotation of the attribute or null, if attribute name was null.

addClearFlag

public static Annotation addClearFlag(MObject mobject,
                                      java.lang.String attributeName,
                                      java.lang.String language)
add clear flag for given language to attribute of metadata object.

Parameters:
mobject - metadata object
attributeName - name of attribute (no path)
language - to clear
Returns:
the mode annotation of the attribute or null, if attribute name was null.

addReverseFlag

public static Annotation addReverseFlag(MObject mobject,
                                        java.lang.String attributeName)
add reverse flag to mode annotation of attribute.

Parameters:
mobject -
attributeName -
mobject - metadata object
attributeName - name of attribute (no path)
Returns:
the mode annotation of the attribute or null, if attribute name was null.

SMILA (incubation) API documentation