Edge Functions serving as middleware for the Case-Explorer application. These functions handle communication between the front-end and various data sources, providing a secure and efficient way to process requests for legal case citations and network analysis.
Fetches nodes (cases) and edges (citations) based on search criteria.
dataSources: Array of data sources (e.g. ["RS"] for
Rechtspraak)
docTypes: Array of document types (e.g. ["DEC"] for
Decisions)
engine: Search engine to use ("ES" or "OS")dateStart: Start date in YYYY-MM-DD format, default:
1900-01-01
dateEnd: End date in YYYY-MM-DD format, default:
2024-01-01
articles: Legal articles to search fordegreesSource: Number of source citation degrees
(default: 1)
degreesTarget: Number of target citation degrees
(default: 1)
domains: Array of legal domainseclis: Array of ECLI identifiersinstances: Array of court instanceskeywords: Search keywordsattributesToFetch: Data fields to return ("ALL" or
specific attributes)
{
"arguments": {
"engine": "OS",
"eclis": ["ECLI:NL:RVS:2010:BO0794"],
"dataSources": ["RS"],
"degreesSource": 0,
"degreesTarget": 0,
"attributesToFetch": "ALL"
}
}
{
"arguments": {
"engine": "OS",
"keywords": "wraking",
"dataSources": ["RS"],
"dateStart": "2020-01-01",
"dateEnd": "2023-12-31",
"degreesSource": 1,
"degreesTarget": 1,
"docTypes": ["DEC"],
"domains": ["STR"],
"instances": ["Rechtbank Gelderland"],
"attributesToFetch": "ALL"
}
}
{
"nodes": [
{
"id": "ECLI:NL:...",
"data": {
"summary": "Case summary",
"instance": "Court name",
"url_publication": "http://...",
"domains": ["Legal domain"],
"source": "Rechtspraak",
"date_decision": "2020-05-19",
"document_type": "Uitspraak",
"procedure_type": "Eerste aanleg",
"jurisdiction_country": "NL",
"legal_provisions": ["Artikel 6"],
"isResult": "True"
}
}
],
"edges": [
{
"source": "ECLI:NL:...",
"target": "ECLI:NL:..."
}
],
"message": "Query limit reached! Only partial result displayed."
}
Calculates network statistics for a given set of nodes and edges.
{
"nodes": [
{
"id": "ECLI:NL:...",
"data": {}
}
],
"edges": [
{
"id": "source_target",
"source": "ECLI:NL:...",
"target": "ECLI:NL:..."
}
]
}
{
"ECLI:NL:...": {
"parent": "ECLI:NL:...",
"degree": 5,
"in-degree": 2,
"out-degree": 3,
"degree centrality": 0.125,
"in-degree centrality": 0.05,
"out-degree centrality": 0.075,
"relative in-degree": 0.4,
"pageRank": 0.0234,
"betweenness centrality": 0.0156,
"closeness centrality": 0.3456,
"community": 1,
"year": 2020
}
}
pip install -r requirements.txt
pip install -r requirements-dev.txt
npm install
DYNAMODB_ENDPOINT_URL: DynamoDB endpoint URLDDB_TABLE_NAME: DynamoDB table nameOS_ENDPOINT: OpenSearch endpointOS_INDEX_NAME: OpenSearch index nameAPI_URL: API endpoint URLACCESS_KEY_ID: AWS access keySECRET_ACCESS_KEY: AWS secret keyRun the test suite:
pytest
Deploy to Vercel:
vercel deploy
The project uses: