OSID Logo
OSID Specifications
osid package
Version 3.0.0
Release Candidate Preview
Interfaceosid.OsidObjectQuery
Implementsosid.OsidIdentifiableQuery
osid.OsidExtensibleQuery
osid.OsidBrowsableQuery
Description

The OsidObjectQuery is used to assemble search queries. An OsidObjectQuery is available from an OsidSession and defines methods to query for an OsidObject that includes setting a display name and a description. Once the desired parameters are set, the OsidQuery is given to the designated search method. The same OsidQuery returned from the session must be used in the search as the provider may utilize implementation-specific data wiithin the object.

If multiple data elements are set in this interface, the results matching all the given data (eg: AND) are returned.

Any match method inside an OsidObjectQuery may be invoked multiple times. In the case of a match method, each invocation adds an element to an OR expression. Any of these terms may also be negated through the match flag.

                     
                     
                     OsidObjectQuery { OsidQuery.matchDisplayName AND (OsidQuery.matchDescription OR OsidObjectQuery.matchDescription)}
                     
                                 
                     
                

OsidObjects allow for the definition of an additonal records and the OsidQuery parallels this mechanism. An interface type of an OsidObject record must also define the corresponding OsidQuery record which is available through query interfaces. Multiple requests of these typed interfaces may return the same underlying object and thus it is only useful to request once.

String searches are described using a string search Type that indicates the type of regular expression or wildcarding encoding. Compatibility with a strings search Type can be tested within this interface.

As with all aspects of OSIDs, nulls cannot be used. Separate tests are available for querying for unset values except for required fields.

An example to find all objects whose name starts with "Fred" or whose name starts with "Barney", but the word "dinosaur" does not appear in the description and not the color is not purple. ColorQuery is a record of the object that defines a color.

                     
                     
                     ObjectObjectQuery query;
                     
                                 
                     
                
                     
                     
                     query = session.getObjectQuery();
                     query.matchDisplayName("Fred*", wildcardStringMatchType, true);
                     query.matchDisplayName("Barney*", wildcardStringMatchType, true);
                     query.matchDescriptionMatch("dinosaur", wordStringMatchType, false);
                     
                     ColorQuery recordQuery;
                     recordQuery = query.getObjectRecord(colorRecordType);
                     recordQuery.matchColor("purple", false);
                     ObjectList list = session.getObjectsByQuery(query);
                     
                                 
                     
                
MethodmatchDisplayName
Description

Adds a display name to match. Multiple display name matches can be added to perform a boolean OR among them.

ParametersstringdisplayNamedisplay name to match
osid.type.TypestringMatchTypethe string match type
booleanmatch true for a positive match, false for a negative match
ErrorsINVALID_ARGUMENT displayName is not of stringMatchType
NULL_ARGUMENT displayName or stringMatchType is null
UNSUPPORTED supportsStringMatchType(stringMatchType) is false
CompliancemandatoryThis method must be implemented.
MethodmatchAnyDisplayName
Description

Matches any object with a display name.

Parametersbooleanmatch true to match any display name, false to match objects with no display name
CompliancemandatoryThis method must be implemented.
MethodclearDisplayNameTerms
Description

Clears all display name terms.

CompliancemandatoryThis method must be implemented.
MethodmatchDescription
Description

Adds a description name to match. Multiple description matches can be added to perform a boolean OR among them.

Parametersstringdescriptiondescription to match
osid.type.TypestringMatchTypethe string match type
booleanmatch true for a positive match, false for a negative match
ErrorsINVALID_ARGUMENT description is not of stringMatchType
NULL_ARGUMENT description or stringMatchType is null
UNSUPPORTED supportsStringMatchType(stringMatchType) is false
CompliancemandatoryThis method must be implemented.
MethodmatchAnyDescription
Description

Matches a description that has any value.

Parametersbooleanmatch true to match any description, false to match descriptions with no values
CompliancemandatoryThis method must be implemented.
MethodclearDescriptionTerms
Description

Clears all description terms.

CompliancemandatoryThis method must be implemented.
MethodmatchGenusType
Description

Sets a Type for querying objects of a given genus. A genus type matches if the specified type is the same genus as the object genus type.

Parametersosid.type.TypegenusTypethe object genus type
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT genusType is null
CompliancemandatoryThis method must be implemented.
MethodmatchAnyGenusType
Description

Matches an object that has any genus type.

