Ajout des données JSON-LD acheteur et fix make_org_jsonld #66
This commit is contained in:
+1
-3
@@ -34,9 +34,7 @@ layout = [
|
|||||||
dcc.Store(id="marche_data"),
|
dcc.Store(id="marche_data"),
|
||||||
dcc.Store(id="titulaires_data"),
|
dcc.Store(id="titulaires_data"),
|
||||||
dcc.Location(id="marche_url", refresh="callback-nav"),
|
dcc.Location(id="marche_url", refresh="callback-nav"),
|
||||||
html.Script(
|
html.Script(type="application/ld+json", id="marche_jsonld"),
|
||||||
type="application/ld+json", id="marche_jsonld", children=['{"test": "1"}']
|
|
||||||
),
|
|
||||||
dbc.Container(
|
dbc.Container(
|
||||||
className="marche_infos",
|
className="marche_infos",
|
||||||
children=[
|
children=[
|
||||||
|
|||||||
+60
-2
@@ -18,8 +18,9 @@ from src.utils import (
|
|||||||
)
|
)
|
||||||
from utils import prepare_table_data
|
from utils import prepare_table_data
|
||||||
|
|
||||||
update_date = os.path.getmtime(os.getenv("DATA_FILE_PARQUET_PATH"))
|
update_date_timestamp = os.path.getmtime(os.getenv("DATA_FILE_PARQUET_PATH"))
|
||||||
update_date = datetime.fromtimestamp(update_date).strftime("%d/%m/%Y")
|
update_date = datetime.fromtimestamp(update_date_timestamp).strftime("%d/%m/%Y")
|
||||||
|
update_date_iso = datetime.fromtimestamp(update_date_timestamp).isoformat()
|
||||||
|
|
||||||
|
|
||||||
name = "Tableau"
|
name = "Tableau"
|
||||||
@@ -48,6 +49,63 @@ datatable = html.Div(
|
|||||||
|
|
||||||
layout = [
|
layout = [
|
||||||
dcc.Location(id="tableau_url", refresh=False),
|
dcc.Location(id="tableau_url", refresh=False),
|
||||||
|
html.Script(
|
||||||
|
type="application/ld+json",
|
||||||
|
id="dataset_jsonld",
|
||||||
|
children=[
|
||||||
|
json.dumps(
|
||||||
|
{
|
||||||
|
"@context": "https://schema.org/",
|
||||||
|
"@type": "Dataset",
|
||||||
|
"name": "Données essentielles des marchés publics français (DECP)",
|
||||||
|
"description": "Données de marchés publics exhaustives décrivant les marchés publics attribués en France depuis 2018.",
|
||||||
|
"url": "https://decp.info",
|
||||||
|
"sameAs": "https://www.data.gouv.fr/datasets/608c055b35eb4e6ee20eb325",
|
||||||
|
"keywords": [
|
||||||
|
"marchés publics",
|
||||||
|
"commande publique",
|
||||||
|
"decp",
|
||||||
|
"public procurement",
|
||||||
|
],
|
||||||
|
"license": "https://www.etalab.gouv.fr/licence-ouverte-open-licence",
|
||||||
|
"isAccessibleForFree": True,
|
||||||
|
"creator": {
|
||||||
|
"@type": "Organization",
|
||||||
|
"url": "https://colmo.tech",
|
||||||
|
"name": "Colmo",
|
||||||
|
"sameAs": "https://annuaire-entreprises.data.gouv.fr/entreprise/colmo-989393350",
|
||||||
|
"contactPoint": {
|
||||||
|
"@type": "ContactPoint",
|
||||||
|
"contactType": "Support et contact commercial",
|
||||||
|
"email": "colin@colmo.tech",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
"includedInDataCatalog": {
|
||||||
|
"@type": "DataCatalog",
|
||||||
|
"name": "data.gouv.fr",
|
||||||
|
},
|
||||||
|
"distribution": [
|
||||||
|
{
|
||||||
|
"@type": "DataDownload",
|
||||||
|
"encodingFormat": "CSV",
|
||||||
|
"contentUrl": "https://www.data.gouv.fr/api/1/datasets/r/22847056-61df-452d-837d-8b8ceadbfc52",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"@type": "DataDownload",
|
||||||
|
"encodingFormat": "Parquet",
|
||||||
|
"contentUrl": "https://www.data.gouv.fr/api/1/datasets/r/11cea8e8-df3e-4ed1-932b-781e2635e432",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"temporalCoverage": f"2018-01-01/{update_date_iso[:10]}",
|
||||||
|
"spatialCoverage": {
|
||||||
|
"@type": "Place",
|
||||||
|
"address": {"countryCode": "FR"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
indent=2,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
html.Div(
|
html.Div(
|
||||||
html.Details(
|
html.Details(
|
||||||
children=[
|
children=[
|
||||||
|
|||||||
+2
-1
@@ -727,7 +727,8 @@ def make_org_jsonld(org_id, org_type, org_name=None, type_org_id="SIRET") -> dic
|
|||||||
jsonld = {
|
jsonld = {
|
||||||
"@type": org_types[org_type],
|
"@type": org_types[org_type],
|
||||||
"name": org_name,
|
"name": org_name,
|
||||||
"url": f"https://decp.info/titulaires/{org_id}",
|
"url": f"https://decp.info/{org_type}s/{org_id}",
|
||||||
|
"sameAs": f"https://annuaire-entreprises.data.gouv.fr/etablissement/{org_id}",
|
||||||
"identifier": {
|
"identifier": {
|
||||||
"@type": "PropertyValue",
|
"@type": "PropertyValue",
|
||||||
"propertyID": type_org_id.lower(),
|
"propertyID": type_org_id.lower(),
|
||||||
|
|||||||
Reference in New Issue
Block a user