diff --git a/Dockerfile b/Dockerfile index 4805f7e..4a1dc56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,25 @@ -FROM python:3.6-slim -MAINTAINER Salvo Rinzivillo +FROM nikolaik/python-nodejs:latest +MAINTAINER Giulio Rossetti COPY requirements.txt /tmp/ - - -RUN pip install --upgrade pip +RUN pip install --upgrade pip RUN pip install gunicorn RUN pip install -r /tmp/requirements.txt - +RUN apt-get update +RUN apt-get -y install git COPY . /app WORKDIR /app -EXPOSE 5000 +RUN git clone https://github.com/GiulioRossetti/NDLib_viz.git +WORKDIR NDLib_viz +RUN npm install + +EXPOSE 5000 8080 + +WORKDIR /app ENTRYPOINT ["/bin/bash"] CMD ["gunicorn.sh"] diff --git a/README.md b/README.md index 5c2ac57..1f34b7b 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ This project offers a REST interface for the [ndlib](https://github.com/GiulioRo Python 3.6 required dependencies: -- [ndlib](https://github.com/GiulioRossetti/ndlib)=3.0.0 +- [ndlib](https://github.com/GiulioRossetti/ndlib)==4.0.2 - flask==0.12 - flask-cors==3.0.2 - flask_restful==0.3.5 @@ -42,7 +42,7 @@ apidoc -i ndlib-rest/ -o ndlib-rest/static/docs #### Docker Container -The web application is shipped in a [Docker](https://www.docker.com/) container. +The web application (REST service and Viz framework) is shipped as a [Docker](https://www.docker.com/) container. You can use the Dockerfile to create a new image and run the web application using the gunicorn application server. To create the Docker image, install Docker on your machine. @@ -54,7 +54,7 @@ docker build -t [tagname_for_your_image] . The command create a new image with the specified name. Pay attention to the ```.``` a the end of the command. ``` -docker run -d -i -p 5000:5000 [tagname_for_your_image] +docker run -d -i -p 5000:5000 -p 8080:8080 [tagname_for_your_image] ``` This command execute a container with the previous image, bind the local port 5000 to the internal port of the container. The option ```-d``` make the container to run in the background (detached) @@ -68,6 +68,19 @@ To stop a container ``` docker stop container_name +``` + ##### Prebuilt Docker image + +To avoid docker image building just download the full container (beta version) + +``` +docker pull rossetti/ndrest:ndrest_beta +``` + +Once the image is ready run it as: + +``` +docker run -d -i -p 5000:5000 -p 8080:8080 rossetti/ndrest:ndrest_beta ``` ## REST service details diff --git a/gunicorn.sh b/gunicorn.sh index a19c420..d6443d4 100755 --- a/gunicorn.sh +++ b/gunicorn.sh @@ -1,3 +1,14 @@ #!/bin/bash set -e -exec gunicorn -w 4 -b 0.0.0.0:5000 ndrest:app & + +pip install -r requirements.txt +exec gunicorn -w 4 -b 0.0.0.0:5000 ndrest:app > /dev/null & + +if [ -d NDLib_viz ]; then + rm -rf NDLib_viz +fi + +git clone https://github.com/GiulioRossetti/NDLib_viz.git > /dev/null +cd NDLib_viz +npm install +npm run dev & diff --git a/ndrest.py b/ndrest.py index d9c79cf..d54b4e5 100644 --- a/ndrest.py +++ b/ndrest.py @@ -25,6 +25,7 @@ import ndlib.models.epidemics.SISModel as sis import ndlib.models.epidemics.SEIRModel as seir import ndlib.models.epidemics.SEISModel as seis +import ndlib.models.epidemics.SWIRModel as swir import ndlib.models.epidemics.ProfileModel as ac import ndlib.models.epidemics.ProfileThresholdModel as pt import ndlib.models.epidemics.IndependentCascadesModel as ic @@ -1453,6 +1454,56 @@ def put(self): return {'Message': 'Resource created'}, success +class SWIR(Resource): + + def put(self): + """ + @api {put} /api/SWIR SWIR + @ApiDescription Instantiate a SWIR Model on the network bound to the provided token. + @apiVersion 2.0.0 + @apiParam {String} token The token. + @apiParam {Number{0-1}} infected The initial percentage of infected nodes. + @apiParam {Number{0-1}} kappa Infection rate. + @apiParam {Number{0-1}} mu Recovery rate. + @apiParam {Number{0-1}} nu Incubation period. + @apiName swir + @apiGroup Epidemics + @apiExample [python request] Example usage: + put('http://localhost:5000/api/SWIR', data={'kappa': kappa, 'mu': mu, 'nu': nu, 'infected': percentage, 'token': token}) + """ + token = str(request.form['token']) + + if not os.path.exists("data/db/%s" % token): + return {"Message": "Wrong Token"}, bad_request + + try: + kappa = request.form['kappa'] + mu = request.form['mu'] + nu = request.form['nu'] + infected = request.form['infected'] + if infected == '': + infected = 0.05 + + db_net = load_data("data/db/%s/net" % token) + + g = db_net['net']['g'] + db_net.close() + + model = swir.SWIRModel(g) + config = mc.Configuration() + config.add_model_parameter('percentage_infected', float(infected)) + config.add_model_parameter('kappa', float(kappa)) + config.add_model_parameter('mu', float(mu)) + config.add_model_parameter('nu', float(nu)) + model.set_initial_status(config) + + config_model(token, "SWIR", model) + except: + return {'Message': 'Parameter error'}, bad_request + + return {'Message': 'Resource created'}, success + + class Profile(Resource): def put(self): @@ -2486,6 +2537,7 @@ def get(self): api.add_resource(MaJorityRule, '/api/MajorityRule') api.add_resource(Sznajd, '/api/Sznajd') api.add_resource(AlgorithmicBias, '/api/AlgorithmicBias') +api.add_resource(SWIR, '/api/SWIR') api.add_resource(dSI, '/api/dSI') api.add_resource(dSIR, '/api/dSIR') diff --git a/requirements.txt b/requirements.txt index 9d588c5..cb17053 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,5 +6,5 @@ flask_cors requests numpy scipy -ndlib +ndlib==4.0.2 gunicorn diff --git a/resources/models.json b/resources/models.json index b38e349..05345dc 100644 --- a/resources/models.json +++ b/resources/models.json @@ -7,6 +7,11 @@ "token": "access token", "infected": "The initial percentage of infected nodes.", "threshold":"A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -17,6 +22,65 @@ "beta": "Infection rate", "gamma": "Recovery rate", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Removed": 2 + } + }, + { + "name": "SEIR", + "uri": "/api/SEIR", + "params": { + "token": "access token", + "beta": "Infection rate", + "gamma": "Recovery rate", + "alpha": "Incubation period", + "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Removed": 3, + "Exposed": 2 + } + }, + { + "name": "SEIS", + "uri": "/api/SEIS", + "params": { + "token": "access token", + "beta": "Infection rate", + "lambda": "Recovery rate", + "alpha": "Incubation period", + "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Exposed": 2 + } + }, + { + "name": "SWIR", + "uri": "/api/SWIR", + "params": { + "token": "access token", + "kappa": "Infection rate from susceptible state", + "mu": "weakened rate", + "nu": "infection rate from weakened state", + "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Weakened": 2, + "Removed": 3 } }, { @@ -26,6 +90,11 @@ "token": "access token", "beta": "Infection rate", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -36,6 +105,11 @@ "beta": "Infection rate", "lambda": "Recovery rate", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -45,6 +119,12 @@ "token": "access token", "profile": "fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Blocked": -1 } }, { @@ -55,6 +135,12 @@ "profile": "2 fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.", "threshold":"A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Blocked": -1 } }, { @@ -63,6 +149,12 @@ "params": { "token": "access token", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Removed": 2 } }, { @@ -71,6 +163,11 @@ "params": { "token": "access token", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -80,6 +177,11 @@ "token": "access token", "infected": "The initial percentage of infected nodes.", "q": "Number of neighbours that affect the opinion of an agent" + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -89,6 +191,11 @@ "token": "access token", "infected": "The initial percentage of infected nodes.", "q": "The group size" + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -97,6 +204,11 @@ "params": { "token": "access token", "infected": "The initial percentage of infected nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1 } }, { @@ -108,6 +220,12 @@ "threshold": "A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.", "adopter_rate": "The adopter rate. Fixed probability of self-infection per iteration.", "blocked": "Percentage of blocked nodes." + }, + "discrete": true, + "statuses": { + "Susceptible": 0, + "Infected": 1, + "Blocked": -1 } }, { @@ -116,7 +234,24 @@ "params": { "token": "access token", "I": "The external information." + }, + "discrete": false, + "statuses": { + } + }, + { + "name": "Algorithmic Bias", + "uri": "/api/AlgorithmicBias", + "params": { + "token": "access token", + "epsilon": "bounded confidence threshold", + "gamma": "algorithmic bias" + }, + "discrete": false, + "statuses": { + "Infected": 0 } } + ] } \ No newline at end of file diff --git a/service_test/EndpointTesting.py b/service_test/EndpointTesting.py index 89dfde4..ba3a29a 100644 --- a/service_test/EndpointTesting.py +++ b/service_test/EndpointTesting.py @@ -127,6 +127,10 @@ def test_load_experiments(self): self.assertEqual(res.status_code, 200) print("Load SI: OK") + res = put('%s/api/SWIR' % base, data={'infected': 0.1, 'kappa': 0.2, 'mu': 0.2, 'nu': 0.2, 'token': token5}) + self.assertEqual(res.status_code, 200) + print("Load SWIR: OK") + res = put('%s/api/SIS' % base, data={'infected': 0.1, 'beta': 0.2, 'lambda': 0.01, 'token': token5}) self.assertEqual(res.status_code, 200) print("Load SIS: OK") @@ -164,7 +168,7 @@ def test_load_experiments(self): print("Load Independent Cascades: OK") res = post('%s/api/ExperimentStatus' % base, data={'token': token5}).json() - self.assertEqual(len(res['Models']), 10) + self.assertEqual(len(res['Models']), 11) print("Display Experiment Resources: OK") res = delete('%s/api/Experiment' % base, data={'token': token5}) @@ -270,6 +274,7 @@ def test_advanced_configuration(self): self.assertEqual(gr.status_code, 200) mods = get('%s/api/Models' % base).json() + print(mods) self.assertIn('endpoints', mods) print("Retrieve models enpoints: OK") diff --git a/static/docs/api_data.js b/static/docs/api_data.js index 7ed0a7f..49d47b9 100644 --- a/static/docs/api_data.js +++ b/static/docs/api_data.js @@ -1 +1 @@ -define({ "api": [ { "type": "put", "url": "/api/KerteszThreshold", "title": "KerteszThreshold", "description": "