Parametersbooleanmatch true to match any genus type, false to match objects with no genus type
CompliancemandatoryThis method must be implemented.
MethodclearGenusTypeTerms
Description

Clears all genus type terms.

CompliancemandatoryThis method must be implemented.
MethodmatchParentGenusType
Description

Sets a Type for querying objects of a given genus. A genus type matches if the specified type is the same genus as the object or if the specified type is an ancestor of the object genus in a type hierarchy.

Parametersosid.type.TypegenusTypethe object genus type
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT genusType is null
CompliancemandatoryThis method must be implemented.
MethodclearParentGenusTypeTerms
Description

Clears all genus type terms.

CompliancemandatoryThis method must be implemented.
MethodmatchSubjectId
Description

Matches an object with a relationship to the given subject.

Parametersosid.id.IdsubjectIda subject Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT subjectId is null
CompliancemandatoryThis method must be implemented.
MethodclearSubjectIdTerms
Description

Clears all subject Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsSubjectQuery
Description

Tests if a SubjectQuery is available.

Returnboolean true if a subject query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetSubjectQuery
Description

Gets the query for a subject. Multiple retrievals produce a nested OR term.

Returnosid.ontology.SubjectQuerythe subject query
ErrorsUNIMPLEMENTED supportsSubjectQuery() is false
ComplianceoptionalThis method must be implemented if supportsSubjectQuery() is true.
MethodmatchAnySubject
Description

Matches an object that has any relationship to a Subject.

Parametersbooleanmatch true to match any subject, false to match objects with no subjects
CompliancemandatoryThis method must be implemented.
MethodclearSubjectTerms
Description

Clears all subject terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsSubjectRelevancyQuery
Description

Tests if a RelevancyQuery is available to provide queries about the relationships to Subjects.

Returnboolean true if a relevancy entry query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetSubjectRelevancyQuery
Description

Gets the query for a subject relevancy. Multiple retrievals produce a nested OR term.

Returnosid.ontology.RelevancyQuerythe relevancy query
ErrorsUNIMPLEMENTED supportsSubjectRelevancyQuery() is false
ComplianceoptionalThis method must be implemented if supportsSubjectRelevancyQuery() is true.
MethodclearSubjectRelevancyTerms
Description

Clears all subject relevancy terms.

CompliancemandatoryThis method must be implemented.
MethodmatchStateId
Description

Matches an object mapped to the given state.

Parametersosid.id.IdstateIda state Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT stateId is null
CompliancemandatoryThis method must be implemented.
MethodclearStateIdTerms
Description

Clears all state Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsStateQuery
Description

Tests if a StateQuery is available to provide queries of processed objects.

Returnboolean true if a state query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetStateQuery
Description

Gets the query for a state. Multiple retrievals produce a nested OR term.

Returnosid.process.StateQuerythe journal entry query
ErrorsUNIMPLEMENTED supportsStateQuery() is false
ComplianceoptionalThis method must be implemented if supportsStateQuery() is true.
MethodmatchAnyState
Description

Matches an object that has any mapping to a State in the given Process.

Parametersbooleanmatch true to match any state, false to match objects with no states
CompliancemandatoryThis method must be implemented.
MethodclearStateTerms
Description

Clears all state terms.

CompliancemandatoryThis method must be implemented.
MethodmatchCommentId
Description

Matches an object that has the given comment.

Parametersosid.id.IdcommentIda comment Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT commentId is null
CompliancemandatoryThis method must be implemented.
MethodclearCommentIdTerms
Description

Clears all comment Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsCommentQuery
Description

Tests if a CommentQuery is available.

Returnboolean true if a comment query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetCommentQuery
Description

Gets the query for a comment. Multiple retrievals produce a nested OR term.

Returnosid.commenting.CommentQuerythe comment query
ErrorsUNIMPLEMENTED supportsCommentQuery() is false
ComplianceoptionalThis method must be implemented if supportsCommentQuery() is true.
MethodmatchAnyComment
Description

Matches an object that has any Comment in the given Book.

Parametersbooleanmatch true to match any comment, false to match objects with no comments
CompliancemandatoryThis method must be implemented.
MethodclearCommentTerms
Description

Clears all comment terms.

CompliancemandatoryThis method must be implemented.
MethodmatchJournalEntryId
Description

Matches an object that has the given journal entry.

