org.eclipse.higgins.idas.cp.jena2.impl
Class Context

java.lang.Object
  extended byorg.eclipse.higgins.idas.cp.jena2.impl.Context
All Implemented Interfaces:
org.eclipse.higgins.idas.api.IContext, IJenaContext
Direct Known Subclasses:
FileContext, JDBCContext

public abstract class Context
extends Object
implements IJenaContext


Constructor Summary
Context()
           
 
Method Summary
 void addRelationship(org.eclipse.higgins.idas.api.IContextRelationship relationship)
           
 org.eclipse.higgins.idas.api.IContextRelationship addRelationship(URI relationshipType)
           
 org.eclipse.higgins.idas.api.IDigitalSubject addSubject(org.eclipse.higgins.idas.api.IDigitalSubject copyFrom)
           
 org.eclipse.higgins.idas.api.IDigitalSubject addSubject(URI type, String subjectID)
           
 void applyUpdates()
           
 org.eclipse.higgins.idas.api.IAttribute buildAttribute(URI attrID)
           
 org.eclipse.higgins.idas.api.IFilterAttributeAssertion buildAttributeAssertion()
           
 org.eclipse.higgins.idas.api.IAuthNAttributesMaterials buildAuthNAttributesMaterials()
           
 org.eclipse.higgins.idas.api.IComplexAttrValue buildComplexAttrValue(URI type)
           
 org.eclipse.higgins.idas.api.IFilterCUIDAssertion buildCUIDAssertion()
           
 org.eclipse.higgins.idas.api.IFilter buildFilter()
           
 org.eclipse.higgins.idas.api.IFilterMetadataAssertion buildMetadataAssertion()
           
 org.eclipse.higgins.idas.api.IContextRelationship buildRelationship(URI type)
           
 org.eclipse.higgins.idas.api.ISimpleAttrValue buildSimpleAttrValue(URI type, Object value)
           
 org.eclipse.higgins.idas.api.IFilterTypeAssertion buildTypeAssertion()
           
 void close()
           
 String exportData(String filter, String representationFormat)
           
 org.eclipse.higgins.idas.api.model.IContextModel getContextModel()
           
 URI getContextRef()
           
 com.hp.hpl.jena.ontology.DatatypeProperty getDatatypeProperty(String uri)
           
 com.hp.hpl.jena.ontology.OntModel getModel()
          return jena ontology model of the context
 com.hp.hpl.jena.ontology.OntModel getModelNoException()
           
 String getNS()
          return namespace of context
 com.hp.hpl.jena.ontology.ObjectProperty getObjectProperty(String uri)
           
 com.hp.hpl.jena.ontology.OntClass getOntClass(String uri)
           
 com.hp.hpl.jena.ontology.OntProperty getOntProperty(String uri)
           
 Iterator getRelationships()
           
 String getSchema()
           
 String getSchemaURI()
           
 org.eclipse.higgins.idas.api.IDigitalSubject getSubject(String cuid)
           
 org.eclipse.higgins.idas.api.IDigitalSubject getSubject(String cuid, Iterator attrSelectionList)
           
 Iterator getSubjects(org.eclipse.higgins.idas.api.IFilter filter)
           
 Iterator getSubjects(org.eclipse.higgins.idas.api.IFilter filter, Iterator attrSelectionList)
           
 IUserAccount getUserAccount()
           
 void importData(String filter, String representationFormat)
           
 void init(Properties props)
           
 boolean isOpen(Object identity)
           
 String open(Object authentication)
           
 void registerChangedSubject(DigitalSubject subj)
          Register the subject which was changed and should be validated (optionally) before saving
 void removeRelationship(org.eclipse.higgins.idas.api.IContextRelationship relationship)
           
 void removeSubject(String cuid)
           
 void setSchema(String schema)
           
 void setValidationMode(boolean performValidation)
           
 void unregisterChangedSubject(DigitalSubject subj)
          When some DigitalSubject was removed it should be also removed from changed subjects list to prevent validation of non-existent subject
 boolean verifySubjectAttributes(String cuid, Iterator attributes)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.eclipse.higgins.idas.cp.jena2.IJenaContext
begin, commit, isTransactionSupported, rollback
 
Methods inherited from interface org.eclipse.higgins.idas.api.IContext
cancelUpdates, getModel
 

Constructor Detail

