nesstar.rdf
Class RDFObject

java.lang.Object
  extended by java.util.Observable
      extended by nesstar.rdf.RDFObject
All Implemented Interfaces:
Comparable, RDFObj
Direct Known Subclasses:
Agreement, AgreementHome, BasicObj, Catalog, CatalogHome, Category, CategoryStatistic, CategoryStatisticHome, CodeList, CodeListHome, Concept, ConceptHome, Cube, CubeHome, Datafile, DatafileHome, Dataset, DatasetHome, Dimension, DimensionHome, Event, EventHome, Explorer, ExplorerHome, Factsheet, FactsheetHome, GeographicalUnit, GeographicalUnitHome, IPISDataset, IPISDatasetHome, Measure, MeasureHome, MethodInvocation, NSDStatEngine, NSDStatEngineHome, Operation, Project, ProjectHome, Purpose, PurposeHome, Range, RangeHome, RDFBag, RDFClass, RDFProperty, Resource, ResourceHome, Role, RoleHome, Row, RowHome, Section, SectionHome, Series, SeriesHome, Server, ServerHome, SimpleVariable, Statement, StatementHome, StatFormat, StatFormatHome, Survey, SurveyHome, Table, TableHome, Term, TermHome, Type, TypeHome, User, User, UserHome, Value, ValueDomain, ValueDomainHome, ValueHome, Variable, VariableGroup, VariableGroupHome, VariableHome, VariableHome

public abstract class RDFObject
extends Observable
implements RDFObj, Comparable

A basic implementation of RDFObj.

Most RDF object classes will extends this class rather than implementing RDFObj directly.

Created:
26 April 2002

Field Summary
static char COLSEP
           
static String IS_GETTER
           
static String IS_PART
           
static String IS_PART_OF
           
static String WRITE_OP
           
 
Constructor Summary
RDFObject()
           
 
Method Summary
 Statement AddProperty(URL property, RDFObject value, String label, String comment)
           
 Statement AddStringProperty(URL property, String value, String label, String comment)
           
 void chkFinal(Object fld)
          Returns the label (a one word name) of the Field
 void clear()
          Clear all properties of this object
 int compareTo(Object o)
          Description of the Method
static void dbg(String msg)
          Method
 boolean equals(Object obj)
          This method is called after the object has been created and before its properties have been set
static void err(Exception e)
          Method
static void err(String s)
          Method
 String get_comment()
           
 String get_creationDate()
           
 String get_label()
          Gets the label attribute of the RDFObject object
 Object get(RDFProperty property)
           
 RDFObject getAccessCondition()
          Gets the accessCondition attribute of the RDFObject object
 PropertyBinding getBinding(URL property)
          Gets the binding attribute of the RDFObject object
 Collection getBindings()
          Gets the bindings attribute of the RDFObject object
 String getBookmarkLabel()
          Gets the bookmarkLabel attribute of the RDFObject object
 String getCollectionURL(String colName)
           
 String getComment()
          Returns a human readable comment/description of the object as an HTML string (it should contain only basic HTML markers).
 String getCreationDate()
          Returns a human readable creationDate/description of the object as an HTML string (it should contain only basic HTML markers).
 RDFDB getDB()
          Gets the dB attribute of the RDFObject object
static FeatureDescriptor getDescriptor(String featureName)
           
static FeatureDescriptor getDescriptor(String featureName, Object obj)
           
 RDFClass getDomain()
          Gets the domain attribute of the RDFObject object
static Collection getGetterMethods()
           
 URL getID()
          Gets the ID attribute of the RDFObject object
 Vector getInitialisedProperties()
          Gets the initialisedProperties attribute of the RDFObject object
 String getInternalID()
          Return the internal ID for the RDFObject object.
 String getLabel()
           
static long getLastClear()
           
static Collection getPartsDescriptor()
           
static Collection getPartsDescriptor(Class cls)
           
