swh.graph.server.app module¶
A proxy HTTP server for swh-graph, talking to the Java code via py4j, and using FIFO as a transport to stream integers between the two languages.
-
class
swh.graph.server.app.
GraphView
(*args, **kwargs)[source]¶ Bases:
aiohttp.web_urldispatcher.View
Base class for views working on the graph, with utility functions
-
node_of_swhid
(swhid)[source]¶ Lookup a SWHID in a swhid2node map, failing in an HTTP-nice way if needed.
-
-
class
swh.graph.server.app.
StreamingGraphView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.GraphView
Base class for views streaming their response line by line.
-
content_type
= 'text/plain'¶
-
async
prepare_response
()[source]¶ This can be overridden with some setup to be run before the response actually starts streaming.
-
-
class
swh.graph.server.app.
StatsView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.GraphView
View showing some statistics on the graph
-
class
swh.graph.server.app.
SimpleTraversalView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.StreamingGraphView
Base class for views of simple traversals
-
simple_traversal_type
: Optional[str] = None¶
-
-
class
swh.graph.server.app.
LeavesView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.SimpleTraversalView
-
simple_traversal_type
: Optional[str] = 'leaves'¶
-
-
class
swh.graph.server.app.
NeighborsView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.SimpleTraversalView
-
simple_traversal_type
: Optional[str] = 'neighbors'¶
-
-
class
swh.graph.server.app.
VisitNodesView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.SimpleTraversalView
-
simple_traversal_type
: Optional[str] = 'visit_nodes'¶
-
-
class
swh.graph.server.app.
WalkView
(*args, **kwargs)[source]¶
-
class
swh.graph.server.app.
VisitPathsView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.SimpleTraversalView
-
content_type
= 'application/x-ndjson'¶
-
-
class
swh.graph.server.app.
CountView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.GraphView
Base class for counting views.
-
count_type
: Optional[str] = None¶
-
-
class
swh.graph.server.app.
CountNeighborsView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.CountView
-
count_type
: Optional[str] = 'neighbors'¶
-
-
class
swh.graph.server.app.
CountLeavesView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.CountView
-
count_type
: Optional[str] = 'leaves'¶
-
-
class
swh.graph.server.app.
CountVisitNodesView
(*args, **kwargs)[source]¶ Bases:
swh.graph.server.app.CountView
-
count_type
: Optional[str] = 'visit_nodes'¶
-