RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
OntologySubclasses.py
Go to the documentation of this file.
1 from RappCloud.Objects import (
2  File,
3  Payload)
4 
5 from Cloud import (
6  CloudMsg,
7  CloudRequest,
8  CloudResponse)
9 
10 
11 class OntologySubclasses(CloudMsg):
12  """ Ontology Subclasses Of Cloud Message object"""
13 
14  class Request(CloudRequest):
15  """ Ontology Subclasses Of Cloud Request object.
16 
17  OntologySubclasses.Request
18  """
19  def __init__(self, **kwargs):
20  """!
21  Constructor
22 
23  @param **kwargs - Keyword arguments. Apply values to the request attributes.
24  - @ref query
25  """
26  ## The Ontology class.
27  # e.g. 'Oven'
28  self.ontology_class = ''
29  ## Recursive search.
30  self.recursive = False
31  super(OntologySubclasses.Request, self).__init__(**kwargs)
32 
33 
34  def make_payload(self):
35  """ Create and return the Payload of the Request. """
36  return Payload(
37  ontology_class=self.ontology_class,
38  recursive=self.recursive)
39 
40 
41  def make_files(self):
42  """ Create and return Array of File objects of the Request. """
43  return []
44 
45 
46  class Response(CloudResponse):
47  """ Ontology Subclasses Cloud Response object.
48 
49  OntologySubclasses.Response
50  """
51  def __init__(self, **kwargs):
52  """!
53  Constructor
54 
55  @param **kwargs - Keyword arguments. Apply values to the request attributes.
56  - @ref error
57  - @ref results
58  """
59 
60  ## Error message
61  self.error = ''
62  ## Ontology query results
63  self.results = []
64  super(OntologySubclasses.Response, self).__init__(**kwargs)
65 
66 
67  def __init__(self, **kwargs):
68  """!
69  Constructor
70 
71  @param **kwargs - Keyword arguments. Apply values to the request attributes.
72  - @ref Request.query
73  """
74 
75  # Create and hold the Request object for this CloudMsg
77  # Create and hold the Response object for this CloudMsg
79  super(OntologySubclasses, self).__init__(
80  svcname='ontology_subclasses_of', **kwargs)
81 
82