static Collection getPartsDescriptor(Object obj)
           
 String getPath()
          Returns the path of an object in a context (for example a folder where the object was found by a search)
 Vector getProperties()
          Gets the properties attribute of the RDFObject object
 List GetProperties(URL property)
          retrieve a list of properties with the same name
 Object GetProperty(URL property)
          Returns the value of the given property as seen by the current user.
 Statement GetPropertyStatement(URL property)
           
 List GetPropertyStatements(URL property)
           
 RDFClass getRange()
          Gets the range attribute of the RDFObject object
 String getRangeType()
          Gets the rangeType attribute of the RDFObject object
 RDFRef getRef(RDFObj to)
          Gets the ref attribute of the RDFObject object
 RDFRef getRef(String to)
          Gets the ref attribute of the RDFObject object
 Server getServer()
           
 String getShortId()
           
 String getShortID()
          Deprecated. we do not encourage the use of this method in the api, instead use the local object to retrieve component id's
 StatementHome getStatementHome()
           
 String[] GetStringProperties(URL property)
          retrieve a list of properties with same name and return it as String array
 Object GetStringProperty(URL property)
          retrieve a property and return it as String
static long getTimeoutInSecs()
           
 RDFClass getType()
          Returns the class/type for this object BUG: an RDF obj can have multiple classes
 void init(RDFDB db, URL id)
          This might be called when a Constructor is called while creating an RDFObj from an RDF stream or when creating on obj directly, ex: new RDFBag(db);
 void init(RDFDB db, URL id, String type)
          Method
 void initialised()
          Method
 boolean isComplete()
           
 boolean isLocal()
           
 boolean isMeta()
           
 boolean isStale()
          check if an object is stale, either because it has explicitly been set to stale or it has timed out
 void loaded()
          Mark that the object has been reloaded
 void neededCollectionReload(Object value, String collectionName)
           
 boolean neededReload()
           
 boolean neededReload(Object value)
           
 boolean neededReload(Object value, boolean basicField)
           
 boolean neededReload(URL property, Object value)
           
 boolean needsReload(Object value, boolean basicField)
           
 void reload()
          Reload the object from the Net
 void remove()
          Method
 void set_comment(String comment)
           
 void set_complete(String complete)
           
 void set_creationDate(String creationDate)
           
 void set_label(String label)
          Sets the label attribute of the RDFObject object
 void set(RDFProperty property, Object value)
          Method
 void setComment(String comment)
           
 void setComplete(boolean complete)
           
 void setCreationDate(String creationDate)
           
 void setDB(RDFDB db)
          Sets the dB attribute of the RDFObject object
 void setHardOrSoft(RDFProperty property, Object propertyValue)
          Sets the hardOrSoft attribute of the RDFObject object
 void setID(URL id)
          Sets the iD attribute of the RDFObject object
 void setLabel(String label)
           
static void setLastClear()
           
 Statement SetProperty(URL property, RDFObject value, String label, String comment)
           
 void setServer(Server server)
           
 Statement SetStringProperty(URL property, String value, String label, String comment)
          Set the property on the target object.
static void setTimeoutInSecs(long timeoutInSecs)
          set the timeout in seconds for the proxy objects
 void setTimestamp()
          Mark the timestamp of the object at the current time
 void setType(RDFClass s)
          Sets the type attribute of the RDFObject object
 void setTypeID(URL url)
          Sets the typeID attribute of the RDFObject object
 void stale()
          Mark that the object is 'stale' and should be reloaded
 String toRDF()
           
 String toRDFWrapped()
           
 String toString()
          Method
 void update(Server server)
           
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IS_PART

public static final String IS_PART
See Also:
Constant Field Values

IS_PART_OF

public static final String IS_PART_OF
See Also:
Constant Field Values

IS_GETTER

public static final String IS_GETTER
See Also:
Constant Field Values

WRITE_OP

public static final String WRITE_OP
See Also:
Constant Field Values

COLSEP

public static final char COLSEP
See Also:
Constant Field Values
Constructor Detail

RDFObject

public RDFObject()
Method Detail

dbg

public static void dbg(String msg)
Method

Parameters:
msg -

err

public static void err(Exception e)
Method

Parameters:
e -

err

public static void err(String s)
Method

Parameters:
s -

getDescriptor

public static FeatureDescriptor getDescriptor(String featureName)
Returns:
always null

getGetterMethods

public static Collection getGetterMethods()

getDescriptor

public static FeatureDescriptor getDescriptor(String featureName,
                                              Object obj)
                                       throws Exception
Throws:
Exception

getPartsDescriptor

