Queries¶
Comment Query¶
-
class
dlkit.commenting.queries.
CommentQuery
¶ Bases:
dlkit.osid.queries.OsidRelationshipQuery
This is the query for searching comments.
Each method specifies an
AND
term while multiple invocations of the same method produce a nestedOR
.-
match_reference_id
(source_id, match)¶ Sets reference
Id
.Parameters: - source_id (
osid.id.Id
) – a sourceId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–source_id
isnull
compliance: mandatory – This method must be implemented.
- source_id (
-
reference_id_terms
¶
-
match_commentor_id
(resource_id, match)¶ Sets a resource
Id
to match a commentor.Parameters: - resource_id (
osid.id.Id
) – a resourceId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–resource_id
isnull
compliance: mandatory – This method must be implemented.
- resource_id (
-
commentor_id_terms
¶
-
supports_commentor_query
()¶ Tests if a
ResourceQuery
is available.Returns: true
if a resource query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
commentor_query
¶ Gets the query for a resource query.
Multiple retrievals produce a nested
OR
term.Returns: the resource query Return type: osid.resource.ResourceQuery
Raise: Unimplemented
–supports_commentor_query()
isfalse
compliance: optional – This method must be implemented if ``supports_commentor_query()`` is ``true``.
-
commentor_terms
¶
-
match_commenting_agent_id
(agent_id, match)¶ Sets an agent
Id
.Parameters: - agent_id (
osid.id.Id
) – an agentId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–agent_id
isnull
compliance: mandatory – This method must be implemented.
- agent_id (
-
commenting_agent_id_terms
¶
-
supports_commenting_agent_query
()¶ Tests if an
AgentQuery
is available.Returns: true
if an agent query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
commenting_agent_query
¶ Gets the query for an agent query.
Multiple retrievals produce a nested
OR
term.Returns: the agent query Return type: osid.authentication.AgentQuery
Raise: Unimplemented
–supports_commenting_agent_query()
isfalse
compliance: optional – This method must be implemented if ``supports_commenting_agent_query()`` is ``true``.
-
commenting_agent_terms
¶
-
match_text
(text, string_match_type, match)¶ Matches text.
Parameters: - text (
string
) – the text - string_match_type (
osid.type.Type
) – a string match type - match (
boolean
) –true
for a positive match,false
for a negative match
Raise: InvalidArgument
–text
is not ofstring_match_type
Raise: NullArgument
–text
isnull
Raise: Unsupported
–supports_string_match_type(string_match_type)
isfalse
compliance: mandatory – This method must be implemented.
- text (
-
match_any_text
(match)¶ Matches a comment that has any text assigned.
Parameters: match ( boolean
) –true
to match comments with any text,false
to match comments with no textcompliance: mandatory – This method must be implemented.
-
text_terms
¶
-
match_rating_id
(grade_id, match)¶ Sets a grade
Id
.Parameters: - grade_id (
osid.id.Id
) – a gradeId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–grade_id
isnull
compliance: mandatory – This method must be implemented.
- grade_id (
-
rating_id_terms
¶
-
supports_rating_query
()¶ Tests if a
GradeQuery
is available.Returns: true
if a rating query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
rating_query
¶ Gets the query for a rating query.
Multiple retrievals produce a nested
OR
term.Returns: the rating query Return type: osid.grading.GradeQuery
Raise: Unimplemented
–supports_rating_query()
isfalse
compliance: optional – This method must be implemented if ``supports_rating_query()`` is ``true``.
-
match_any_rating
(match)¶ Matches books with any rating.
Parameters: match ( boolean
) –true
to match comments with any rating,false
to match comments with no ratingscompliance: mandatory – This method must be implemented.
-
rating_terms
¶
-
match_book_id
(book_id, match)¶ Sets the book
Id
for this query to match comments assigned to books.Parameters: - book_id (
osid.id.Id
) – a bookId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–book_id
isnull
compliance: mandatory – This method must be implemented.
- book_id (
-
book_id_terms
¶
-
supports_book_query
()¶ Tests if a
BookQuery
is available.Returns: true
if a book query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
book_query
¶ Gets the query for a book query.
Multiple retrievals produce a nested
OR
term.Returns: the book query Return type: osid.commenting.BookQuery
Raise: Unimplemented
–supports_book_query()
isfalse
compliance: optional – This method must be implemented if ``supports_book_query()`` is ``true``.
-
book_terms
¶
-
get_comment_query_record
(comment_record_type)¶ Gets the comment query record corresponding to the given
Comment
recordType
.Multiple record retrievals produce a nested
OR
term.Parameters: comment_record_type ( osid.type.Type
) – a comment record typeReturns: the comment query record Return type: osid.commenting.records.CommentQueryRecord
Raise: NullArgument
–comment_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(comment_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-
Book Query¶
-
class
dlkit.commenting.queries.
BookQuery
¶ Bases:
dlkit.osid.queries.OsidCatalogQuery
This is the query for searching books.
Each method specifies an
AND
term while multiple invocations of the same method produce a nestedOR
.-
match_comment_id
(comment_id, match)¶ Sets the comment
Id
for this query to match comments assigned to books.Parameters: - comment_id (
osid.id.Id
) – a commentId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–comment_id
isnull
compliance: mandatory – This method must be implemented.
- comment_id (
-
comment_id_terms
¶
-
supports_comment_query
()¶ Tests if a comment query is available.
Returns: true
if a comment query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
comment_query
¶ Gets the query for a comment.
Returns: the comment query Return type: osid.commenting.CommentQuery
Raise: Unimplemented
–supports_comment_query()
isfalse
compliance: optional – This method must be implemented if ``supports_comment_query()`` is ``true``.
-
match_any_comment
(match)¶ Matches books with any comment.
Parameters: match ( boolean
) –true
to match books with any comment,false
to match books with no commentscompliance: mandatory – This method must be implemented.
-
comment_terms
¶
-
match_ancestor_book_id
(book_id, match)¶ Sets the book
Id
for this query to match books that have the specified book as an ancestor.Parameters: - book_id (
osid.id.Id
) – a bookId
- match (
boolean
) –true
for a positive match, afalse
for a negative match
Raise: NullArgument
–book_id
isnull
compliance: mandatory – This method must be implemented.
- book_id (
-
ancestor_book_id_terms
¶
-
supports_ancestor_book_query
()¶ Tests if a
BookQuery
is available.Returns: true
if a book query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
ancestor_book_query
¶ Gets the query for a book.
Multiple retrievals produce a nested
OR
term.Returns: the book query Return type: osid.commenting.BookQuery
Raise: Unimplemented
–supports_ancestor_book_query()
isfalse
compliance: optional – This method must be implemented if ``supports_ancestor_book_query()`` is ``true``.
-
match_any_ancestor_book
(match)¶ Matches books with any ancestor.
Parameters: match ( boolean
) –true
to match books with any ancestor,false
to match root bookscompliance: mandatory – This method must be implemented.
-
ancestor_book_terms
¶
-
match_descendant_book_id
(book_id, match)¶ Sets the book
Id
for this query to match books that have the specified book as a descendant.Parameters: - book_id (
osid.id.Id
) – a bookId
- match (
boolean
) –true
for a positive match,false
for a negative match
Raise: NullArgument
–book_id
isnull
compliance: mandatory – This method must be implemented.
- book_id (
-
descendant_book_id_terms
¶
-
supports_descendant_book_query
()¶ Tests if a
BookQuery
is available.Returns: true
if a book query is available,false
otherwiseReturn type: boolean
compliance: mandatory – This method must be implemented.
-
descendant_book_query
¶ Gets the query for a book.
Multiple retrievals produce a nested
OR
term.Returns: the book query Return type: osid.commenting.BookQuery
Raise: Unimplemented
–supports_descendant_book_query()
isfalse
compliance: optional – This method must be implemented if ``supports_descendant_book_query()`` is ``true``.
-
match_any_descendant_book
(match)¶ Matches books with any descendant.
Parameters: match ( boolean
) –true
to match books with any descendant,false
to match leaf bookscompliance: mandatory – This method must be implemented.
-
descendant_book_terms
¶
-
get_book_query_record
(book_record_type)¶ Gets the book query record corresponding to the given
Book
recordType
.Multiple record retrievals produce a nested boolean
OR
term.Parameters: book_record_type ( osid.type.Type
) – a book record typeReturns: the book query record Return type: osid.commenting.records.BookQueryRecord
Raise: NullArgument
–book_record_type
isnull
Raise: OperationFailed
– unable to complete requestRaise: Unsupported
–has_record_type(book_record_type)
isfalse
compliance: mandatory – This method must be implemented.
-