Пример #1
0
 def __init__(self, graph):
     Bindable.__init__(self, graph.service_root.uri.resolve("load2neo"))
     try:
         self.__load2neo_version = self.resource.metadata["load2neo_version"]
     except GraphError:
         raise NotImplementedError("Load2neo extension not available")
     self.__geoff_loader = Resource(self.resource.metadata["geoff_loader"])
Пример #2
0
 def __init__(self, uri=None):
     if uri is None:
         service_root = ServiceRoot()
         manager = Resource(service_root.resource.metadata["management"])
         monitor = Monitor(manager.metadata["services"]["monitor"])
         uri = monitor.resource.uri
     Bindable.__init__(self, uri)
Пример #3
0
 def __init__(self, content_type, uri, name=None):
     Bindable.__init__(self)
     self._content_type = content_type
     key_value_pos = uri.find("/{key}/{value}")
     if key_value_pos >= 0:
         self._searcher = ResourceTemplate(uri)
         self.bind(uri[:key_value_pos])
     else:
         self.bind(uri)
         self._searcher = ResourceTemplate(uri.string + "/{key}/{value}")
     uri = self.resource.uri
     if self.graph.neo4j_version >= (1, 9):
         self._create_or_fail = Resource(uri.resolve("?uniqueness=create_or_fail"))
         self._get_or_create = Resource(uri.resolve("?uniqueness=get_or_create"))
     else:
         self._create_or_fail = None
         self._get_or_create = Resource(uri.resolve("?unique"))
     self._query_template = ResourceTemplate(uri.string + "{?query,order}")
     self._name = name or uri.path.segments[-1]
     self.__searcher_stem_cache = {}