org.xenei.jena.entities.annotations
Annotation Type Predicate


@Retention(value=RUNTIME)
public @interface Predicate

An annotation that modifies the standard info about a property. the name attribute will specify the name of the property. for example: Iterator<RDFNode> getClassType() would return a list of classs in the RDF sense. But getClass() would conflict with the java function. @Predicate( class='class' ) Iterator<RDFNode> getClassType() resolves the problem. The namespace attribute specifies that the namespace of the attribute is not the same as for the entity. The upcase boolean attribute (default false) will upcase the first character of the attribute name. This is the first character after the "get", "set" or "is" prefix. the type attribute is used when an iterator is returned. It specifies the enclosed class type. default = RDFNode.class In the getClassType() example above we would use the following: @Predicate( class='class', type=RDFNode.class ) Iterator<RDFNode> getClassType() NOTE: if type is set to URI.class the return value is interpreted as a URI string.


Optional Element Summary
 String literalType
          The name of the literal type or an empty string if not is use.
 String name
          The name of the predicate.
 String namespace
          The namespace for the predicate.
 Class<?> type
          The java object class that will be returned when the object is read from the RDF model.
 boolean upcase
          determines if the local name should have the first character upper cased.
 

name

public abstract String name
The name of the predicate. This is the local name in RDF parlance. If not specified it defaults to the name of the function with the action prefix removed. @see{ @link org.xenei.jena.entities.impl.ActionType}. The namespace may be specified as part of the name. In this case the namespace value need not be set.

Returns:
the local name of the RDF predicate.
Default:
""

namespace

public abstract String namespace
The namespace for the predicate. If not specified defaults to the namespace for the subject that this predicate is part of. The namespace may be specified with this field or as part of the name field.

Returns:
The namespace portion of the RDF predicate.
Default:
""

upcase

public abstract boolean upcase
determines if the local name should have the first character upper cased. If false (the default) the first character will be lower cased. If true, the first character will be upper cased.

Default:
false

literalType

public abstract String literalType
The name of the literal type or an empty string if not is use. If specified it is used in a call to typeMapper.getSafeTypeByName() to get the RDFDatatype used to parse and unparse literal values.

Returns:
The name of the literal type or an empty string.
Default:
""

type

public abstract Class<?> type
The java object class that will be returned when the object is read from the RDF model.

Returns:
The object class.
Default:
com.hp.hpl.jena.rdf.model.RDFNode.class


Copyright © 2012 XENEI.com. All Rights Reserved.