P2N web interface

Generalities

The patent2net web interface allows queries to be made directly from the web browser. It is available at the url http://localhost:5000/app

How it works

The web interface is developed with the react framework. The sources are available in the web_app directory To work, the application uses a web api.

Web API

GET /api/v1/requests

Retrieves the list of current requests

Example request:

http

GET /api/v1/requests HTTP/1.1
Host: localhost:5000

curl

curl -i -X GET http://localhost:5000/api/v1/requests

wget

wget -S -O- http://localhost:5000/api/v1/requests

httpie

http http://localhost:5000/api/v1/requests

python-requests

requests.get('http://localhost:5000/api/v1/requests')

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "code":200,
    "message":"",
    "data":{
        "done":[
            "lentille"
        ],
        "in_progress":[
            "machinelearning"
        ],
        "global_progress":{
            "machinelearning":{
                "done_step_count":8,
                "progress_step_count":2,
                "total_step_count":10
            }
        }
    }
}
Response Headers
Status Codes
POST /api/v1/requests

Allows you to create a new request

Example request:

http

POST /api/v1/requests HTTP/1.1
Host: localhost:5000
Content-Type: application/x-www-form-urlencoded

p2n_dir=lentille&p2n_req=TA=lentille&p2n_options=p2n_family,p2n_image,p2n_network,p2n_bibfile

curl

curl -i -X POST http://localhost:5000/api/v1/requests -H "Content-Type: application/x-www-form-urlencoded" --data-raw 'p2n_dir=lentille&p2n_req=TA=lentille&p2n_options=p2n_family,p2n_image,p2n_network,p2n_bibfile'

wget

wget -S -O- http://localhost:5000/api/v1/requests --header="Content-Type: application/x-www-form-urlencoded" --post-data='p2n_dir=lentille&p2n_req=TA=lentille&p2n_options=p2n_family,p2n_image,p2n_network,p2n_bibfile'

httpie

echo 'p2n_dir=lentille&p2n_req=TA=lentille&p2n_options=p2n_family,p2n_image,p2n_network,p2n_bibfile' | http POST http://localhost:5000/api/v1/requests Content-Type:"application/x-www-form-urlencoded"

python-requests

requests.post('http://localhost:5000/api/v1/requests', headers={'Content-Type': 'application/x-www-form-urlencoded'}, data='p2n_dir=lentille&p2n_req=TA=lentille&p2n_options=p2n_family,p2n_image,p2n_network,p2n_bibfile')

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "code": 200,
    "message": "Spliter start",
    "data": {
        "p2n_dir": "lentille"
    }
}
Query Parameters
  • p2n_dir (string) – name of the target directory

  • p2n_req (string) – cql request

  • p2n_options (string) – active treatment options

Response Headers
Status Codes
GET /api/v1/requests/(string: p2n_dir)

Is used to retrieve data from a request directory (p2n_dir)

Example request:

http

GET /api/v1/requests/lentille HTTP/1.1
Host: localhost:5000

curl

curl -i -X GET http://localhost:5000/api/v1/requests/lentille

wget

wget -S -O- http://localhost:5000/api/v1/requests/lentille

httpie

http http://localhost:5000/api/v1/requests/lentille

python-requests

requests.get('http://localhost:5000/api/v1/requests/lentille')

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "code": 200,
    "message": "",
    "data": {
        "done": true,
        "state": "P2N_RUN",
        "data": {
            "progress": {
                "p2n_gather_biblio": {
                    "value": "100.00",
                    "max_value": "100"
                },
                "p2n_family": {
                    "value": null,
                    "max_value": null
                },
                "...": {},
            }
        },
        "directory": "lentille",
        "cql": {
            "requete": "TA=lentille",
            "ndf": "lentille",
            "options": {
                "GatherContent": true,
                "GatherBiblio": true,
                "GatherPatent": true,
                "GatherFamilly": true
            }
        }
    }
}
Response Headers
Status Codes
POST /api/v1/requests/(string: p2n_dir)/split

Allows you to start trimming a query that exceeds the limit of 2000 patents in a certain year. The splitting will not start if the patents count is not finished

Example request:

http

POST /api/v1/requests/autom/split HTTP/1.1
Host: localhost:5000
Content-Type: application/x-www-form-urlencoded

date=2020

curl

curl -i -X POST http://localhost:5000/api/v1/requests/autom/split -H "Content-Type: application/x-www-form-urlencoded" --data-raw 'date=2020'

wget

wget -S -O- http://localhost:5000/api/v1/requests/autom/split --header="Content-Type: application/x-www-form-urlencoded" --post-data='date=2020'

httpie

echo date=2020 | http POST http://localhost:5000/api/v1/requests/autom/split Content-Type:"application/x-www-form-urlencoded"

python-requests

requests.post('http://localhost:5000/api/v1/requests/autom/split', headers={'Content-Type': 'application/x-www-form-urlencoded'}, data='date=2020')

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "code": 200,
    "message": "Spliter running",
    "data": {}
}
Query Parameters
  • date (int) – Start date of the splitting process

Response Headers
Status Codes
POST /api/v1/requests/(string: p2n_dir)/interface

Allows to rebuild the interface of a data directory (p2n_dir)

Example request:

http

POST /api/v1/requests/lentille/interface HTTP/1.1
Host: localhost:5000

curl

curl -i -X POST http://localhost:5000/api/v1/requests/lentille/interface

wget

wget -S -O- http://localhost:5000/api/v1/requests/lentille/interface

httpie

http POST http://localhost:5000/api/v1/requests/lentille/interface

python-requests

requests.post('http://localhost:5000/api/v1/requests/lentille/interface')

Example response:

HTTP/1.1 200 OK
Content-Type: application/json

{
    "code": 200,
    "message": "OK",
    "data": {
        "directory": "lentille"
    }
}
Response Headers
Status Codes

Event systeme