public static Collection getPartsDescriptor()

getPartsDescriptor

public static Collection getPartsDescriptor(Object obj)
                                     throws Exception
Throws:
Exception

getPartsDescriptor

public static Collection getPartsDescriptor(Class cls)
                                     throws Exception
Throws:
Exception

setID

public void setID(URL id)
           throws Exception
Sets the iD attribute of the RDFObject object

Specified by:
setID in interface RDFObj
Parameters:
id - The new iD value
Throws:
Exception - should throw an exception if the ID has already been set

setDB

public void setDB(RDFDB db)
Sets the dB attribute of the RDFObject object

Specified by:
setDB in interface RDFObj
Parameters:
db - The new dB value

setType

public void setType(RDFClass s)
Sets the type attribute of the RDFObject object

Specified by:
setType in interface RDFObj
Parameters:
s - The new type value

setTypeID

public void setTypeID(URL url)
Sets the typeID attribute of the RDFObject object

Parameters:
url - The new typeID value

set

public void set(RDFProperty property,
                Object value)
Method

Specified by:
set in interface RDFObj
Parameters:
property -
value -

setHardOrSoft

public void setHardOrSoft(RDFProperty property,
                          Object propertyValue)
                   throws Exception
Sets the hardOrSoft attribute of the RDFObject object

Parameters:
property - The new hardOrSoft value
propertyValue - The new hardOrSoft value
Throws:
Exception

getID

public URL getID()
Gets the ID attribute of the RDFObject object

Specified by:
getID in interface RDFObj
Returns:
The ID value

getDB

public RDFDB getDB()
Gets the dB attribute of the RDFObject object

Specified by:
getDB in interface RDFObj
Returns:
The dB value

getType

public RDFClass getType()
                 throws Exception
Description copied from interface: RDFObj
Returns the class/type for this object BUG: an RDF obj can have multiple classes

Specified by:
getType in interface RDFObj
Returns:
the object type
Throws:
Exception

getInternalID

public String getInternalID()
Return the internal ID for the RDFObject object.
This will be the part of the object URL after the last "_" or missing that the part after the last "#" or missing that after the last "/".
Also "-" are replaced by ".".

Returns:
the internal id

getShortID

public String getShortID()
Deprecated. we do not encourage the use of this method in the api, instead use the local object to retrieve component id's

Returns:
the smallest indivisible part of the object (the ID of the object without server URL and class identifier and who knows what else!) e.g.: "V8" or "2568"

getShortId

public String getShortId()
                  throws Exception
Returns:
the short ID of the object (the ID of the object without server URL and class identifier) e.g.: "com.nesstar.ddi.MergeTest_F1"
Throws:
Exception

getRef

public RDFRef getRef(RDFObj to)
              throws Exception
Gets the ref attribute of the RDFObject object

Parameters:
to -
Returns:
The ref value
Throws:
Exception

getRef

public RDFRef getRef(String to)
              throws Exception
Gets the ref attribute of the RDFObject object

Parameters:
to -
Returns:
The ref value
Throws:
Exception

getBindings

public Collection getBindings()
Gets the bindings attribute of the RDFObject object

Specified by:
getBindings in interface RDFObj
Returns:
The bindings value

getBinding

public PropertyBinding getBinding(URL property)
                           throws Exception
Gets the binding attribute of the RDFObject object

Parameters:
property -
Returns:
The binding value
Throws:
Exception

get

public Object get(RDFProperty property)
           throws Exception
Specified by:
get in interface RDFObj
Parameters:
property -
Returns:
the value of the property for this object
Throws:
Exception

getProperties

public Vector getProperties()
                     throws Exception
Gets the properties attribute of the RDFObject object

Returns:
The properties value
Throws:
Exception

getInitialisedProperties

public Vector getInitialisedProperties()
                                throws Exception
Gets the initialisedProperties attribute of the RDFObject object

Returns:
The initialisedProperties value
Throws:
Exception

set_complete

public void set_complete(String complete)

setComplete

public void setComplete(boolean complete)

isComplete

public boolean isComplete()

set_label

public void set_label(String label)
Sets the label attribute of the RDFObject object

Parameters:
label - The new label value

setLabel

public void setLabel(String label)

get_label

public String get_label()
                 throws Exception