Context

public Context()
Method Detail

addRelationship

public void addRelationship(org.eclipse.higgins.idas.api.IContextRelationship relationship)
                     throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

addSubject

public org.eclipse.higgins.idas.api.IDigitalSubject addSubject(URI type,
                                                               String subjectID)
                                                        throws org.eclipse.higgins.idas.api.IdASException,
                                                               org.eclipse.higgins.idas.api.InvalidTypeException,
                                                               org.eclipse.higgins.idas.api.InvalidSubjectIDException,
                                                               org.eclipse.higgins.idas.api.SubjectExistsException
Specified by:
addSubject in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException
org.eclipse.higgins.idas.api.InvalidSubjectIDException
org.eclipse.higgins.idas.api.SubjectExistsException

addSubject

public org.eclipse.higgins.idas.api.IDigitalSubject addSubject(org.eclipse.higgins.idas.api.IDigitalSubject copyFrom)
                                                        throws org.eclipse.higgins.idas.api.IdASException,
                                                               org.eclipse.higgins.idas.api.SubjectExistsException
Specified by:
addSubject in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.SubjectExistsException

buildAttribute

public org.eclipse.higgins.idas.api.IAttribute buildAttribute(URI attrID)
                                                       throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildAttribute in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildAttributeAssertion

public org.eclipse.higgins.idas.api.IFilterAttributeAssertion buildAttributeAssertion()
                                                                               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildAttributeAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildAuthNAttributesMaterials

public org.eclipse.higgins.idas.api.IAuthNAttributesMaterials buildAuthNAttributesMaterials()
                                                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildAuthNAttributesMaterials in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildCUIDAssertion

public org.eclipse.higgins.idas.api.IFilterCUIDAssertion buildCUIDAssertion()
                                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildCUIDAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildComplexAttrValue

public org.eclipse.higgins.idas.api.IComplexAttrValue buildComplexAttrValue(URI type)
                                                                     throws org.eclipse.higgins.idas.api.IdASException,
                                                                            org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
buildComplexAttrValue in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

buildFilter

public org.eclipse.higgins.idas.api.IFilter buildFilter()
                                                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildFilter in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildMetadataAssertion

public org.eclipse.higgins.idas.api.IFilterMetadataAssertion buildMetadataAssertion()
                                                                             throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildMetadataAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildRelationship

public org.eclipse.higgins.idas.api.IContextRelationship buildRelationship(URI type)
                                                                    throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildRelationship in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

buildSimpleAttrValue

public org.eclipse.higgins.idas.api.ISimpleAttrValue buildSimpleAttrValue(URI type,
                                                                          Object value)
                                                                   throws org.eclipse.higgins.idas.api.IdASException,
                                                                          org.eclipse.higgins.idas.api.InvalidTypeException
Specified by:
buildSimpleAttrValue in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.InvalidTypeException

buildTypeAssertion

public org.eclipse.higgins.idas.api.IFilterTypeAssertion buildTypeAssertion()
                                                                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
buildTypeAssertion in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

close

public void close()
           throws org.eclipse.higgins.idas.api.IdASException
Specified by:
close in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

exportData

public String exportData(String filter,
                         String representationFormat)
                  throws org.eclipse.higgins.idas.api.IdASException
Specified by:
exportData in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getContextModel

public org.eclipse.higgins.idas.api.model.IContextModel getContextModel()
                                                                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getContextModel in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getContextRef

public URI getContextRef()
                  throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getContextRef in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getRelationships

public Iterator getRelationships()
                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getRelationships in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getSchema

public String getSchema()
                 throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSchema in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getSubject

public org.eclipse.higgins.idas.api.IDigitalSubject getSubject(String cuid)
                                                        throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSubject in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getSubject

public org.eclipse.higgins.idas.api.IDigitalSubject getSubject(String cuid,
                                                               Iterator attrSelectionList)
                                                        throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSubject in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getSubjects

public Iterator getSubjects(org.eclipse.higgins.idas.api.IFilter filter)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSubjects in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getSubjects

public Iterator getSubjects(org.eclipse.higgins.idas.api.IFilter filter,
                            Iterator attrSelectionList)
                     throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSubjects in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

importData

public void importData(String filter,
                       String representationFormat)
                throws org.eclipse.higgins.idas.api.IdASException
