def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) self._settings = self._resourceDescriptor # use the constructor descriptor for the initial settings # link cache keeps endpoints hashed by pathFromBase string, only need to walk the path one time self._linkBaseDict = self.Resources.get('baseObject').resources self._linkCache = {} self._init()
def __init__(self, parentObject=None, resourceDescriptor={}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) # make the defaultResources self.Description = self.create({'resourceName':'Description',\ 'resourceClass': 'Description'}) self.Agent = self.create({'resourceName':'Agent',\ 'resourceClass':'Agent'})
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) #make default resources self.Description = self.create({'resourceName':'Description',\ 'resourceClass': 'Description'}) self.Observers = self.create({'resourceName':'Observers',\ 'resourceClass':'Observers'})
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) # make the defaultResources self.Description = self.create({'resourceName':'Description',\ 'resourceClass': 'Description'}) self.Agent = self.create({'resourceName':'Agent',\ 'resourceClass':'Agent'})
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) self._settings = self._resourceDescriptor self._baseObject = self.resources['baseObject'] self._linkBaseDict = self.resources['baseObject'].resources self._thisURI = self.resources['baseObject'].Properties.get('httpService') \ + self.resources['parentObject'].resources['parentObject'].Properties.get('pathFromBase') self._settings.update({'thisURI': self._thisURI}) self._init()
def __init__(self, parentObject=None, resourceName=''): RESTfulResource.__init__(self, parentObject, resourceName) self.graph = Graph() self._parseContentTypes = [ 'text/plain' , 'application/rdf+xml' , 'text/rdf+n3' ] self._serializeContentTypes = [ 'text/xml' , 'text/plain', 'application/rdf+xml' , 'application/x-turtle' , 'text/rdf+n3' ] self.fmt = { 'text/xml' : 'xml', 'application/rdf+xml' : 'xml', 'application/x-turtle' : 'turtle', 'text/rdf+n3' : 'n3', 'text/plain' : 'nt' }
def __init__(self): RESTfulResource.__init__(self) self.graph = Graph() self._parseContentTypes = [ 'text/plain' , 'application/rdf+xml' , 'text/rdf+n3' ] self._serializeContentTypes = [ 'text/xml' , 'text/plain', 'application/rdf+xml' , 'application/x-turtle' , 'text/rdf+n3' ] self.fmt = { 'text/xml' : 'xml', 'application/rdf+xml' : 'xml', 'application/x-turtle' : 'turtle', 'text/rdf+n3' : 'n3', 'text/plain' : 'nt' }
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) self.graph = Graph() # see if graph was passed in on the resource constructor if 'graph' in resourceDescriptor and any(resourceDescriptor['graph']) : self.graph.parse( data=json.dumps(resourceDescriptor['graph']) ,format='rdf-json' ) self._parseContentTypes = [ 'application/json', 'application/rdf+xml' , 'application/json+ld', 'text/turtle', 'text/n3', 'application/n-triples', 'application/n-quads', 'application/trix', 'text/trig', ] self._serializeContentTypes = [ 'application/json', 'application/rdf+xml' , 'application/json+ld', 'text/turtle', 'text/n3', 'application/n-triples', 'application/n-quads', # context 'application/trix', # context 'text/trig', 'text/xml', 'text/plain' ] # FIXME look at passing cType strings into parser selector, RDFlib plugins register as cType handlers self.fmt = { 'text/xml' : 'xml', 'application/rdf+xml' : 'xml', 'text/turtle' : 'turtle', 'test/trig' : 'trig', 'text/n3' : 'n3', 'application/n-triples' : 'nt', 'application/trix' : 'trix', 'application/n-quads' : 'nquads', 'text/trig' : 'trig', 'application/rdf+json' : 'rdf-json', 'application/json+ld' : 'json-ld', 'application/json' : 'rdf-json', 'text/plain' : 'xml' }
def __init__(self, parentObject=None, resourceName=''): RESTfulResource.__init__(self, parentObject, resourceName) # make a reference to the graph inside the associated Description resource self.graph = self.resources['parentObject'].resources['parentObject'].Description.graph # This resource supports link-format only self._parseContentTypes = [ 'application/link-format' ] self._serializeContentTypes = [ 'application/link-format' ] self.fmt = { 'application/link-format': 'linkFormat' } # attribute - predicate bindings RDF - core-link-format self._attrToPred = {'rt': RDFS.Resource, 'if': RDF.type } self._predToAttr = {RDFS.Resource: 'rt', RDF.type: 'if' }
def __init__(self, parentObject=None, resourceName=''): RESTfulResource.__init__(self, parentObject, resourceName) # make a reference to the graph inside the associated Description resource # move to get and set methods to allow creation of this resource before Description # self.graph = self.resources['parentObject'].resources['parentObject'].resources['Description'].graph # This resource supports link-format only self._parseContentTypes = [ 'application/link-format' ] self._serializeContentTypes = [ 'application/link-format' ] self.fmt = { 'application/link-format': 'linkFormat' } # attribute - predicate bindings RDF - core-link-format self._attrToPred = {'rt': Literal('resourceType'), 'if': Literal('interfaceType') } self._predToAttr = {Literal('resourceType'): 'rt', Literal('interfaceType') : 'if' }
def __init__(self, parentObject=None, resourceName=""): RESTfulResource.__init__(self, parentObject, resourceName) self.graph = Graph() self._parseContentTypes = ["text/plain", "application/rdf+xml", "text/rdf+n3"] self._serializeContentTypes = [ "text/xml", "text/plain", "application/rdf+xml", "application/x-turtle", "text/rdf+n3", ] self.fmt = { "text/xml": "xml", "application/rdf+xml": "xml", "application/x-turtle": "turtle", "text/rdf+n3": "n3", "text/plain": "nt", }
def __init__(self, parentObject=None, resourceName=''): RESTfulResource.__init__(self, parentObject, resourceName) # make a reference to the graph inside the associated Description resource # move to get and set methods to allow creation of this resource before Description # self.graph = self.resources['parentObject'].resources['parentObject'].resources['Description'].graph # This resource supports link-format only self._parseContentTypes = ['application/link-format'] self._serializeContentTypes = ['application/link-format'] self.fmt = {'application/link-format': 'linkFormat'} # attribute - predicate bindings RDF - core-link-format self._attrToPred = { 'rt': Literal('resourceType'), 'if': Literal('interfaceType') } self._predToAttr = { Literal('resourceType'): 'rt', Literal('interfaceType'): 'if' }
def __init__(self): RESTfulResource.__init__(self)
def __init__(self, parentObject=None, resourceDescriptor={}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) self._settings = self._resourceDescriptor self._baseObject = self.resources['baseObject'] self._linkBaseDict = self.resources['baseObject'].resources self._init()
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) self._observers = {}
def __init__(self): RESTfulResource.__init__(self) self._propertyLinks = None self._appHandlerName = None self._updateHandler = None # reference to _updateHandler method of AppHandler
def __init__(self): RESTfulResource.__init__(self) self.defaultClass = 'ObservableProperty' # used when a new resource name is used in create self.wellKnownClasses = [ 'Description' , 'Observers' , 'PropertyOfInterest' , 'SmartObject' , 'RESTfulResource' , 'Agent' ]
def __init__(self): RESTfulResource.__init__(self) self.defaultClass = 'PropertyOfInterest'
def __init__(self): RESTfulResource.__init__(self) self.defaultClass = 'Handler' self._handlers = {}
def __init__(self): RESTfulResource.__init__(self) self.defaultClass = "Handler" self._handlers = {}
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor)
def __init__(self, parentObject=None, resourceDescriptor = {}): RESTfulResource.__init__(self, parentObject, resourceDescriptor) self._settings = self._resourceDescriptor self._baseObject = self.resources['baseObject'] self._linkBaseDict = self.resources['baseObject'].resources self._init()
def __init__(self): RESTfulResource.__init__(self) self.__schemes = ['http', 'coap', 'callback'] self.__observers = []