info.sswap.api.model
Interface SSWAPElement

All Superinterfaces:
SSWAPModel
All Known Subinterfaces:
SSWAPDatatype, SSWAPGraph, SSWAPIndividual, SSWAPList, SSWAPLiteral, SSWAPNode, SSWAPObject, SSWAPPredicate, SSWAPProperty, SSWAPProvider, SSWAPResource, SSWAPSubject, SSWAPType
All Known Implementing Classes:
DatatypeImpl, ElementImpl, EmpireGeneratedNodeImpl, GraphImpl, IndividualImpl, ListImpl, Literal, NodeImpl, NonEmpireIndividual, ObjectImpl, PredicateImpl, PropertyImpl, ProviderImpl, ResourceImpl, SubjectImpl, TranslatedSubjectImpl, TypeImpl

public interface SSWAPElement
extends SSWAPModel

Represents a basic element in a SSWAPDocument.

Author:
Blazej Bulka
See Also:
SSWAPDocument

Method Summary
 void addComment(java.lang.String comment)
          Adds and rdfs:comment to this type.
 void addLabel(java.lang.String label)
          Adds an rdfs:label statement to this type.
 java.lang.Boolean asBoolean()
          Type-safe case of this element to a boolean.
 java.lang.Double asDouble()
          Type-safe cast of this element to a double.
 SSWAPIndividual asIndividual()
          Type-safe cast of this element to a SSWAPIndividual.
 java.lang.Integer asInteger()
          Type-safe cast of this element to an integer.
 SSWAPList asList()
          Type-safe cast of this element to a list.
 SSWAPLiteral asLiteral()
          Type-safe cast of this element to SSWAPLiteral.
 java.lang.String asString()
          Type-safe cast of this element to a String.
 java.lang.String getComment()
          Returns that rdfs:comment value of this type or null if no comment exists.
 java.lang.String getLabel()
          Returns that rdfs:label value of this type or null if no label exists.
 boolean isIndividual()
          Checks whether this element is a SSWAPIndividual.
 boolean isList()
          Checks whether this element is a list of SSWAPElements.
 boolean isLiteral()
          Checks whether this element is a literal.
 
Methods inherited from interface info.sswap.api.model.SSWAPModel
addImport, checkProfile, dereference, dereference, doClosure, getDocument, getImports, getInputStream, getNsPrefixMap, getReasoningService, getTypeSignature, getURI, isDereferenced, removeImport, removeNsPrefix, serialize, serialize, setNsPrefix, validate
 

Method Detail

isLiteral

boolean isLiteral()
Checks whether this element is a literal.

Returns:
true if the element is a literal

isIndividual

boolean isIndividual()
Checks whether this element is a SSWAPIndividual.

Returns:
true if the element is a SSWAPIndividual.

isList

boolean isList()
Checks whether this element is a list of SSWAPElements.

Returns:
true if the element is a list

asString

java.lang.String asString()
Type-safe cast of this element to a String. This is only possible for elements that are literals.

Returns:
a string, if the element is a literal, or null otherwise.

asInteger

java.lang.Integer asInteger()
Type-safe cast of this element to an integer. This is only possible for elements that are literals, and they contain a valid integer data.

Returns:
an integer, if the element is a literal containing a legal integer, or null otherwise.

asDouble

java.lang.Double asDouble()
Type-safe cast of this element to a double. This is only possible for elements that are literals, and they contain a valid numerical data.

Returns:
a double, if the element is a literal containing a legal double, or null otherwise.

asBoolean

java.lang.Boolean asBoolean()
Type-safe case of this element to a boolean. This is only possible for elements that are literals and they represent a valid boolean value. The only valid boolean values are "true" and "false" (case insensitive).

Returns:
a boolean, if the element is a literal containing a valid boolean value (as defined above), or null otherwise.

asIndividual

SSWAPIndividual asIndividual()
Type-safe cast of this element to a SSWAPIndividual. This is only possible for elements that are SSWAPIndividuals.

Returns:
a SSWAPIndividual, if the element is actually a SSWAPIndividual, or null otherwise.

asLiteral

SSWAPLiteral asLiteral()
Type-safe cast of this element to SSWAPLiteral. This is only possible for elements that are SSWAPLiterals.

Returns:
a SSWAPLiteral, if the element is actually a SSWAPLiteral, or null otherwise

asList

SSWAPList asList()
Type-safe cast of this element to a list. This is only possible for elements that are lists.

Returns:
a SSWAPList, if the element is actually a list, or null otherwise.

addLabel

void addLabel(java.lang.String label)
Adds an rdfs:label statement to this type.

Parameters:
label - the label to be added

addComment

void addComment(java.lang.String comment)
Adds and rdfs:comment to this type.

Parameters:
comment - the comment to be added to this type

getLabel

java.lang.String getLabel()
Returns that rdfs:label value of this type or null if no label exists. If multiple labels exist for the type any one of them is returned. For literal labels, only the lexical form is returned not the type nor the language identifier.

Returns:
label of this type or null if no label exists

getComment

java.lang.String getComment()
Returns that rdfs:comment value of this type or null if no comment exists. If multiple comments exist for the type any one of them is returned. For literal comments, only the lexical form is returned not the type nor the language identifier.

Returns:
comment of this type or null if no comment exists


Copyright (c) 2011, iPlant Collaborative, University of Arizona, Cold Spring Harbor Laboratories, University of Texas at Austin.