Преглед изворни кода

Expand endpoint description

Arkadiusz Ryś пре 2 година
родитељ
комит
6bd0e3206f
1 измењених фајлова са 12 додато и 6 уклоњено
  1. 12 6
      spendpoint/main.py

+ 12 - 6
spendpoint/main.py

@@ -5,13 +5,19 @@ from spendpoint.service import outlier_service, example_service, conversion_serv
 
 arklog.set_config_logging()
 
+functions = {
+    "https://ontology.rys.app/dt/function/outlier": outlier_service,
+    "https://ontology.rys.app/dt/function/example": example_service,
+    "https://ontology.rys.app/dt/function/conversion": conversion_service,
+}
+
 app = SparqlEndpoint(
     version = __version__,
-    functions = {
-        "https://ontology.rys.app/dt/function/outlier": outlier_service,
-        "https://ontology.rys.app/dt/function/example": example_service,
-        "https://ontology.rys.app/dt/function/conversion": conversion_service,
-    },
+    functions = functions,
     title = "SPARQL endpoint for storage and services",
-    description = "/n".join(("SPARQL endpoint.",))
+    description = "\n".join((
+        "SPARQL endpoint.",
+        f"Supports {len(functions)} custom services:",
+        *(f" - {service_uri}" for service_uri, fc in functions.items()))
+    )
 )