Gets the label attribute of the RDFObject object

Returns:
The label value
Throws:
Exception

getLabel

public String getLabel()
                throws Exception
Throws:
Exception

set_comment

public void set_comment(String comment)

setComment

public void setComment(String comment)

get_comment

public String get_comment()
                   throws Exception
Throws:
Exception

getComment

public String getComment()
                  throws Exception
Returns a human readable comment/description of the object as an HTML string (it should contain only basic HTML markers).

Returns:
the comment
Throws:
Exception

set_creationDate

public void set_creationDate(String creationDate)

setCreationDate

public void setCreationDate(String creationDate)

get_creationDate

public String get_creationDate()
                        throws Exception
Throws:
Exception

getCreationDate

public String getCreationDate()
                       throws Exception
Returns a human readable creationDate/description of the object as an HTML string (it should contain only basic HTML markers).

Returns:
the creationDate
Throws:
Exception

getBookmarkLabel

public String getBookmarkLabel()
                        throws Exception
Gets the bookmarkLabel attribute of the RDFObject object

Returns:
The bookmarkLabel value
Throws:
Exception

getRange

public RDFClass getRange()
                  throws Exception
Gets the range attribute of the RDFObject object

Returns:
The range value
Throws:
Exception

getDomain

public RDFClass getDomain()
                   throws Exception
Gets the domain attribute of the RDFObject object

Returns:
The domain value
Throws:
Exception

getRangeType

public String getRangeType()
                    throws Exception
Gets the rangeType attribute of the RDFObject object

Returns:
The rangeType value
Throws:
Exception

getAccessCondition

public RDFObject getAccessCondition()
                             throws Exception
Gets the accessCondition attribute of the RDFObject object

Returns:
The accessCondition value
Throws:
Exception

isLocal

public boolean isLocal()
Returns:
true if the object has a local ID indicating that is a locally created object rather than a server side object.

isMeta

public boolean isMeta()
Returns:
true if the object is part of the definition of a class (e.g. a Method)

getPath

public String getPath()
               throws Exception
Returns the path of an object in a context (for example a folder where the object was found by a search)

Returns:
the path, e.g.: .children[1].children[1].children[3]
Throws:
Exception

init

public void init(RDFDB db,
                 URL id)
          throws Exception
This might be called when a Constructor is called while creating an RDFObj from an RDF stream or when creating on obj directly, ex: new RDFBag(db);

Parameters:
db -
id -
Throws:
Exception

init

public void init(RDFDB db,
                 URL id,
                 String type)
          throws Exception
Method

Parameters:
db -
id -
type -
Throws:
Exception

chkFinal

public void chkFinal(Object fld)
              throws Exception
Returns the label (a one word name) of the Field

Parameters:
fld -
Throws:
Exception

toString

public String toString()
Method

Overrides:
toString in class Object
Returns:

toRDF

public String toRDF()
             throws Exception
Returns:
the RDF serialisation of this object (only) without an RDF header
Throws:
Exception

toRDFWrapped

public String toRDFWrapped()
                    throws Exception
Returns:
the RDF serialisation of this object (only) with a complete RDF header
Throws:
Exception

equals

public boolean equals(Object obj)
This method is called after the object has been created and before its properties have been set

Overrides:
equals in class Object
Parameters:
obj -
Returns:

remove

public void remove()
Method


initialised

public void initialised()
Method


isStale

public boolean isStale()
check if an object is stale, either because it has explicitly been set to stale or it has timed out


setLastClear

public static void setLastClear()

getLastClear

public static long getLastClear()

setTimeoutInSecs

public static void setTimeoutInSecs(long timeoutInSecs)
set the timeout in seconds for the proxy objects

Parameters:
the - new timeout in seconds

getTimeoutInSecs

public static long getTimeoutInSecs()
Returns:
the timeout in secodnds for the proxy objects

needsReload

public boolean needsReload(Object value,
                           boolean basicField)
                    throws Exception
Parameters:
value - a value to check
basicField - if true it indicates a basic field (label/comment) that should always be returned by the server
Returns:
true if the object needs to be reloaded either because it might have been incomplete or because is stale
Throws:
Exception

neededReload

public boolean neededReload(URL property,
                            Object value)
                     throws Exception