Specified by:
importData in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

isOpen

public boolean isOpen(Object identity)
               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
isOpen in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

open

public String open(Object authentication)
            throws org.eclipse.higgins.idas.api.IdASException,
                   org.eclipse.higgins.idas.api.ContextOpenException
Specified by:
open in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException
org.eclipse.higgins.idas.api.ContextOpenException

removeRelationship

public void removeRelationship(org.eclipse.higgins.idas.api.IContextRelationship relationship)
                        throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

removeSubject

public void removeSubject(String cuid)
                   throws org.eclipse.higgins.idas.api.IdASException
Throws:
org.eclipse.higgins.idas.api.IdASException

setSchema

public void setSchema(String schema)
               throws org.eclipse.higgins.idas.api.IdASException
Specified by:
setSchema in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

verifySubjectAttributes

public boolean verifySubjectAttributes(String cuid,
                                       Iterator attributes)
                                throws org.eclipse.higgins.idas.api.IdASException
Specified by:
verifySubjectAttributes in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

getModel

public com.hp.hpl.jena.ontology.OntModel getModel()
                                           throws org.eclipse.higgins.idas.api.IdASException
Description copied from interface: IJenaContext
return jena ontology model of the context

Specified by:
getModel in interface IJenaContext
Throws:
org.eclipse.higgins.idas.api.IdASException - If the context is not open or its ontology model is not initialized

getModelNoException

public com.hp.hpl.jena.ontology.OntModel getModelNoException()
Returns:

getNS

public String getNS()
Description copied from interface: IJenaContext
return namespace of context

Specified by:
getNS in interface IJenaContext

getUserAccount

public IUserAccount getUserAccount()
Returns:

getDatatypeProperty

public com.hp.hpl.jena.ontology.DatatypeProperty getDatatypeProperty(String uri)
                                                              throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getDatatypeProperty in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getObjectProperty

public com.hp.hpl.jena.ontology.ObjectProperty getObjectProperty(String uri)
                                                          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getObjectProperty in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getOntProperty

public com.hp.hpl.jena.ontology.OntProperty getOntProperty(String uri)
                                                    throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getOntProperty in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getOntClass

public com.hp.hpl.jena.ontology.OntClass getOntClass(String uri)
                                              throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getOntClass in interface IJenaContext
Parameters:
uri -
Returns:
Throws:
org.eclipse.higgins.idas.api.IdASException

getSchemaURI

public String getSchemaURI()
                    throws org.eclipse.higgins.idas.api.IdASException
Specified by:
getSchemaURI in interface IJenaContext
Returns:
schema URI that will be used as imported ontology
Throws:
org.eclipse.higgins.idas.api.IdASException

init

public void init(Properties props)
          throws org.eclipse.higgins.idas.api.IdASException
Specified by:
init in interface IJenaContext
Parameters:
props -
Throws:
org.eclipse.higgins.idas.api.IdASException

applyUpdates

public void applyUpdates()
                  throws org.eclipse.higgins.idas.api.IdASException
Specified by:
applyUpdates in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

registerChangedSubject

public void registerChangedSubject(DigitalSubject subj)
Register the subject which was changed and should be validated (optionally) before saving

Specified by:
registerChangedSubject in interface IJenaContext
Parameters:
subj -
Throws:
org.eclipse.higgins.idas.api.IdASException

unregisterChangedSubject

public void unregisterChangedSubject(DigitalSubject subj)
Description copied from interface: IJenaContext
When some DigitalSubject was removed it should be also removed from changed subjects list to prevent validation of non-existent subject

Specified by:
unregisterChangedSubject in interface IJenaContext
Parameters:
subj -

addRelationship

public org.eclipse.higgins.idas.api.IContextRelationship addRelationship(URI relationshipType)
                                                                  throws org.eclipse.higgins.idas.api.IdASException
Specified by:
addRelationship in interface org.eclipse.higgins.idas.api.IContext
Throws:
org.eclipse.higgins.idas.api.IdASException

setValidationMode

public void setValidationMode(boolean performValidation)
Specified by:
setValidationMode in interface IJenaContext
Parameters:
performValidation - if true then all changed subjects should be validated before saving of the context. Default value is true. In case of JDBC Context, if RDBMS does not support transactions, validation will not be performed