Instantiate a KerteszThreshold Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

The adopter rate. Fixed probability of self-infection per iteration.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Percentage of blocked nodes.

" } ] } }, "name": "KerteszThreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/KerteszThreshold', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/KerteszThreshold" } ] }, { "type": "put", "url": "/api/dSI", "title": "DynSI", "description": "

Instantiate a SI Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "dsi", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSI" } ] }, { "type": "put", "url": "/api/dSIR", "title": "DynSIR", "description": "

Instantiate a SIR Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "dsir", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIR" } ] }, { "type": "put", "url": "/api/dSIS", "title": "DynSIS", "description": "

Instantiate a SIS Model on the Dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "dsis", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIS" } ] }, { "type": "put", "url": "/api/IndependentCascades", "title": "Independent Cascades", "description": "

Instantiate an Independent Cascades Model on the network bound to the provided token. The edge threshold is assumed equal to 0.1 divided for all edges: this behavior can be changed by using the advanced configuration endpoint.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "indepcascades", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/IndependentCascades', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IndependentCascades" } ] }, { "type": "put", "url": "/api/Profile", "title": "Profile", "description": "

Instantiate a Profile Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profile", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Profile', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Profile" } ] }, { "type": "put", "url": "/api/ProfileThreshold", "title": "Profile-Threshold", "description": "

Instantiate a Profile-Threshold Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profilethreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ProfileThreshold', data={'token': token, 'infected': percentage, 'threshold': threshold, 'profile': profile})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ProfileThreshold" } ] }, { "type": "put", "url": "/api/SEIR", "title": "SEIR", "description": "

Instantiate a SEIR Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'gamma': gamma, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIR" } ] }, { "type": "put", "url": "/api/SEIS", "title": "SEIS", "description": "

Instantiate a SEIS Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'lambda': lambda, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIS" } ] }, { "type": "put", "url": "/api/SI", "title": "SI", "description": "

Instantiate a SI Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "si", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SI" } ] }, { "type": "put", "url": "/api/SIR", "title": "SIR", "description": "

Instantiate a SIR Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "sir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIR" } ] }, { "type": "put", "url": "/api/SIS", "title": "SIS", "description": "

Instantiate a SIS Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "sis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIS" } ] }, { "type": "put", "url": "/api/Threshold", "title": "Threshold", "description": "

Instantiate a Threshold Model on the network bound to the provided token.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "threshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Threshold', data={'token': token, 'infected': percentage, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Threshold" } ] }, { "type": "put", "url": "/api/Configure", "title": "Advanced Configuration", "description": "

This endpoint allows for an in-depth specification of the planned experiment. The advanced configuration regards:

The configuration will be applied to all the models attached to the experiment (if not specified otherwise).

Pay attention: this endpoint should be called only after having instantiated both Network and Model resources.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "status", "description": "

JSON description of the node/edge attributes.

" } ] }, "examples": [ { "title": "Expected JSON Input (could be partially filled)", "content": "{\n 'nodes':\n {\n 'threshold': {\"node1\": 0.1, \"node2\": 0.05, \"node3\": 0.24 },\n 'profile': {\"node1\": 0.4, \"node2\": 0.5, \"node3\": 0.64}\n },\n 'edges':\n [\n {\n \"source\": \"node1\",\n \"target\": \"node2\",\n \"weight\": 0.2\n },\n {\n \"source\": \"node2\",\n \"target\": \"node3\",\n \"weight\": 0.7\n },\n ],\n 'model': {'model_parameter': parameter_value},\n 'status': {'status_name': [node1, node2, node3]}\n}", "type": "json" } ] }, "name": "configure", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Configure', data={'status': json, 'models': 'model1,model2','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Configure" } ] }, { "type": "delete", "url": "/api/Experiment", "title": "Destroy", "description": "

Delete all the resources (the network and the models) attached to the specified experiment.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "name": "deleteexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Experiment', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "post", "url": "/api/ExperimentStatus", "title": "Describe", "description": "

Describe the resources (Network and Models) involved in the experiment.

", "version": "0.1.0", "name": "describeexp", "group": "Experiment", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[Python request] Example usage:", "content": "post('http://localhost:5000/api/ExperimentStatus')", "type": "python" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Experiment", "title": "Create", "description": "

Setup a new experiment and generate a its unique identifier. An experiment is described by the Network (only one) and Models associated to it.

", "version": "0.1.0", "name": "getexp", "group": "Experiment", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Experiment')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "put", "url": "/api/ExperimentStatus", "title": "Reset", "description": "

Reset the status of models attached to the specified experiment. If no models are specified all the current experiment statuses will be reset.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String of comma separated model names.

" } ] } }, "name": "resetexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ExperimentStatus', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Exploratory", "title": "List Exploratories", "description": "

Return the available network endpoints and their parameters

", "version": "0.6.0", "name": "listexploratory", "group": "Exploratory", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "exploratories", "description": "

List of available exploratories.

" } ] }, "examples": [ { "title": "Response example: Available exploratories", "content": "{'exploratory':\n [\n {\n \"name\": \"Lastfm_rock\",\n \"network\": \"Lastfm\",\n \"node_attributes\": [\"profile\", \"threshold\"],\n \"edge_attributes\": [\"weight\"],\n \"description\": \"Diffusion threshold and profiles computed on rock listening data\"\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Exploratory", "title": "Load Exploratory", "description": "

Load the configuration data for a specific exploratory.

", "version": "0.6.0", "name": "loadexploratory", "group": "Exploratory", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "exploratory", "description": "

The exploratory name.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Iteration", "title": "Iteration", "description": "

Return the next iteration for all the models bind to the provided token.

", "version": "0.1.0", "name": "iterator", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n 'Model2':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n }\n }", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Iteration', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Iteration" } ] }, { "type": "post", "url": "/api/IterationBunch", "title": "Iteration Bunch", "description": "

Return the next iterations for the all the models bind to the provided token.

", "version": "0.1.0", "name": "iteratorbunch", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "bunch", "description": "

Then number of iteration to return.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 1,\n 'node3': 0\n }\n }\n ],\n 'Model2':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 1\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/IterationBunch', data={'token': token, 'bunch': bunch, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IterationBunch" } ] }, { "type": "put", "url": "/api/Generators/BarabasiAlbertGraph", "title": "Barabasi-Albert", "description": "

Create a BA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" } ] } }, "name": "BAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/BarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/BarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/ClusteredBarabasiAlbertGraph", "title": "Clustered-Barabasi-Albert", "description": "

Create a CBA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

Probability of adding a triangle after adding a random edge

" } ] } }, "name": "CBAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ClusteredBarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ClusteredBarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/CompleteGraph", "title": "Complete Graph", "description": "

Create a complete graph of size n and bind it to the provided token

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "n", "description": "

The number of nodes.

" } ] } }, "name": "CompleteGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/CompleteGraph', data={'n': n, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/CompleteGraph" } ] }, { "type": "put", "url": "/api/Generators/ERGraph", "title": "Erdos-Renyi", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The rewiring probability.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "t", "description": "

Number of temporal snapshots If not specified an undirected graph will be generated.

" } ] } }, "name": "ERGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ERGraph', data={'n': n, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ERGraph" } ] }, { "type": "put", "url": "/api/Generators/PlantedPartition", "title": "Planted l-partitions", "description": "

Create a Planted l-Parition graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "l", "description": "

The number of groups.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "k", "description": "

The number of nodes per group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pin", "description": "

The probability of connecting vertices within a group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pout", "description": "

The probability of connecting vertices between a group.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed. If not specified an undirected graph will be generated.

" } ] } }, "name": "PlantedPartition", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/PlantedPartition', data={'l': l, 'k': k, 'pin': pin, 'pout': pout, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/PlantedPartition" } ] }, { "type": "put", "url": "/api/Generators/WattsStrogatzGraph", "title": "Watts-Strogatz", "description": "

Create a WS graph compliant to the specified parameters and bind it to the provided token

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "k", "description": "

Each node is connected to k nearest neighbors in ring topology

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The probability of rewiring each edge

" } ] } }, "name": "WSGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/WattsStrogatzGraph', data={'n': n, 'k': k, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/WattsStrogatzGraph" } ] }, { "type": "post", "url": "/api/GetGraph", "title": "Get Network", "description": "

Return the json representation of the network analyzed

", "version": "0.5.0", "name": "expgraphs", "group": "Networks", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "optional": false, "field": "token", "description": "

The token

" } ] } }, "success": { "examples": [ { "title": "Response example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"barabasi_albert_graph(5,1)\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/GetGraph'data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/GetGraph" } ] }, { "type": "put", "url": "/api/Networks", "title": "Load real graph", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

The network name.

" } ] } }, "name": "loadgraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Networks', data={'name': 'Last.fm','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "put", "url": "/api/UploadNetwork", "title": "Upload Network", "description": "

@apiVersion 0.9.0

", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph is directed

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "graph", "description": "

JSON description of the graph attributes.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "dynamic", "description": "

If the graph is a dynamic one.

" } ] }, "examples": [ { "title": "graph example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"graph_name\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "name": "upload", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/UploadNetwork', data={'file': JSON, 'directed': False, 'token': token})", "type": "json" } ], "version": "0.0.0", "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/UploadNetwork" } ] }, { "type": "put", "url": "/api/AlgorithmicBias", "title": "AlgorithmicBias", "description": "

Instantiate a AlgorithmicBias Model on the network bound to the provided token.

", "version": "2.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "epsilon", "description": "

Bounded confidence threshold.

" }, { "group": "Parameter", "type": "Number", "size": "0-100", "optional": false, "field": "gamma", "description": "

Algorithmic bias.

" } ] } }, "name": "AlgorithmicBias", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/AlgorithmicBias', data={'token': token, 'epsilon': percentage, 'gamma': gamma})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/AlgorithmicBias" } ] }, { "type": "put", "url": "/api/CognitiveOpinionDynamic", "title": "CognitiveOpinionDynamic", "description": "

Instantiate a CognitiveOpinionDynamic Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "I", "description": "

External information.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_min", "description": "

Minimum of the range of initial values for node parameter T.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_max", "description": "

Maximum of the range of initial values for node parameter T. If T_range_min>T_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_min", "description": "

Minimum of the range of initial values for node parameter B;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_max", "description": "

Maximum of the range of initial values for node parameter B. If B_range_min>B_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_negative", "description": "

Fraction of individuals having the node parameter R=-1;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_neutral", "description": "

Fraction of individuals having the node parameter R=0;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_positive", "description": "

Fraction of individuals having the node parameter R=1. The following relation should hold: R_fraction_negative+R_fraction_neutral+R_fraction_positive=1. To achieve this, the fractions selected will be normalised to sum 1.

" } ] } }, "name": "CognitiveOpinionDynamic", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/CognitiveOpinionDynamic', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/CognitiveOpinionDynamic" } ] }, { "type": "put", "url": "/api/MajorityRule", "title": "Majority Rule", "description": "

Instantiate the Majority Rule Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-N", "optional": false, "field": "q", "description": "

The group size.

" } ] } }, "name": "majority", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Majority', data={'token': token, 'infected': percentage, 'q': q})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/MajorityRule" } ] }, { "type": "put", "url": "/api/QVoter", "title": "QVoter", "description": "

Instantiate the QVoter Model on the network bound to the provided token.

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "q", "description": "

Number of neighbours that affect the opinion of an agent

" } ] } }, "name": "qvoter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/QVoter', data={'token': token, 'q': number,'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/QVoter" } ] }, { "type": "put", "url": "/api/Sznajd", "title": "Sznajd", "description": "

Instantiate the Sznajd Model on the network bound to the provided token. The model is defined for complete graphs, however it can be applied to generic ones.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "sznajd", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Sznajd', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Sznajd" } ] }, { "type": "put", "url": "/api/Voter", "title": "Voter", "description": "

Instantiate the Voter Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "voter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Voter', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Voter" } ] }, { "type": "delete", "url": "/api/Models", "title": "Models Destroy", "description": "

Delete model resources attached to the specified token. If no models are specified all the ones bind to the experiment will be destroyed.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "name": "deletemodels", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Models', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "delete", "url": "/api/Networks", "title": "Network Destroy", "description": "

Delete the graph resource attached to the specified token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" } ] } }, "name": "destroynetwork", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Networks', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Networks", "title": "Real Networks Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.4.0", "name": "getgraphs", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Available networks", "content": "{'networks':\n [\n {\n 'name': 'Lastfm',\n 'size':\n {\n 'nodes': 70000,\n 'edges': 389639\n },\n 'description': 'Undirected social graph involving UK users of Last.fm'\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Networks')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Models", "title": "Models Endpoints", "description": "

Return the available models endpoints and their parameter specification

", "version": "0.1.0", "name": "getmodellist", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of model endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endponts':\n [\n {\n 'name': 'Threshold',\n 'uri': 'http://localhost:5000/api/Models/Threshold',\n 'params':\n {\n 'token': 'access token',\n }\n },\n {\n 'name': 'SIR',\n 'uri': 'http://localhost:5000/api/Models/SIR',\n 'params':\n {\n 'token': 'access token',\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Models')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "get", "url": "/api/Generators", "title": "Network Generator Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.1.0", "name": "getnetworks", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endpoints':\n [\n {\n 'name': 'Erdos Reny',\n 'uri': 'http://localhost:5000/api/Networks/ERGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'p': 'rewiring probability'\n }\n },\n {\n 'name': 'Barabasi Albert',\n 'uri': 'http://localhost:5000/api/Networks/BarabasiAlbertGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'm': 'Number of edges to attach from a new node to existing nodes'\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Generators')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators" } ] }, { "success": { "fields": { "Success 200": [ { "group": "Success 200", "optional": false, "field": "varname1", "description": "

No type.

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "varname2", "description": "

With type.

" } ] } }, "type": "", "url": "", "version": "0.0.0", "filename": "ndlib-rest/static/docs/main.js", "group": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "groupTitle": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "name": "" } ] }); +define({ "api": [ { "type": "put", "url": "/api/KerteszThreshold", "title": "KerteszThreshold", "description": "

Instantiate a KerteszThreshold Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

The adopter rate. Fixed probability of self-infection per iteration.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Percentage of blocked nodes.

" } ] } }, "name": "KerteszThreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/KerteszThreshold', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/KerteszThreshold" } ] }, { "type": "put", "url": "/api/dSI", "title": "DynSI", "description": "

Instantiate a SI Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "dsi", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSI" } ] }, { "type": "put", "url": "/api/dSIR", "title": "DynSIR", "description": "

Instantiate a SIR Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "dsir", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIR" } ] }, { "type": "put", "url": "/api/dSIS", "title": "DynSIS", "description": "

Instantiate a SIS Model on the Dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "dsis", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIS" } ] }, { "type": "put", "url": "/api/IndependentCascades", "title": "Independent Cascades", "description": "

Instantiate an Independent Cascades Model on the network bound to the provided token. The edge threshold is assumed equal to 0.1 divided for all edges: this behavior can be changed by using the advanced configuration endpoint.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "indepcascades", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/IndependentCascades', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IndependentCascades" } ] }, { "type": "put", "url": "/api/Profile", "title": "Profile", "description": "

Instantiate a Profile Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profile", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Profile', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Profile" } ] }, { "type": "put", "url": "/api/ProfileThreshold", "title": "Profile-Threshold", "description": "

Instantiate a Profile-Threshold Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profilethreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ProfileThreshold', data={'token': token, 'infected': percentage, 'threshold': threshold, 'profile': profile})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ProfileThreshold" } ] }, { "type": "put", "url": "/api/SEIR", "title": "SEIR", "description": "

Instantiate a SEIR Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'gamma': gamma, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIR" } ] }, { "type": "put", "url": "/api/SEIS", "title": "SEIS", "description": "

Instantiate a SEIS Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'lambda': lambda, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIS" } ] }, { "type": "put", "url": "/api/SI", "title": "SI", "description": "

Instantiate a SI Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "si", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SI" } ] }, { "type": "put", "url": "/api/SIR", "title": "SIR", "description": "

Instantiate a SIR Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "sir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIR" } ] }, { "type": "put", "url": "/api/SIS", "title": "SIS", "description": "

Instantiate a SIS Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "sis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIS" } ] }, { "type": "put", "url": "/api/SWIR", "title": "SWIR", "description": "

Instantiate a SWIR Model on the network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "kappa", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "mu", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "nu", "description": "

Incubation period.

" } ] } }, "name": "swir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SWIR', data={'kappa': kappa, 'mu': mu, 'nu': nu, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SWIR" } ] }, { "type": "put", "url": "/api/Threshold", "title": "Threshold", "description": "

Instantiate a Threshold Model on the network bound to the provided token.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "threshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Threshold', data={'token': token, 'infected': percentage, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Threshold" } ] }, { "type": "put", "url": "/api/Configure", "title": "Advanced Configuration", "description": "

This endpoint allows for an in-depth specification of the planned experiment. The advanced configuration regards:

The configuration will be applied to all the models attached to the experiment (if not specified otherwise).

Pay attention: this endpoint should be called only after having instantiated both Network and Model resources.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "status", "description": "

JSON description of the node/edge attributes.

" } ] }, "examples": [ { "title": "Expected JSON Input (could be partially filled)", "content": "{\n 'nodes':\n {\n 'threshold': {\"node1\": 0.1, \"node2\": 0.05, \"node3\": 0.24 },\n 'profile': {\"node1\": 0.4, \"node2\": 0.5, \"node3\": 0.64}\n },\n 'edges':\n [\n {\n \"source\": \"node1\",\n \"target\": \"node2\",\n \"weight\": 0.2\n },\n {\n \"source\": \"node2\",\n \"target\": \"node3\",\n \"weight\": 0.7\n },\n ],\n 'model': {'model_parameter': parameter_value},\n 'status': {'status_name': [node1, node2, node3]}\n}", "type": "json" } ] }, "name": "configure", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Configure', data={'status': json, 'models': 'model1,model2','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Configure" } ] }, { "type": "delete", "url": "/api/Experiment", "title": "Destroy", "description": "

Delete all the resources (the network and the models) attached to the specified experiment.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "name": "deleteexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Experiment', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "post", "url": "/api/ExperimentStatus", "title": "Describe", "description": "

Describe the resources (Network and Models) involved in the experiment.

", "version": "0.1.0", "name": "describeexp", "group": "Experiment", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[Python request] Example usage:", "content": "post('http://localhost:5000/api/ExperimentStatus')", "type": "python" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Experiment", "title": "Create", "description": "

Setup a new experiment and generate a its unique identifier. An experiment is described by the Network (only one) and Models associated to it.

", "version": "0.1.0", "name": "getexp", "group": "Experiment", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Experiment')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "put", "url": "/api/ExperimentStatus", "title": "Reset", "description": "

Reset the status of models attached to the specified experiment. If no models are specified all the current experiment statuses will be reset.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String of comma separated model names.

" } ] } }, "name": "resetexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ExperimentStatus', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Exploratory", "title": "List Exploratories", "description": "

Return the available network endpoints and their parameters

", "version": "0.6.0", "name": "listexploratory", "group": "Exploratory", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "exploratories", "description": "

List of available exploratories.

" } ] }, "examples": [ { "title": "Response example: Available exploratories", "content": "{'exploratory':\n [\n {\n \"name\": \"Lastfm_rock\",\n \"network\": \"Lastfm\",\n \"node_attributes\": [\"profile\", \"threshold\"],\n \"edge_attributes\": [\"weight\"],\n \"description\": \"Diffusion threshold and profiles computed on rock listening data\"\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Exploratory", "title": "Load Exploratory", "description": "

Load the configuration data for a specific exploratory.

", "version": "0.6.0", "name": "loadexploratory", "group": "Exploratory", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "exploratory", "description": "

The exploratory name.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Iteration", "title": "Iteration", "description": "

Return the next iteration for all the models bind to the provided token.

", "version": "0.1.0", "name": "iterator", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n 'Model2':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n }\n }", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Iteration', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Iteration" } ] }, { "type": "post", "url": "/api/IterationBunch", "title": "Iteration Bunch", "description": "

Return the next iterations for the all the models bind to the provided token.

", "version": "0.1.0", "name": "iteratorbunch", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "bunch", "description": "

Then number of iteration to return.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 1,\n 'node3': 0\n }\n }\n ],\n 'Model2':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 1\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/IterationBunch', data={'token': token, 'bunch': bunch, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IterationBunch" } ] }, { "type": "put", "url": "/api/Generators/BarabasiAlbertGraph", "title": "Barabasi-Albert", "description": "

Create a BA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" } ] } }, "name": "BAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/BarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/BarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/ClusteredBarabasiAlbertGraph", "title": "Clustered-Barabasi-Albert", "description": "

Create a CBA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

Probability of adding a triangle after adding a random edge

" } ] } }, "name": "CBAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ClusteredBarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ClusteredBarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/CompleteGraph", "title": "Complete Graph", "description": "

Create a complete graph of size n and bind it to the provided token

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "n", "description": "

The number of nodes.

" } ] } }, "name": "CompleteGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/CompleteGraph', data={'n': n, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/CompleteGraph" } ] }, { "type": "put", "url": "/api/Generators/ERGraph", "title": "Erdos-Renyi", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The rewiring probability.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "t", "description": "

Number of temporal snapshots If not specified an undirected graph will be generated.

" } ] } }, "name": "ERGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ERGraph', data={'n': n, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ERGraph" } ] }, { "type": "put", "url": "/api/Generators/PlantedPartition", "title": "Planted l-partitions", "description": "

Create a Planted l-Parition graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "l", "description": "

The number of groups.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "k", "description": "

The number of nodes per group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pin", "description": "

The probability of connecting vertices within a group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pout", "description": "

The probability of connecting vertices between a group.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed. If not specified an undirected graph will be generated.

" } ] } }, "name": "PlantedPartition", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/PlantedPartition', data={'l': l, 'k': k, 'pin': pin, 'pout': pout, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/PlantedPartition" } ] }, { "type": "put", "url": "/api/Generators/WattsStrogatzGraph", "title": "Watts-Strogatz", "description": "

Create a WS graph compliant to the specified parameters and bind it to the provided token

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "k", "description": "

Each node is connected to k nearest neighbors in ring topology

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The probability of rewiring each edge

" } ] } }, "name": "WSGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/WattsStrogatzGraph', data={'n': n, 'k': k, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/WattsStrogatzGraph" } ] }, { "type": "post", "url": "/api/GetGraph", "title": "Get Network", "description": "

Return the json representation of the network analyzed

", "version": "0.5.0", "name": "expgraphs", "group": "Networks", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "optional": false, "field": "token", "description": "

The token

" } ] } }, "success": { "examples": [ { "title": "Response example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"barabasi_albert_graph(5,1)\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/GetGraph'data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/GetGraph" } ] }, { "type": "put", "url": "/api/Networks", "title": "Load real graph", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

The network name.

" } ] } }, "name": "loadgraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Networks', data={'name': 'Last.fm','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "put", "url": "/api/UploadNetwork", "title": "Upload Network", "description": "

@apiVersion 0.9.0

", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph is directed

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "graph", "description": "

JSON description of the graph attributes.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "dynamic", "description": "

If the graph is a dynamic one.

" } ] }, "examples": [ { "title": "graph example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"graph_name\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "name": "upload", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/UploadNetwork', data={'file': JSON, 'directed': False, 'token': token})", "type": "json" } ], "version": "0.0.0", "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/UploadNetwork" } ] }, { "type": "put", "url": "/api/AlgorithmicBias", "title": "AlgorithmicBias", "description": "

Instantiate a AlgorithmicBias Model on the network bound to the provided token.

", "version": "2.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "epsilon", "description": "

Bounded confidence threshold.

" }, { "group": "Parameter", "type": "Number", "size": "0-100", "optional": false, "field": "gamma", "description": "

Algorithmic bias.

" } ] } }, "name": "AlgorithmicBias", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/AlgorithmicBias', data={'token': token, 'epsilon': percentage, 'gamma': gamma})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/AlgorithmicBias" } ] }, { "type": "put", "url": "/api/CognitiveOpinionDynamic", "title": "CognitiveOpinionDynamic", "description": "

Instantiate a CognitiveOpinionDynamic Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "I", "description": "

External information.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_min", "description": "

Minimum of the range of initial values for node parameter T.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_max", "description": "

Maximum of the range of initial values for node parameter T. If T_range_min>T_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_min", "description": "

Minimum of the range of initial values for node parameter B;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_max", "description": "

Maximum of the range of initial values for node parameter B. If B_range_min>B_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_negative", "description": "

Fraction of individuals having the node parameter R=-1;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_neutral", "description": "

Fraction of individuals having the node parameter R=0;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_positive", "description": "

Fraction of individuals having the node parameter R=1. The following relation should hold: R_fraction_negative+R_fraction_neutral+R_fraction_positive=1. To achieve this, the fractions selected will be normalised to sum 1.

" } ] } }, "name": "CognitiveOpinionDynamic", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/CognitiveOpinionDynamic', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/CognitiveOpinionDynamic" } ] }, { "type": "put", "url": "/api/MajorityRule", "title": "Majority Rule", "description": "

Instantiate the Majority Rule Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-N", "optional": false, "field": "q", "description": "

The group size.

" } ] } }, "name": "majority", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Majority', data={'token': token, 'infected': percentage, 'q': q})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/MajorityRule" } ] }, { "type": "put", "url": "/api/QVoter", "title": "QVoter", "description": "

Instantiate the QVoter Model on the network bound to the provided token.

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "q", "description": "

Number of neighbours that affect the opinion of an agent

" } ] } }, "name": "qvoter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/QVoter', data={'token': token, 'q': number,'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/QVoter" } ] }, { "type": "put", "url": "/api/Sznajd", "title": "Sznajd", "description": "

Instantiate the Sznajd Model on the network bound to the provided token. The model is defined for complete graphs, however it can be applied to generic ones.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "sznajd", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Sznajd', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Sznajd" } ] }, { "type": "put", "url": "/api/Voter", "title": "Voter", "description": "

Instantiate the Voter Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "voter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Voter', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Voter" } ] }, { "type": "delete", "url": "/api/Models", "title": "Models Destroy", "description": "

Delete model resources attached to the specified token. If no models are specified all the ones bind to the experiment will be destroyed.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "name": "deletemodels", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Models', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "delete", "url": "/api/Networks", "title": "Network Destroy", "description": "

Delete the graph resource attached to the specified token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" } ] } }, "name": "destroynetwork", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Networks', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Networks", "title": "Real Networks Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.4.0", "name": "getgraphs", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Available networks", "content": "{'networks':\n [\n {\n 'name': 'Lastfm',\n 'size':\n {\n 'nodes': 70000,\n 'edges': 389639\n },\n 'description': 'Undirected social graph involving UK users of Last.fm'\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Networks')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Models", "title": "Models Endpoints", "description": "

Return the available models endpoints and their parameter specification

", "version": "0.1.0", "name": "getmodellist", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of model endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endponts':\n [\n {\n 'name': 'Threshold',\n 'uri': 'http://localhost:5000/api/Models/Threshold',\n 'params':\n {\n 'token': 'access token',\n }\n },\n {\n 'name': 'SIR',\n 'uri': 'http://localhost:5000/api/Models/SIR',\n 'params':\n {\n 'token': 'access token',\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Models')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "get", "url": "/api/Generators", "title": "Network Generator Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.1.0", "name": "getnetworks", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endpoints':\n [\n {\n 'name': 'Erdos Reny',\n 'uri': 'http://localhost:5000/api/Networks/ERGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'p': 'rewiring probability'\n }\n },\n {\n 'name': 'Barabasi Albert',\n 'uri': 'http://localhost:5000/api/Networks/BarabasiAlbertGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'm': 'Number of edges to attach from a new node to existing nodes'\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Generators')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators" } ] }, { "success": { "fields": { "Success 200": [ { "group": "Success 200", "optional": false, "field": "varname1", "description": "

No type.

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "varname2", "description": "

With type.

" } ] } }, "type": "", "url": "", "version": "0.0.0", "filename": "ndlib-rest/static/docs/main.js", "group": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "groupTitle": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "name": "" } ] }); diff --git a/static/docs/api_data.json b/static/docs/api_data.json index 5734145..c92a96a 100644 --- a/static/docs/api_data.json +++ b/static/docs/api_data.json @@ -1 +1 @@ -[ { "type": "put", "url": "/api/KerteszThreshold", "title": "KerteszThreshold", "description": "

Instantiate a KerteszThreshold Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

The adopter rate. Fixed probability of self-infection per iteration.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Percentage of blocked nodes.

" } ] } }, "name": "KerteszThreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/KerteszThreshold', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/KerteszThreshold" } ] }, { "type": "put", "url": "/api/dSI", "title": "DynSI", "description": "

Instantiate a SI Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "dsi", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSI" } ] }, { "type": "put", "url": "/api/dSIR", "title": "DynSIR", "description": "

Instantiate a SIR Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "dsir", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIR" } ] }, { "type": "put", "url": "/api/dSIS", "title": "DynSIS", "description": "

Instantiate a SIS Model on the Dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "dsis", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIS" } ] }, { "type": "put", "url": "/api/IndependentCascades", "title": "Independent Cascades", "description": "

Instantiate an Independent Cascades Model on the network bound to the provided token. The edge threshold is assumed equal to 0.1 divided for all edges: this behavior can be changed by using the advanced configuration endpoint.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "indepcascades", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/IndependentCascades', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IndependentCascades" } ] }, { "type": "put", "url": "/api/Profile", "title": "Profile", "description": "

Instantiate a Profile Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profile", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Profile', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Profile" } ] }, { "type": "put", "url": "/api/ProfileThreshold", "title": "Profile-Threshold", "description": "

Instantiate a Profile-Threshold Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profilethreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ProfileThreshold', data={'token': token, 'infected': percentage, 'threshold': threshold, 'profile': profile})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ProfileThreshold" } ] }, { "type": "put", "url": "/api/SEIR", "title": "SEIR", "description": "

Instantiate a SEIR Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'gamma': gamma, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIR" } ] }, { "type": "put", "url": "/api/SEIS", "title": "SEIS", "description": "

Instantiate a SEIS Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'lambda': lambda, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIS" } ] }, { "type": "put", "url": "/api/SI", "title": "SI", "description": "

Instantiate a SI Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "si", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SI" } ] }, { "type": "put", "url": "/api/SIR", "title": "SIR", "description": "

Instantiate a SIR Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "sir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIR" } ] }, { "type": "put", "url": "/api/SIS", "title": "SIS", "description": "

Instantiate a SIS Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "sis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIS" } ] }, { "type": "put", "url": "/api/Threshold", "title": "Threshold", "description": "

Instantiate a Threshold Model on the network bound to the provided token.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "threshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Threshold', data={'token': token, 'infected': percentage, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Threshold" } ] }, { "type": "put", "url": "/api/Configure", "title": "Advanced Configuration", "description": "

This endpoint allows for an in-depth specification of the planned experiment. The advanced configuration regards:

The configuration will be applied to all the models attached to the experiment (if not specified otherwise).

Pay attention: this endpoint should be called only after having instantiated both Network and Model resources.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "status", "description": "

JSON description of the node/edge attributes.

" } ] }, "examples": [ { "title": "Expected JSON Input (could be partially filled)", "content": "{\n 'nodes':\n {\n 'threshold': {\"node1\": 0.1, \"node2\": 0.05, \"node3\": 0.24 },\n 'profile': {\"node1\": 0.4, \"node2\": 0.5, \"node3\": 0.64}\n },\n 'edges':\n [\n {\n \"source\": \"node1\",\n \"target\": \"node2\",\n \"weight\": 0.2\n },\n {\n \"source\": \"node2\",\n \"target\": \"node3\",\n \"weight\": 0.7\n },\n ],\n 'model': {'model_parameter': parameter_value},\n 'status': {'status_name': [node1, node2, node3]}\n}", "type": "json" } ] }, "name": "configure", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Configure', data={'status': json, 'models': 'model1,model2','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Configure" } ] }, { "type": "delete", "url": "/api/Experiment", "title": "Destroy", "description": "

Delete all the resources (the network and the models) attached to the specified experiment.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "name": "deleteexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Experiment', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "post", "url": "/api/ExperimentStatus", "title": "Describe", "description": "

Describe the resources (Network and Models) involved in the experiment.

", "version": "0.1.0", "name": "describeexp", "group": "Experiment", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[Python request] Example usage:", "content": "post('http://localhost:5000/api/ExperimentStatus')", "type": "python" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Experiment", "title": "Create", "description": "

Setup a new experiment and generate a its unique identifier. An experiment is described by the Network (only one) and Models associated to it.

", "version": "0.1.0", "name": "getexp", "group": "Experiment", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Experiment')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "put", "url": "/api/ExperimentStatus", "title": "Reset", "description": "

Reset the status of models attached to the specified experiment. If no models are specified all the current experiment statuses will be reset.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String of comma separated model names.

" } ] } }, "name": "resetexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ExperimentStatus', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Exploratory", "title": "List Exploratories", "description": "

Return the available network endpoints and their parameters

", "version": "0.6.0", "name": "listexploratory", "group": "Exploratory", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "exploratories", "description": "

List of available exploratories.

" } ] }, "examples": [ { "title": "Response example: Available exploratories", "content": "{'exploratory':\n [\n {\n \"name\": \"Lastfm_rock\",\n \"network\": \"Lastfm\",\n \"node_attributes\": [\"profile\", \"threshold\"],\n \"edge_attributes\": [\"weight\"],\n \"description\": \"Diffusion threshold and profiles computed on rock listening data\"\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Exploratory", "title": "Load Exploratory", "description": "

Load the configuration data for a specific exploratory.

", "version": "0.6.0", "name": "loadexploratory", "group": "Exploratory", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "exploratory", "description": "

The exploratory name.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Iteration", "title": "Iteration", "description": "

Return the next iteration for all the models bind to the provided token.

", "version": "0.1.0", "name": "iterator", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n 'Model2':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n }\n }", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Iteration', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Iteration" } ] }, { "type": "post", "url": "/api/IterationBunch", "title": "Iteration Bunch", "description": "

Return the next iterations for the all the models bind to the provided token.

", "version": "0.1.0", "name": "iteratorbunch", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "bunch", "description": "

Then number of iteration to return.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 1,\n 'node3': 0\n }\n }\n ],\n 'Model2':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 1\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/IterationBunch', data={'token': token, 'bunch': bunch, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IterationBunch" } ] }, { "type": "put", "url": "/api/Generators/BarabasiAlbertGraph", "title": "Barabasi-Albert", "description": "

Create a BA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" } ] } }, "name": "BAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/BarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/BarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/ClusteredBarabasiAlbertGraph", "title": "Clustered-Barabasi-Albert", "description": "

Create a CBA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

Probability of adding a triangle after adding a random edge

" } ] } }, "name": "CBAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ClusteredBarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ClusteredBarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/CompleteGraph", "title": "Complete Graph", "description": "

Create a complete graph of size n and bind it to the provided token

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "n", "description": "

The number of nodes.

" } ] } }, "name": "CompleteGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/CompleteGraph', data={'n': n, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/CompleteGraph" } ] }, { "type": "put", "url": "/api/Generators/ERGraph", "title": "Erdos-Renyi", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The rewiring probability.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "t", "description": "

Number of temporal snapshots If not specified an undirected graph will be generated.

" } ] } }, "name": "ERGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ERGraph', data={'n': n, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ERGraph" } ] }, { "type": "put", "url": "/api/Generators/PlantedPartition", "title": "Planted l-partitions", "description": "

Create a Planted l-Parition graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "l", "description": "

The number of groups.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "k", "description": "

The number of nodes per group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pin", "description": "

The probability of connecting vertices within a group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pout", "description": "

The probability of connecting vertices between a group.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed. If not specified an undirected graph will be generated.

" } ] } }, "name": "PlantedPartition", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/PlantedPartition', data={'l': l, 'k': k, 'pin': pin, 'pout': pout, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/PlantedPartition" } ] }, { "type": "put", "url": "/api/Generators/WattsStrogatzGraph", "title": "Watts-Strogatz", "description": "

Create a WS graph compliant to the specified parameters and bind it to the provided token

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "k", "description": "

Each node is connected to k nearest neighbors in ring topology

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The probability of rewiring each edge

" } ] } }, "name": "WSGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/WattsStrogatzGraph', data={'n': n, 'k': k, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/WattsStrogatzGraph" } ] }, { "type": "post", "url": "/api/GetGraph", "title": "Get Network", "description": "

Return the json representation of the network analyzed

", "version": "0.5.0", "name": "expgraphs", "group": "Networks", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "optional": false, "field": "token", "description": "

The token

" } ] } }, "success": { "examples": [ { "title": "Response example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"barabasi_albert_graph(5,1)\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/GetGraph'data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/GetGraph" } ] }, { "type": "put", "url": "/api/Networks", "title": "Load real graph", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

The network name.

" } ] } }, "name": "loadgraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Networks', data={'name': 'Last.fm','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "put", "url": "/api/UploadNetwork", "title": "Upload Network", "description": "

@apiVersion 0.9.0

", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph is directed

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "graph", "description": "

JSON description of the graph attributes.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "dynamic", "description": "

If the graph is a dynamic one.

" } ] }, "examples": [ { "title": "graph example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"graph_name\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "name": "upload", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/UploadNetwork', data={'file': JSON, 'directed': False, 'token': token})", "type": "json" } ], "version": "0.0.0", "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/UploadNetwork" } ] }, { "type": "put", "url": "/api/AlgorithmicBias", "title": "AlgorithmicBias", "description": "

Instantiate a AlgorithmicBias Model on the network bound to the provided token.

", "version": "2.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "epsilon", "description": "

Bounded confidence threshold.

" }, { "group": "Parameter", "type": "Number", "size": "0-100", "optional": false, "field": "gamma", "description": "

Algorithmic bias.

" } ] } }, "name": "AlgorithmicBias", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/AlgorithmicBias', data={'token': token, 'epsilon': percentage, 'gamma': gamma})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/AlgorithmicBias" } ] }, { "type": "put", "url": "/api/CognitiveOpinionDynamic", "title": "CognitiveOpinionDynamic", "description": "

Instantiate a CognitiveOpinionDynamic Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "I", "description": "

External information.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_min", "description": "

Minimum of the range of initial values for node parameter T.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_max", "description": "

Maximum of the range of initial values for node parameter T. If T_range_min>T_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_min", "description": "

Minimum of the range of initial values for node parameter B;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_max", "description": "

Maximum of the range of initial values for node parameter B. If B_range_min>B_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_negative", "description": "

Fraction of individuals having the node parameter R=-1;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_neutral", "description": "

Fraction of individuals having the node parameter R=0;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_positive", "description": "

Fraction of individuals having the node parameter R=1. The following relation should hold: R_fraction_negative+R_fraction_neutral+R_fraction_positive=1. To achieve this, the fractions selected will be normalised to sum 1.

" } ] } }, "name": "CognitiveOpinionDynamic", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/CognitiveOpinionDynamic', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/CognitiveOpinionDynamic" } ] }, { "type": "put", "url": "/api/MajorityRule", "title": "Majority Rule", "description": "

Instantiate the Majority Rule Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-N", "optional": false, "field": "q", "description": "

The group size.

" } ] } }, "name": "majority", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Majority', data={'token': token, 'infected': percentage, 'q': q})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/MajorityRule" } ] }, { "type": "put", "url": "/api/QVoter", "title": "QVoter", "description": "

Instantiate the QVoter Model on the network bound to the provided token.

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "q", "description": "

Number of neighbours that affect the opinion of an agent

" } ] } }, "name": "qvoter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/QVoter', data={'token': token, 'q': number,'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/QVoter" } ] }, { "type": "put", "url": "/api/Sznajd", "title": "Sznajd", "description": "

Instantiate the Sznajd Model on the network bound to the provided token. The model is defined for complete graphs, however it can be applied to generic ones.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "sznajd", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Sznajd', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Sznajd" } ] }, { "type": "put", "url": "/api/Voter", "title": "Voter", "description": "

Instantiate the Voter Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "voter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Voter', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Voter" } ] }, { "type": "delete", "url": "/api/Models", "title": "Models Destroy", "description": "

Delete model resources attached to the specified token. If no models are specified all the ones bind to the experiment will be destroyed.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "name": "deletemodels", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Models', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "delete", "url": "/api/Networks", "title": "Network Destroy", "description": "

Delete the graph resource attached to the specified token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" } ] } }, "name": "destroynetwork", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Networks', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Networks", "title": "Real Networks Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.4.0", "name": "getgraphs", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Available networks", "content": "{'networks':\n [\n {\n 'name': 'Lastfm',\n 'size':\n {\n 'nodes': 70000,\n 'edges': 389639\n },\n 'description': 'Undirected social graph involving UK users of Last.fm'\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Networks')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Models", "title": "Models Endpoints", "description": "

Return the available models endpoints and their parameter specification

", "version": "0.1.0", "name": "getmodellist", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of model endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endponts':\n [\n {\n 'name': 'Threshold',\n 'uri': 'http://localhost:5000/api/Models/Threshold',\n 'params':\n {\n 'token': 'access token',\n }\n },\n {\n 'name': 'SIR',\n 'uri': 'http://localhost:5000/api/Models/SIR',\n 'params':\n {\n 'token': 'access token',\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Models')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "get", "url": "/api/Generators", "title": "Network Generator Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.1.0", "name": "getnetworks", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endpoints':\n [\n {\n 'name': 'Erdos Reny',\n 'uri': 'http://localhost:5000/api/Networks/ERGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'p': 'rewiring probability'\n }\n },\n {\n 'name': 'Barabasi Albert',\n 'uri': 'http://localhost:5000/api/Networks/BarabasiAlbertGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'm': 'Number of edges to attach from a new node to existing nodes'\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Generators')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators" } ] }, { "success": { "fields": { "Success 200": [ { "group": "Success 200", "optional": false, "field": "varname1", "description": "

No type.

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "varname2", "description": "

With type.

" } ] } }, "type": "", "url": "", "version": "0.0.0", "filename": "ndlib-rest/static/docs/main.js", "group": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "groupTitle": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "name": "" } ] +[ { "type": "put", "url": "/api/KerteszThreshold", "title": "KerteszThreshold", "description": "

Instantiate a KerteszThreshold Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

The adopter rate. Fixed probability of self-infection per iteration.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Percentage of blocked nodes.

" } ] } }, "name": "KerteszThreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/KerteszThreshold', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/KerteszThreshold" } ] }, { "type": "put", "url": "/api/dSI", "title": "DynSI", "description": "

Instantiate a SI Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "dsi", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSI" } ] }, { "type": "put", "url": "/api/dSIR", "title": "DynSIR", "description": "

Instantiate a SIR Model on the dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "dsir", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIR" } ] }, { "type": "put", "url": "/api/dSIS", "title": "DynSIS", "description": "

Instantiate a SIS Model on the Dynamic network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "dsis", "group": "Epidemics_Dynamic_Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/dSIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics_Dynamic_Networks", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/dSIS" } ] }, { "type": "put", "url": "/api/IndependentCascades", "title": "Independent Cascades", "description": "

Instantiate an Independent Cascades Model on the network bound to the provided token. The edge threshold is assumed equal to 0.1 divided for all edges: this behavior can be changed by using the advanced configuration endpoint.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "indepcascades", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/IndependentCascades', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IndependentCascades" } ] }, { "type": "put", "url": "/api/Profile", "title": "Profile", "description": "

Instantiate a Profile Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profile", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Profile', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Profile" } ] }, { "type": "put", "url": "/api/ProfileThreshold", "title": "Profile-Threshold", "description": "

Instantiate a Profile-Threshold Model on the network bound to the provided token.

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "profile", "description": "

A fixed profile value for all the nodes: if not specified the profile will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "blocked", "description": "

Probability for a node that chose to not adopt to became blocked

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "adopter_rate", "description": "

Probability of spontaneous adoption

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "profilethreshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ProfileThreshold', data={'token': token, 'infected': percentage, 'threshold': threshold, 'profile': profile})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ProfileThreshold" } ] }, { "type": "put", "url": "/api/SEIR", "title": "SEIR", "description": "

Instantiate a SEIR Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'gamma': gamma, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIR" } ] }, { "type": "put", "url": "/api/SEIS", "title": "SEIS", "description": "

Instantiate a SEIS Model on the network bound to the provided token.

", "version": "1.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "alpha", "description": "

Incubation period.

" } ] } }, "name": "seis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SEIS', data={'beta': beta, 'lambda': lambda, 'alpha': alpha, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SEIS" } ] }, { "type": "put", "url": "/api/SI", "title": "SI", "description": "

Instantiate a SI Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" } ] } }, "name": "si", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SI', data={'beta': beta, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SI" } ] }, { "type": "put", "url": "/api/SIR", "title": "SIR", "description": "

Instantiate a SIR Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "gamma", "description": "

Recovery rate.

" } ] } }, "name": "sir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIR', data={'beta': beta, 'gamma': gamma, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIR" } ] }, { "type": "put", "url": "/api/SIS", "title": "SIS", "description": "

Instantiate a SIS Model on the network bound to the provided token.

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "beta", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "lambda", "description": "

Recovery rate.

" } ] } }, "name": "sis", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SIS', data={'beta': beta, 'lambda': lambda, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SIS" } ] }, { "type": "put", "url": "/api/SWIR", "title": "SWIR", "description": "

Instantiate a SWIR Model on the network bound to the provided token.

", "version": "2.0.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "kappa", "description": "

Infection rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "mu", "description": "

Recovery rate.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "nu", "description": "

Incubation period.

" } ] } }, "name": "swir", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/SWIR', data={'kappa': kappa, 'mu': mu, 'nu': nu, 'infected': percentage, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/SWIR" } ] }, { "type": "put", "url": "/api/Threshold", "title": "Threshold", "description": "

Instantiate a Threshold Model on the network bound to the provided token.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "threshold", "description": "

A fixed threshold value for all the nodes: if not specified the thresholds will be assigned using a normal distribution.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "threshold", "group": "Epidemics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Threshold', data={'token': token, 'infected': percentage, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Epidemics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Threshold" } ] }, { "type": "put", "url": "/api/Configure", "title": "Advanced Configuration", "description": "

This endpoint allows for an in-depth specification of the planned experiment. The advanced configuration regards:

The configuration will be applied to all the models attached to the experiment (if not specified otherwise).

Pay attention: this endpoint should be called only after having instantiated both Network and Model resources.

", "version": "0.5.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "status", "description": "

JSON description of the node/edge attributes.

" } ] }, "examples": [ { "title": "Expected JSON Input (could be partially filled)", "content": "{\n 'nodes':\n {\n 'threshold': {\"node1\": 0.1, \"node2\": 0.05, \"node3\": 0.24 },\n 'profile': {\"node1\": 0.4, \"node2\": 0.5, \"node3\": 0.64}\n },\n 'edges':\n [\n {\n \"source\": \"node1\",\n \"target\": \"node2\",\n \"weight\": 0.2\n },\n {\n \"source\": \"node2\",\n \"target\": \"node3\",\n \"weight\": 0.7\n },\n ],\n 'model': {'model_parameter': parameter_value},\n 'status': {'status_name': [node1, node2, node3]}\n}", "type": "json" } ] }, "name": "configure", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Configure', data={'status': json, 'models': 'model1,model2','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Configure" } ] }, { "type": "delete", "url": "/api/Experiment", "title": "Destroy", "description": "

Delete all the resources (the network and the models) attached to the specified experiment.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "name": "deleteexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Experiment', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "post", "url": "/api/ExperimentStatus", "title": "Describe", "description": "

Describe the resources (Network and Models) involved in the experiment.

", "version": "0.1.0", "name": "describeexp", "group": "Experiment", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[Python request] Example usage:", "content": "post('http://localhost:5000/api/ExperimentStatus')", "type": "python" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Experiment", "title": "Create", "description": "

Setup a new experiment and generate a its unique identifier. An experiment is described by the Network (only one) and Models associated to it.

", "version": "0.1.0", "name": "getexp", "group": "Experiment", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Experiment')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Experiment" } ] }, { "type": "put", "url": "/api/ExperimentStatus", "title": "Reset", "description": "

Reset the status of models attached to the specified experiment. If no models are specified all the current experiment statuses will be reset.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token identifying the experiment.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String of comma separated model names.

" } ] } }, "name": "resetexp", "group": "Experiment", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/ExperimentStatus', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Experiment", "groupDescription": "

An experiment represents the analytical unit of this REST API, it is composed by:

In order to perform an experiment the user should:
  1. Request a token, which univocally identifies the experiment
  2. Select and load resource using a Network Generator or loading an existing Graph
  3. Select one, or more, diffusion model(s)
  4. (optional) Use the advanced configuration facilities
  5. Execute the simulation
  6. (optional) Reset the experiment status, modify the models/network
  7. Destroy the experiment

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/ExperimentStatus" } ] }, { "type": "get", "url": "/api/Exploratory", "title": "List Exploratories", "description": "

Return the available network endpoints and their parameters

", "version": "0.6.0", "name": "listexploratory", "group": "Exploratory", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "exploratories", "description": "

List of available exploratories.

" } ] }, "examples": [ { "title": "Response example: Available exploratories", "content": "{'exploratory':\n [\n {\n \"name\": \"Lastfm_rock\",\n \"network\": \"Lastfm\",\n \"node_attributes\": [\"profile\", \"threshold\"],\n \"edge_attributes\": [\"weight\"],\n \"description\": \"Diffusion threshold and profiles computed on rock listening data\"\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Exploratory", "title": "Load Exploratory", "description": "

Load the configuration data for a specific exploratory.

", "version": "0.6.0", "name": "loadexploratory", "group": "Exploratory", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "exploratory", "description": "

The exploratory name.

" } ] } }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Exploratory')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Exploratory", "groupDescription": "

An exploratory is a pre-configured experiments. It provides:

To setup the exploratory five seps should be followed:
  1. Create an experiment
  2. Load a graph resource for which exploratories are available
  3. Retrieve the exploratory configuration
  4. Select one, or more, diffusion model(s)
  5. Execute the simulation
  6. Destroy the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Exploratory" } ] }, { "type": "post", "url": "/api/Iteration", "title": "Iteration", "description": "

Return the next iteration for all the models bind to the provided token.

", "version": "0.1.0", "name": "iterator", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n 'Model2':\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n }\n }", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/Iteration', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Iteration" } ] }, { "type": "post", "url": "/api/IterationBunch", "title": "Iteration Bunch", "description": "

Return the next iterations for the all the models bind to the provided token.

", "version": "0.1.0", "name": "iteratorbunch", "group": "Iterators", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "bunch", "description": "

Then number of iteration to return.

" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "iteration", "description": "

Nodes status after an iteration: 0=susceptible, 1=infected, 2=removed.

" } ] }, "examples": [ { "title": "Response example: iteration", "content": "{\n 'Model1':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 0,\n 'node2': 1,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 1,\n 'node3': 0\n }\n }\n ],\n 'Model2':\n [\n {\n 'iteration': 1,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 0\n }\n },\n {\n 'iteration': 2,\n 'status':\n {\n 'node0': 1,\n 'node1': 1,\n 'node2': 0,\n 'node3': 1\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/IterationBunch', data={'token': token, 'bunch': bunch, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Iterators", "groupDescription": "

Endpoints belonging to this family allow the user to require step-by-step, partial as well as complete runs of the models attached to the experiment.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/IterationBunch" } ] }, { "type": "put", "url": "/api/Generators/BarabasiAlbertGraph", "title": "Barabasi-Albert", "description": "

Create a BA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.2.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" } ] } }, "name": "BAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/BarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/BarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/ClusteredBarabasiAlbertGraph", "title": "Clustered-Barabasi-Albert", "description": "

Create a CBA graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "m", "description": "

The number of edges attached to each new node.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

Probability of adding a triangle after adding a random edge

" } ] } }, "name": "CBAGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ClusteredBarabasiAlbertGraph', data={'n': n, 'm': m, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ClusteredBarabasiAlbertGraph" } ] }, { "type": "put", "url": "/api/Generators/CompleteGraph", "title": "Complete Graph", "description": "

Create a complete graph of size n and bind it to the provided token

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "n", "description": "

The number of nodes.

" } ] } }, "name": "CompleteGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/CompleteGraph', data={'n': n, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/CompleteGraph" } ] }, { "type": "put", "url": "/api/Generators/ERGraph", "title": "Erdos-Renyi", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The rewiring probability.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "t", "description": "

Number of temporal snapshots If not specified an undirected graph will be generated.

" } ] } }, "name": "ERGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/ERGraph', data={'n': n, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/ERGraph" } ] }, { "type": "put", "url": "/api/Generators/PlantedPartition", "title": "Planted l-partitions", "description": "

Create a Planted l-Parition graph compliant to the specified parameters and bind it to the provided token

", "version": "0.9.2", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "l", "description": "

The number of groups.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "k", "description": "

The number of nodes per group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pin", "description": "

The probability of connecting vertices within a group.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "pout", "description": "

The probability of connecting vertices between a group.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph should be directed. If not specified an undirected graph will be generated.

" } ] } }, "name": "PlantedPartition", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/PlantedPartition', data={'l': l, 'k': k, 'pin': pin, 'pout': pout, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/PlantedPartition" } ] }, { "type": "put", "url": "/api/Generators/WattsStrogatzGraph", "title": "Watts-Strogatz", "description": "

Create a WS graph compliant to the specified parameters and bind it to the provided token

", "version": "0.3.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "200..100000", "optional": false, "field": "n", "description": "

The number of nodes.

" }, { "group": "Parameter", "type": "Number", "size": "1..", "optional": false, "field": "k", "description": "

Each node is connected to k nearest neighbors in ring topology

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "p", "description": "

The probability of rewiring each edge

" } ] } }, "name": "WSGraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Generators/WattsStrogatzGraph', data={'n': n, 'k': k, 'p': p, 'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators/WattsStrogatzGraph" } ] }, { "type": "post", "url": "/api/GetGraph", "title": "Get Network", "description": "

Return the json representation of the network analyzed

", "version": "0.5.0", "name": "expgraphs", "group": "Networks", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "optional": false, "field": "token", "description": "

The token

" } ] } }, "success": { "examples": [ { "title": "Response example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"barabasi_albert_graph(5,1)\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "post('http://localhost:5000/api/GetGraph'data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/GetGraph" } ] }, { "type": "put", "url": "/api/Networks", "title": "Load real graph", "description": "

Create an ER graph compliant to the specified parameters and bind it to the provided token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

The network name.

" } ] } }, "name": "loadgraph", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Networks', data={'name': 'Last.fm','token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "put", "url": "/api/UploadNetwork", "title": "Upload Network", "description": "

@apiVersion 0.9.0

", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "directed", "description": "

If the graph is directed

" }, { "group": "Parameter", "type": "json", "optional": false, "field": "graph", "description": "

JSON description of the graph attributes.

" }, { "group": "Parameter", "type": "Boolean", "optional": false, "field": "dynamic", "description": "

If the graph is a dynamic one.

" } ] }, "examples": [ { "title": "graph example:", "content": " {\n \"directed\": false,\n \"graph\": {\n \"name\": \"graph_name\"\n },\n \"links\": [\n {\n \"source\": 0,\n \"target\": 1\n },\n {\n \"source\": 0,\n \"target\": 2\n },\n {\n \"source\": 0,\n \"target\": 3\n },\n {\n \"source\": 0,\n \"target\": 4\n }\n ],\n \"multigraph\": false,\n \"nodes\": [\n {\n \"id\": 0\n },\n {\n \"id\": 1\n },\n {\n \"id\": 2\n },\n {\n \"id\": 3\n },\n {\n \"id\": 4\n }\n ]\n}", "type": "json" } ] }, "name": "upload", "group": "Networks", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/UploadNetwork', data={'file': JSON, 'directed': False, 'token': token})", "type": "json" } ], "version": "0.0.0", "filename": "ndlib-rest/ndrest.py", "groupTitle": "Networks", "groupDescription": "

Endpoints belonging to this family provide access to network resources.
In particular they provide lookup facilities for both real world datasets and network generators.
Moreover, the Get Network endpoint allows for the download of synthetic (i.e., generated) networks as well as all of those datasets for which are not specified access restriction.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/UploadNetwork" } ] }, { "type": "put", "url": "/api/AlgorithmicBias", "title": "AlgorithmicBias", "description": "

Instantiate a AlgorithmicBias Model on the network bound to the provided token.

", "version": "2.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "epsilon", "description": "

Bounded confidence threshold.

" }, { "group": "Parameter", "type": "Number", "size": "0-100", "optional": false, "field": "gamma", "description": "

Algorithmic bias.

" } ] } }, "name": "AlgorithmicBias", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/AlgorithmicBias', data={'token': token, 'epsilon': percentage, 'gamma': gamma})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/AlgorithmicBias" } ] }, { "type": "put", "url": "/api/CognitiveOpinionDynamic", "title": "CognitiveOpinionDynamic", "description": "

Instantiate a CognitiveOpinionDynamic Model on the network bound to the provided token.

", "version": "0.9.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "I", "description": "

External information.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_min", "description": "

Minimum of the range of initial values for node parameter T.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "T_range_max", "description": "

Maximum of the range of initial values for node parameter T. If T_range_min>T_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_min", "description": "

Minimum of the range of initial values for node parameter B;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "B_range_max", "description": "

Maximum of the range of initial values for node parameter B. If B_range_min>B_range_max they are swapped;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_negative", "description": "

Fraction of individuals having the node parameter R=-1;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_neutral", "description": "

Fraction of individuals having the node parameter R=0;

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "R_fraction_positive", "description": "

Fraction of individuals having the node parameter R=1. The following relation should hold: R_fraction_negative+R_fraction_neutral+R_fraction_positive=1. To achieve this, the fractions selected will be normalised to sum 1.

" } ] } }, "name": "CognitiveOpinionDynamic", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/CognitiveOpinionDynamic', data={'token': token, 'infected': percentage, 'adopters_rate': adopters_rate, 'blocked': blocked, 'threshold': threshold})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/CognitiveOpinionDynamic" } ] }, { "type": "put", "url": "/api/MajorityRule", "title": "Majority Rule", "description": "

Instantiate the Majority Rule Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "size": "0-N", "optional": false, "field": "q", "description": "

The group size.

" } ] } }, "name": "majority", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Majority', data={'token': token, 'infected': percentage, 'q': q})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/MajorityRule" } ] }, { "type": "put", "url": "/api/QVoter", "title": "QVoter", "description": "

Instantiate the QVoter Model on the network bound to the provided token.

", "version": "0.9.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "q", "description": "

Number of neighbours that affect the opinion of an agent

" } ] } }, "name": "qvoter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/QVoter', data={'token': token, 'q': number,'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/QVoter" } ] }, { "type": "put", "url": "/api/Sznajd", "title": "Sznajd", "description": "

Instantiate the Sznajd Model on the network bound to the provided token. The model is defined for complete graphs, however it can be applied to generic ones.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "sznajd", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Sznajd', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Sznajd" } ] }, { "type": "put", "url": "/api/Voter", "title": "Voter", "description": "

Instantiate the Voter Model on the network bound to the provided token.

", "version": "0.7.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "Number", "size": "0-1", "optional": false, "field": "infected", "description": "

The initial percentage of infected nodes.

" } ] } }, "name": "voter", "group": "Opinion_Dynamics", "examples": [ { "title": "[python request] Example usage:", "content": "put('http://localhost:5000/api/Voter', data={'token': token, 'infected': percentage})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Opinion_Dynamics", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Voter" } ] }, { "type": "delete", "url": "/api/Models", "title": "Models Destroy", "description": "

Delete model resources attached to the specified token. If no models are specified all the ones bind to the experiment will be destroyed.

", "version": "0.1.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "models", "description": "

String composed by comma separated model names.

" } ] } }, "name": "deletemodels", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Models', data={'token': token, 'models': 'model1,model2'})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "delete", "url": "/api/Networks", "title": "Network Destroy", "description": "

Delete the graph resource attached to the specified token

", "version": "0.4.0", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "token", "description": "

The token.

" } ] } }, "name": "destroynetwork", "group": "Resources", "examples": [ { "title": "[python request] Example usage:", "content": "delete('http://localhost:5000/api/Networks', data={'token': token})", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Networks", "title": "Real Networks Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.4.0", "name": "getgraphs", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Available networks", "content": "{'networks':\n [\n {\n 'name': 'Lastfm',\n 'size':\n {\n 'nodes': 70000,\n 'edges': 389639\n },\n 'description': 'Undirected social graph involving UK users of Last.fm'\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Networks')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Networks" } ] }, { "type": "get", "url": "/api/Models", "title": "Models Endpoints", "description": "

Return the available models endpoints and their parameter specification

", "version": "0.1.0", "name": "getmodellist", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of model endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endponts':\n [\n {\n 'name': 'Threshold',\n 'uri': 'http://localhost:5000/api/Models/Threshold',\n 'params':\n {\n 'token': 'access token',\n }\n },\n {\n 'name': 'SIR',\n 'uri': 'http://localhost:5000/api/Models/SIR',\n 'params':\n {\n 'token': 'access token',\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Models')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Models" } ] }, { "type": "get", "url": "/api/Generators", "title": "Network Generator Endpoints", "description": "

Return the available network endpoints and their parameters

", "version": "0.1.0", "name": "getnetworks", "group": "Resources", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Object", "optional": false, "field": "endpoints", "description": "

List of network endpoints.

" } ] }, "examples": [ { "title": "Response example: Endpoint List", "content": "{'endpoints':\n [\n {\n 'name': 'Erdos Reny',\n 'uri': 'http://localhost:5000/api/Networks/ERGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'p': 'rewiring probability'\n }\n },\n {\n 'name': 'Barabasi Albert',\n 'uri': 'http://localhost:5000/api/Networks/BarabasiAlbertGraph',\n 'params':\n {\n 'token': 'access token',\n 'n': 'number of nodes',\n 'm': 'Number of edges to attach from a new node to existing nodes'\n }\n }\n ]\n}", "type": "json" } ] }, "examples": [ { "title": "[python request] Example usage:", "content": "get('http://localhost:5000/api/Generators')", "type": "json" } ], "filename": "ndlib-rest/ndrest.py", "groupTitle": "Resources", "groupDescription": "

Endpoints belonging to this family provide access to resources, networks and models, listing and lookup facilities.
They also handle the destruction phase of experiment resources.

", "sampleRequest": [ { "url": "http://127.0.0.1:5000/api/Generators" } ] }, { "success": { "fields": { "Success 200": [ { "group": "Success 200", "optional": false, "field": "varname1", "description": "

No type.

" }, { "group": "Success 200", "type": "String", "optional": false, "field": "varname2", "description": "

With type.

" } ] } }, "type": "", "url": "", "version": "0.0.0", "filename": "ndlib-rest/static/docs/main.js", "group": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "groupTitle": "_Volumes_DATA_git_ndlib_rest_static_docs_main_js", "name": "" } ] diff --git a/static/docs/api_project.js b/static/docs/api_project.js index f2c6f5d..16c1b5d 100644 --- a/static/docs/api_project.js +++ b/static/docs/api_project.js @@ -1 +1 @@ -define({ "name": "(N)etwork (D)iffusion library REST service", "version": "2.0.1", "description": "REST service for the simulation of diffusion models over networks.", "title": "NDlib REST", "url": "http://127.0.0.1:5000", "sampleUrl": "http://127.0.0.1:5000", "order": [ "Experiment", "getexp", "describeexp", "resetexp", "deleteexp", "configure", "Exploratory", "listexploratory", "loadexploratory", "Resources", "getgraphs", "getnetworks", "getmodellist", "destroynetwork", "deletemodels", "Networks", "CompleteGraph", "ERGraph", "BAGraph", "CBAGraph", "WSGraph", "PlantedPartition", "loadgraph", "upload", "expgraphs", "Models", "si", "sir", "sis", "seis", "seir", "threshold", "KerteszThreshold", "profile", "profilethreshold", "indepcascades", "voter", "qvoter", "majority", "sznajd", "AlgorithmicBias", "dsi", "dsis", "dsis", "Iterators", "iterator", "iteratorbunch" ], "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2018-01-29T08:12:25.872Z", "url": "http://apidocjs.com", "version": "0.16.1" } }); +define({ "name": "(N)etwork (D)iffusion library REST service", "version": "2.0.1", "description": "REST service for the simulation of diffusion models over networks.", "title": "NDlib REST", "url": "http://127.0.0.1:5000", "sampleUrl": "http://127.0.0.1:5000", "order": [ "Experiment", "getexp", "describeexp", "resetexp", "deleteexp", "configure", "Exploratory", "listexploratory", "loadexploratory", "Resources", "getgraphs", "getnetworks", "getmodellist", "destroynetwork", "deletemodels", "Networks", "CompleteGraph", "ERGraph", "BAGraph", "CBAGraph", "WSGraph", "PlantedPartition", "loadgraph", "upload", "expgraphs", "Models", "si", "sir", "sis", "seis", "seir", "threshold", "KerteszThreshold", "profile", "profilethreshold", "indepcascades", "voter", "qvoter", "majority", "sznajd", "AlgorithmicBias", "dsi", "dsis", "dsis", "Iterators", "iterator", "iteratorbunch" ], "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2018-02-15T09:37:33.089Z", "url": "http://apidocjs.com", "version": "0.16.1" } }); diff --git a/static/docs/api_project.json b/static/docs/api_project.json index 4110aad..1a64bfa 100644 --- a/static/docs/api_project.json +++ b/static/docs/api_project.json @@ -1 +1 @@ -{ "name": "(N)etwork (D)iffusion library REST service", "version": "2.0.1", "description": "REST service for the simulation of diffusion models over networks.", "title": "NDlib REST", "url": "http://127.0.0.1:5000", "sampleUrl": "http://127.0.0.1:5000", "order": [ "Experiment", "getexp", "describeexp", "resetexp", "deleteexp", "configure", "Exploratory", "listexploratory", "loadexploratory", "Resources", "getgraphs", "getnetworks", "getmodellist", "destroynetwork", "deletemodels", "Networks", "CompleteGraph", "ERGraph", "BAGraph", "CBAGraph", "WSGraph", "PlantedPartition", "loadgraph", "upload", "expgraphs", "Models", "si", "sir", "sis", "seis", "seir", "threshold", "KerteszThreshold", "profile", "profilethreshold", "indepcascades", "voter", "qvoter", "majority", "sznajd", "AlgorithmicBias", "dsi", "dsis", "dsis", "Iterators", "iterator", "iteratorbunch" ], "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2018-01-29T08:12:25.872Z", "url": "http://apidocjs.com", "version": "0.16.1" } } +{ "name": "(N)etwork (D)iffusion library REST service", "version": "2.0.1", "description": "REST service for the simulation of diffusion models over networks.", "title": "NDlib REST", "url": "http://127.0.0.1:5000", "sampleUrl": "http://127.0.0.1:5000", "order": [ "Experiment", "getexp", "describeexp", "resetexp", "deleteexp", "configure", "Exploratory", "listexploratory", "loadexploratory", "Resources", "getgraphs", "getnetworks", "getmodellist", "destroynetwork", "deletemodels", "Networks", "CompleteGraph", "ERGraph", "BAGraph", "CBAGraph", "WSGraph", "PlantedPartition", "loadgraph", "upload", "expgraphs", "Models", "si", "sir", "sis", "seis", "seir", "threshold", "KerteszThreshold", "profile", "profilethreshold", "indepcascades", "voter", "qvoter", "majority", "sznajd", "AlgorithmicBias", "dsi", "dsis", "dsis", "Iterators", "iterator", "iteratorbunch" ], "apidoc": "0.2.0", "generator": { "name": "apidoc", "time": "2018-02-15T09:37:33.089Z", "url": "http://apidocjs.com", "version": "0.16.1" } }