Parameters:
property - a property to which the value belongs
value - a value to check
Returns:
true if the value is null and the object might have been incomplete and it has not been reloaded
Throws:
Exception

neededReload

public boolean neededReload(Object value)
                     throws Exception
Parameters:
value - a value to check
Returns:
true if the value is null and the object might have been incomplete and it has been reloaded
Throws:
Exception

neededCollectionReload

public void neededCollectionReload(Object value,
                                   String collectionName)
                            throws Exception
Parameters:
value - a value to check
Throws:
Exception

neededReload

public boolean neededReload(Object value,
                            boolean basicField)
                     throws Exception
Parameters:
value - a value to check
basicField - if true it indicates a basic field (label/comment) that should always be returned by the server
Returns:
true if the value is null and the object might have been incomplete and it has been reloaded
Throws:
Exception

neededReload

public boolean neededReload()
                     throws Exception
Throws:
Exception

getCollectionURL

public String getCollectionURL(String colName)
Returns:
the URL of the property of the object (assuming that the property's value is a collection)

loaded

public void loaded()
Mark that the object has been reloaded


setTimestamp

public void setTimestamp()
Mark the timestamp of the object at the current time


stale

public void stale()
Mark that the object is 'stale' and should be reloaded


reload

public void reload()
            throws Exception
Reload the object from the Net

Throws:
Exception

compareTo

public int compareTo(Object o)
              throws ClassCastException
Description of the Method

Specified by:
compareTo in interface Comparable
Parameters:
o -
Throws:
ClassCastException

clear

public void clear()
Clear all properties of this object


update

public void update(Server server)
            throws Exception
Throws:
Exception

getServer

public Server getServer()
                 throws Exception
Throws:
Exception

getStatementHome

public StatementHome getStatementHome()
                               throws Exception
Throws:
Exception

setServer

public void setServer(Server server)

SetStringProperty

public Statement SetStringProperty(URL property,
                                   String value,
                                   String label,
                                   String comment)
                            throws Exception
Set the property on the target object. If the same user had previously set the same property the previous value is overridden. Silently fails if the operation is applied to a server that doesn't support it (why?)

Parameters:
property - the unique URL of the property
value - the value of the property
Returns:
the Statement that states the property
Throws:
Exception

AddStringProperty

public Statement AddStringProperty(URL property,
                                   String value,
                                   String label,
                                   String comment)
                            throws Exception
Throws:
Exception

SetProperty

public Statement SetProperty(URL property,
                             RDFObject value,
                             String label,
                             String comment)
                      throws Exception
Throws:
Exception

AddProperty

public Statement AddProperty(URL property,
                             RDFObject value,
                             String label,
                             String comment)
                      throws Exception
Throws:
Exception

GetPropertyStatements

public List GetPropertyStatements(URL property)
                           throws Exception
Parameters:
property - the unique URL of the property
Returns:
a collection of Statements that state the property
Throws:
Exception

GetPropertyStatement

public Statement GetPropertyStatement(URL property)
                               throws Exception
Parameters:
property - the unique URL of the property
Returns:
the Statement that states the property
Throws:
Exception

GetProperty

public Object GetProperty(URL property)
                   throws Exception
Returns the value of the given property as seen by the current user. Different users might receive different values. If a user has set a property, this operation should return the value that the user has set. If the user has not set up a property this operation might still get a value back, depending on the server setup.

Parameters:
property - the unique URL of the property
Returns:
the value of the property (as an API object, an instance of a class that extends RDFObject)
Throws:
Exception
See Also:
Statement.getProperty()

GetStringProperty

public Object GetStringProperty(URL property)
                         throws Exception
retrieve a property and return it as String

Parameters:
property - the name of the property
Returns:
the property value as a String
Throws:
Exception

GetProperties

public List GetProperties(URL property)
                   throws Exception
retrieve a list of properties with the same name

Parameters:
property - the name of the property
Returns:
the property values as a List
Throws:
Exception

GetStringProperties

public String[] GetStringProperties(URL property)
                             throws Exception
retrieve a list of properties with same name and return it as String array

Parameters:
property - the name of the property
Returns:
the property values as an array of String
Throws:
Exception

Nesstar SDK

Copyright©2003 NSD - All Rights Reserved