Parametersosid.id.IdjournalEntryIda journal entry Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT journalEntryId is null
CompliancemandatoryThis method must be implemented.
MethodclearJournalEntryIdTerms
Description

Clears all journal entry Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsJournalEntryQuery
Description

Tests if a JournalEntry is available to provide queries of journaled OsidObjects.

Returnboolean true if a journal entry query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetJournalEntryQuery
Description

Gets the query for a journal entry. Multiple retrievals produce a nested OR term.

Returnosid.journaling.JournalEntryQuerythe journal entry query
ErrorsUNIMPLEMENTED supportsJournalEntryQuery() is false
ComplianceoptionalThis method must be implemented if supportsJournalEntryQuery() is true.
MethodmatchAnyJournalEntry
Description

Matches an object that has any JournalEntry in the given Journal.

Parametersbooleanmatch true to match any journal entry, false to match objects with no journal entries
CompliancemandatoryThis method must be implemented.
MethodclearJournalEntryTerms
Description

Clears all journal entry terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsStatisticQuery
Description

Tests if a StatisticQuery is available to provide statistical queries.

Returnboolean true if a statistic query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetStatisticQuery
Description

Gets the query for a statistic. Multiple retrievals produce a nested OR term.

Returnosid.metering.StatisticQuerythe statistic query
ErrorsUNIMPLEMENTED supportsStatisticQuery() is false
ComplianceoptionalThis method must be implemented if supportsStatisticQuery() is true.
MethodmatchAnyStatistic
Description

Matches an object that has any Statistic .

Parametersbooleanmatch true to match any statistic, false to match objects with no statistics
CompliancemandatoryThis method must be implemented.
MethodclearStatisticTerms
Description

Clears all statistic terms.

CompliancemandatoryThis method must be implemented.
MethodmatchCreditId
Description

Matches an object that has the given credit.

Parametersosid.id.IdcreditIda credit Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT creditId is null
CompliancemandatoryThis method must be implemented.
MethodclearCreditIdTerms
Description

Clears all credit Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsCreditQuery
Description

Tests if a CreditQuery is available to provide queries of related acknowledgements.

Returnboolean true if a credit query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetCreditQuery
Description

Gets the query for an ackowledgement credit. Multiple retrievals produce a nested OR term.

Returnosid.acknowledgement.CreditQuerythe credit query
ErrorsUNIMPLEMENTED supportsCreditQuery() is false
ComplianceoptionalThis method must be implemented if supportsCreditQuery() is true.
MethodmatchAnyCredit
Description

Matches an object that has any Credit.

Parametersbooleanmatch true to match any credit, false to match objects with no credits
CompliancemandatoryThis method must be implemented.
MethodclearCreditTerms
Description

Clears all credit terms.

CompliancemandatoryThis method must be implemented.
MethodmatchRelationshipId
Description

Matches an object that has the given relationship.

Parametersosid.id.IdrelationshipIda relationship Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT relationshipId is null
CompliancemandatoryThis method must be implemented.
MethodclearRelationshipIdTerms
Description

Clears all relationship Id terms.

CompliancemandatoryThis method must be implemented.
MethodsupportsRelationshipQuery
Description

Tests if a RelationshipQuery is available.

Returnboolean true if a relationship query is available, false otherwise
CompliancemandatoryThis method must be implemented.
MethodgetRelationshipQuery
Description

Gets the query for relationship. Multiple retrievals produce a nested OR term.

Returnosid.relationship.RelationshipQuerythe relationship query
ErrorsUNIMPLEMENTED supportsRelationshipQuery() is false
ComplianceoptionalThis method must be implemented if supportsRelationshipQuery() is true.
MethodmatchAnyRelationship
Description

Matches an object that has any Relationship.

Parametersbooleanmatch true to match any relationship, false to match objects with no relationships
CompliancemandatoryThis method must be implemented.
MethodclearRelationshipTerms
Description

Clears all relationship terms.

CompliancemandatoryThis method must be implemented.
MethodmatchRelationshipPeerId
Description

Matches an object that has a relationship to the given peer Id.

Parametersosid.id.IdpeerIda relationship peer Id
booleanmatch true for a positive match, false for a negative match
ErrorsNULL_ARGUMENT peerId is null
CompliancemandatoryThis method must be implemented.
MethodclearRelationshipPeerIdTerms
Description

Clears all relationship Id terms.

CompliancemandatoryThis method must be implemented.