From 83198bd7ee1c1b1a85b465605933311cea4dacba Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 12:41:29 -0400 Subject: [PATCH 1/8] feat: enhance standard variable API with CKAN support and query improvements --- .../apis/standard_variable_api.py | 100 ++++++++++++------ 1 file changed, 70 insertions(+), 30 deletions(-) diff --git a/src/openapi_server/apis/standard_variable_api.py b/src/openapi_server/apis/standard_variable_api.py index c80938a..5f1c562 100644 --- a/src/openapi_server/apis/standard_variable_api.py +++ b/src/openapi_server/apis/standard_variable_api.py @@ -17,7 +17,9 @@ status, ) +from openapi_server.models.ckan_response import CKANItem, CKANResponse from openapi_server.models.extra_models import TokenModel # noqa: F401 +from openapi_server.settings import ENDPOINT_GRAPH_BASE from openapi_server.utils.vars import STANDARDVARIABLE_TYPE_NAME, STANDARDVARIABLE_TYPE_URI from openapi_server.connector import query_manager from fastapi_cache.decorator import cache @@ -37,24 +39,62 @@ summary="List all instances of StandardVariable", response_model_by_alias=True, ) -@cache(namespace="StandardVariable", expire=1800) +#@cache(namespace="StandardVariable", expire=1800) async def standardvariables_get( username: str = Query(None, description="Name of the user graph to query"), label: str = Query(None, description="Filter by label"), page: int = Query(1, description="Page number"), per_page: int = Query(100, description="Items per page", ge=1, le=200), -) -> List[StandardVariable]: + enable_ckan: bool = Query(False, description="Enable CKAN output"), +) -> List[StandardVariable] | CKANResponse: """Gets a list of all instances of StandardVariable (more information in https://w3id.org/okn/o/sd#StandardVariable)""" - - return query_manager.get_resource( - - username=username,label=label,page=page,per_page=per_page, - - rdf_type_uri=STANDARDVARIABLE_TYPE_URI, - rdf_type_name=STANDARDVARIABLE_TYPE_NAME, - kls=StandardVariable - ) - + + query_template = """ + CONSTRUCT { + ?item ?predicate ?prop . + ?prop a ?type + } + WHERE { + GRAPH ?_g_iri { + { + SELECT DISTINCT ?item where { + ?item a ?_type_iri . + ?item ?label . + FILTER(CONTAINS(LCASE(?label), LCASE(?_label))) + } + LIMIT 100 + OFFSET 0 + } + ?item ?predicate ?prop + OPTIONAL { + ?prop a ?type + } + FILTER (!isBlank(?prop)) + FILTER NOT EXISTS { ?item ?prop } + } + } + """ + request_args = { + 'page': page, + 'per_page': per_page, + 'type': STANDARDVARIABLE_TYPE_URI, + 'g': ENDPOINT_GRAPH_BASE + username, + 'offset': (page - 1) * per_page, + 'label': label + } + + sparql_response = query_manager.dispatch_sparql_query( + query_template, request_args) + variables = query_manager.frame_results(sparql_response, STANDARDVARIABLE_TYPE_URI) + + if enable_ckan: + if len(variables) > 0: + return CKANResponse(ResultSet=[CKANItem(Name=variable['label'][0]) for variable in variables]) + else: + return CKANResponse(ResultSet=[]) + else: + return variables + @router.delete( @@ -68,24 +108,24 @@ async def standardvariables_get( response_model_by_alias=True, ) async def standardvariables_id_delete( - id: str = Path(None, description="The ID of the StandardVariable to be retrieved"), + id: str = Path( description="The ID of the StandardVariable to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing StandardVariable (more information in https://w3id.org/okn/o/sd#StandardVariable)""" - + await FastAPICache.clear(namespace="StandardVariable") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=STANDARDVARIABLE_TYPE_URI, - rdf_type_name=STANDARDVARIABLE_TYPE_NAME, + rdf_type_name=STANDARDVARIABLE_TYPE_NAME, kls=StandardVariable ) - + @router.get( @@ -99,20 +139,20 @@ async def standardvariables_id_delete( ) @cache(namespace="StandardVariable", expire=1800) async def standardvariables_id_get( - id: str = Path(None, description="The ID of the StandardVariable to be retrieved"), + id: str = Path( description="The ID of the StandardVariable to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> StandardVariable: """Gets the details of a given StandardVariable (more information in https://w3id.org/okn/o/sd#StandardVariable)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=STANDARDVARIABLE_TYPE_URI, - rdf_type_name=STANDARDVARIABLE_TYPE_NAME, + rdf_type_name=STANDARDVARIABLE_TYPE_NAME, kls=StandardVariable ) - + @router.put( @@ -126,7 +166,7 @@ async def standardvariables_id_get( response_model_by_alias=True, ) async def standardvariables_id_put( - id: str = Path(None, description="The ID of the StandardVariable to be retrieved"), + id: str = Path( description="The ID of the StandardVariable to be retrieved"), user: str = Query(None, description="Username"), standard_variable: StandardVariable = Body(None, description="An old StandardVariableto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +174,17 @@ async def standardvariables_id_put( ), ) -> StandardVariable: """Updates an existing StandardVariable (more information in https://w3id.org/okn/o/sd#StandardVariable)""" - + await FastAPICache.clear(namespace="StandardVariable") return query_manager.put_resource( id=id, user=user, body=standard_variable, rdf_type_uri=STANDARDVARIABLE_TYPE_URI, - rdf_type_name=STANDARDVARIABLE_TYPE_NAME, + rdf_type_name=STANDARDVARIABLE_TYPE_NAME, kls=StandardVariable ) - + @router.post( @@ -164,14 +204,14 @@ async def standardvariables_post( ), ) -> StandardVariable: """Create a new instance of StandardVariable (more information in https://w3id.org/okn/o/sd#StandardVariable)""" - + await FastAPICache.clear(namespace="StandardVariable") return query_manager.post_resource( - + user=user, body=standard_variable, rdf_type_uri=STANDARDVARIABLE_TYPE_URI, - rdf_type_name=STANDARDVARIABLE_TYPE_NAME, + rdf_type_name=STANDARDVARIABLE_TYPE_NAME, kls=StandardVariable ) - + From 71d88130f3766b2da67284547bb0fcbd5ce125ae Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 12:41:38 -0400 Subject: [PATCH 2/8] chore: update dependencies in requirements.txt for improved compatibility and new features --- requirements.txt | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/requirements.txt b/requirements.txt index 657efd3..ee25a02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,7 @@ aiofiles==22.1.0 aioredis==2.0.1 aniso8601==9.0.1 +anyio==3.7.1 async-exit-stack==1.0.1 async-generator==1.10 async-timeout==4.0.2 @@ -8,29 +9,35 @@ autopep8==1.7.0 cachetools==5.2.0 certifi==2022.9.24 chardet==5.0.0 -click==8.1.3 +charset-normalizer==2.1.1 +click==8.1.8 decorator==5.1.1 Deprecated==1.2.13 dnspython==2.2.1 -email-validator==1.3.0 -fastapi==0.85.1 +email_validator==2.2.0 +fastapi==0.115.12 fastapi-cache2==0.1.9 +fastapi-cli==0.0.7 flake8==5.0.4 frozendict==2.3.4 graphene==3.1.1 graphql-core==3.2.3 graphql-relay==3.2.0 h11==0.14.0 +httpcore==1.0.7 httptools==0.5.0 +httpx==0.28.1 idna==3.4 isodate==0.6.1 itsdangerous==2.1.2 -Jinja2==3.1.2 +Jinja2==3.1.6 lxml==4.9.1 +markdown-it-py==3.0.0 MarkupSafe==2.1.1 mccabe==0.7.0 -orjson==3.8.0 +mdurl==0.1.2 obasparql==5.0.2 +orjson==3.8.0 pendulum==2.1.2 ply==3.11 promise==2.3 @@ -38,28 +45,35 @@ pyaml==21.10.1 pycodestyle==2.9.1 pydantic==1.10.2 pyflakes==2.5.0 +Pygments==2.19.1 PyLD==2.0.3 pyparsing==3.0.9 python-dateutil==2.8.2 python-dotenv==0.21.0 -python-multipart==0.0.5 +python-multipart==0.0.20 pythonql3==0.9.83 pytzdata==2020.1 PyYAML==6.0 rdflib==6.2.0 redis==4.4.0rc2 requests==2.28.1 +rich==14.0.0 +rich-toolkit==0.14.1 Rx==3.2.0 +shellingham==1.5.4 simplejson==3.17.6 six==1.16.0 -starlette==0.20.4 +sniffio==1.3.1 +starlette==0.46.1 toml==0.10.2 -typing-extensions==4.4.0 +typer==0.15.2 +typing_extensions==4.13.2 ujson==5.5.0 urllib3==1.26.12 uvicorn==0.19.0 uvloop==0.17.0 validators==0.20.0 +watchfiles==1.0.5 watchgod==0.8.2 webencodings==0.5.1 websockets==10.3 From 9777eeac0eb86952b14c618f1ce3f165ce1711e8 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 12:42:05 -0400 Subject: [PATCH 3/8] chore: update .gitignore to exclude env.sh, contexts, and queries directories --- .gitignore | 3 + .../apis/catalog_identifier_api.py | 46 ++++----- src/openapi_server/apis/causal_diagram_api.py | 46 ++++----- .../apis/configuration_setup_api.py | 56 +++++------ src/openapi_server/apis/constraint_api.py | 46 ++++----- src/openapi_server/apis/coupled_model_api.py | 46 ++++----- .../apis/data_transformation_api.py | 56 +++++------ .../apis/data_transformation_setup_api.py | 46 ++++----- .../apis/dataset_specification_api.py | 66 ++++++------- .../apis/empirical_model_api.py | 46 ++++----- src/openapi_server/apis/emulator_api.py | 46 ++++----- src/openapi_server/apis/equation_api.py | 46 ++++----- .../apis/funding_information_api.py | 46 ++++----- .../apis/geo_coordinates_api.py | 46 ++++----- src/openapi_server/apis/geo_shape_api.py | 46 ++++----- src/openapi_server/apis/grid_api.py | 46 ++++----- src/openapi_server/apis/hybrid_model_api.py | 46 ++++----- src/openapi_server/apis/image_api.py | 46 ++++----- src/openapi_server/apis/intervention_api.py | 46 ++++----- src/openapi_server/apis/model_api.py | 96 +++++++++---------- src/openapi_server/apis/model_category_api.py | 46 ++++----- .../apis/model_configuration_api.py | 56 +++++------ .../apis/model_configuration_setup_api.py | 66 ++++++------- .../apis/numerical_index_api.py | 46 ++++----- src/openapi_server/apis/organization_api.py | 46 ++++----- src/openapi_server/apis/parameter_api.py | 46 ++++----- src/openapi_server/apis/person_api.py | 46 ++++----- .../apis/point_based_grid_api.py | 46 ++++----- src/openapi_server/apis/process_api.py | 46 ++++----- src/openapi_server/apis/region_api.py | 46 ++++----- .../apis/sample_collection_api.py | 46 ++++----- .../apis/sample_execution_api.py | 46 ++++----- .../apis/sample_resource_api.py | 46 ++++----- src/openapi_server/apis/software_api.py | 46 ++++----- .../apis/software_configuration_api.py | 46 ++++----- src/openapi_server/apis/software_image_api.py | 46 ++++----- .../apis/software_version_api.py | 46 ++++----- src/openapi_server/apis/source_code_api.py | 46 ++++----- .../apis/spatial_resolution_api.py | 46 ++++----- .../apis/spatially_distributed_grid_api.py | 46 ++++----- .../apis/theory_guided_model_api.py | 46 ++++----- src/openapi_server/apis/time_interval_api.py | 46 ++++----- src/openapi_server/apis/unit_api.py | 46 ++++----- src/openapi_server/apis/variable_api.py | 46 ++++----- .../apis/variable_presentation_api.py | 46 ++++----- src/openapi_server/apis/visualization_api.py | 46 ++++----- src/openapi_server/models/ckan_response.py | 7 ++ 47 files changed, 1105 insertions(+), 1095 deletions(-) create mode 100644 src/openapi_server/models/ckan_response.py diff --git a/.gitignore b/.gitignore index a81c8ee..8163842 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,7 @@ # Byte-compiled / optimized / DLL files +env.sh +src/contexts +src/queries __pycache__/ *.py[cod] *$py.class diff --git a/src/openapi_server/apis/catalog_identifier_api.py b/src/openapi_server/apis/catalog_identifier_api.py index 1b60df1..95571e0 100644 --- a/src/openapi_server/apis/catalog_identifier_api.py +++ b/src/openapi_server/apis/catalog_identifier_api.py @@ -45,16 +45,16 @@ async def catalogidentifiers_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[CatalogIdentifier]: """Gets a list of all instances of CatalogIdentifier (more information in https://w3id.org/okn/o/sd#CatalogIdentifier)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=CATALOGIDENTIFIER_TYPE_URI, - rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, + rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, kls=CatalogIdentifier ) - + @router.delete( @@ -68,24 +68,24 @@ async def catalogidentifiers_get( response_model_by_alias=True, ) async def catalogidentifiers_id_delete( - id: str = Path(None, description="The ID of the CatalogIdentifier to be retrieved"), + id: str = Path(description="The ID of the CatalogIdentifier to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing CatalogIdentifier (more information in https://w3id.org/okn/o/sd#CatalogIdentifier)""" - + await FastAPICache.clear(namespace="CatalogIdentifier") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=CATALOGIDENTIFIER_TYPE_URI, - rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, + rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, kls=CatalogIdentifier ) - + @router.get( @@ -99,20 +99,20 @@ async def catalogidentifiers_id_delete( ) @cache(namespace="CatalogIdentifier", expire=1800) async def catalogidentifiers_id_get( - id: str = Path(None, description="The ID of the CatalogIdentifier to be retrieved"), + id: str = Path( description="The ID of the CatalogIdentifier to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> CatalogIdentifier: """Gets the details of a given CatalogIdentifier (more information in https://w3id.org/okn/o/sd#CatalogIdentifier)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=CATALOGIDENTIFIER_TYPE_URI, - rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, + rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, kls=CatalogIdentifier ) - + @router.put( @@ -126,7 +126,7 @@ async def catalogidentifiers_id_get( response_model_by_alias=True, ) async def catalogidentifiers_id_put( - id: str = Path(None, description="The ID of the CatalogIdentifier to be retrieved"), + id: str = Path( description="The ID of the CatalogIdentifier to be retrieved"), user: str = Query(None, description="Username"), catalog_identifier: CatalogIdentifier = Body(None, description="An old CatalogIdentifierto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def catalogidentifiers_id_put( ), ) -> CatalogIdentifier: """Updates an existing CatalogIdentifier (more information in https://w3id.org/okn/o/sd#CatalogIdentifier)""" - + await FastAPICache.clear(namespace="CatalogIdentifier") return query_manager.put_resource( id=id, user=user, body=catalog_identifier, rdf_type_uri=CATALOGIDENTIFIER_TYPE_URI, - rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, + rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, kls=CatalogIdentifier ) - + @router.post( @@ -164,14 +164,14 @@ async def catalogidentifiers_post( ), ) -> CatalogIdentifier: """Create a new instance of CatalogIdentifier (more information in https://w3id.org/okn/o/sd#CatalogIdentifier)""" - + await FastAPICache.clear(namespace="CatalogIdentifier") return query_manager.post_resource( - + user=user, body=catalog_identifier, rdf_type_uri=CATALOGIDENTIFIER_TYPE_URI, - rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, + rdf_type_name=CATALOGIDENTIFIER_TYPE_NAME, kls=CatalogIdentifier ) - + diff --git a/src/openapi_server/apis/causal_diagram_api.py b/src/openapi_server/apis/causal_diagram_api.py index 0dbe456..91a6da6 100644 --- a/src/openapi_server/apis/causal_diagram_api.py +++ b/src/openapi_server/apis/causal_diagram_api.py @@ -45,16 +45,16 @@ async def causaldiagrams_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[CausalDiagram]: """Gets a list of all instances of CausalDiagram (more information in https://w3id.org/okn/o/sdm#CausalDiagram)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=CAUSALDIAGRAM_TYPE_URI, - rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, + rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, kls=CausalDiagram ) - + @router.delete( @@ -68,24 +68,24 @@ async def causaldiagrams_get( response_model_by_alias=True, ) async def causaldiagrams_id_delete( - id: str = Path(None, description="The ID of the CausalDiagram to be retrieved"), + id: str = Path( description="The ID of the CausalDiagram to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing CausalDiagram (more information in https://w3id.org/okn/o/sdm#CausalDiagram)""" - + await FastAPICache.clear(namespace="CausalDiagram") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=CAUSALDIAGRAM_TYPE_URI, - rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, + rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, kls=CausalDiagram ) - + @router.get( @@ -99,20 +99,20 @@ async def causaldiagrams_id_delete( ) @cache(namespace="CausalDiagram", expire=1800) async def causaldiagrams_id_get( - id: str = Path(None, description="The ID of the CausalDiagram to be retrieved"), + id: str = Path( description="The ID of the CausalDiagram to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> CausalDiagram: """Gets the details of a given CausalDiagram (more information in https://w3id.org/okn/o/sdm#CausalDiagram)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=CAUSALDIAGRAM_TYPE_URI, - rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, + rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, kls=CausalDiagram ) - + @router.put( @@ -126,7 +126,7 @@ async def causaldiagrams_id_get( response_model_by_alias=True, ) async def causaldiagrams_id_put( - id: str = Path(None, description="The ID of the CausalDiagram to be retrieved"), + id: str = Path( description="The ID of the CausalDiagram to be retrieved"), user: str = Query(None, description="Username"), causal_diagram: CausalDiagram = Body(None, description="An old CausalDiagramto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def causaldiagrams_id_put( ), ) -> CausalDiagram: """Updates an existing CausalDiagram (more information in https://w3id.org/okn/o/sdm#CausalDiagram)""" - + await FastAPICache.clear(namespace="CausalDiagram") return query_manager.put_resource( id=id, user=user, body=causal_diagram, rdf_type_uri=CAUSALDIAGRAM_TYPE_URI, - rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, + rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, kls=CausalDiagram ) - + @router.post( @@ -164,14 +164,14 @@ async def causaldiagrams_post( ), ) -> CausalDiagram: """Create a new instance of CausalDiagram (more information in https://w3id.org/okn/o/sdm#CausalDiagram)""" - + await FastAPICache.clear(namespace="CausalDiagram") return query_manager.post_resource( - + user=user, body=causal_diagram, rdf_type_uri=CAUSALDIAGRAM_TYPE_URI, - rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, + rdf_type_name=CAUSALDIAGRAM_TYPE_NAME, kls=CausalDiagram ) - + diff --git a/src/openapi_server/apis/configuration_setup_api.py b/src/openapi_server/apis/configuration_setup_api.py index 9ceb2b5..b5bec51 100644 --- a/src/openapi_server/apis/configuration_setup_api.py +++ b/src/openapi_server/apis/configuration_setup_api.py @@ -46,16 +46,16 @@ async def configurationsetups_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[ConfigurationSetup]: """Gets a list of all instances of ConfigurationSetup (more information in https://w3id.org/okn/o/sd#ConfigurationSetup)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=CONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, kls=ConfigurationSetup ) - + @router.delete( @@ -69,24 +69,24 @@ async def configurationsetups_get( response_model_by_alias=True, ) async def configurationsetups_id_delete( - id: str = Path(None, description="The ID of the ConfigurationSetup to be retrieved"), + id: str = Path( description="The ID of the ConfigurationSetup to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing ConfigurationSetup (more information in https://w3id.org/okn/o/sd#ConfigurationSetup)""" - + await FastAPICache.clear(namespace="ConfigurationSetup") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=CONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, kls=ConfigurationSetup ) - + @router.get( @@ -100,20 +100,20 @@ async def configurationsetups_id_delete( ) @cache(namespace="ConfigurationSetup", expire=1800) async def configurationsetups_id_get( - id: str = Path(None, description="The ID of the ConfigurationSetup to be retrieved"), + id: str = Path( description="The ID of the ConfigurationSetup to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> ConfigurationSetup: """Gets the details of a given ConfigurationSetup (more information in https://w3id.org/okn/o/sd#ConfigurationSetup)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=CONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, kls=ConfigurationSetup ) - + @router.put( @@ -127,7 +127,7 @@ async def configurationsetups_id_get( response_model_by_alias=True, ) async def configurationsetups_id_put( - id: str = Path(None, description="The ID of the ConfigurationSetup to be retrieved"), + id: str = Path( description="The ID of the ConfigurationSetup to be retrieved"), user: str = Query(None, description="Username"), configuration_setup: ConfigurationSetup = Body(None, description="An old ConfigurationSetupto be updated"), token_BearerAuth: TokenModel = Security( @@ -135,17 +135,17 @@ async def configurationsetups_id_put( ), ) -> ConfigurationSetup: """Updates an existing ConfigurationSetup (more information in https://w3id.org/okn/o/sd#ConfigurationSetup)""" - + await FastAPICache.clear(namespace="ConfigurationSetup") return query_manager.put_resource( id=id, user=user, body=configuration_setup, rdf_type_uri=CONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, kls=ConfigurationSetup ) - + @router.post( @@ -165,17 +165,17 @@ async def configurationsetups_post( ), ) -> ConfigurationSetup: """Create a new instance of ConfigurationSetup (more information in https://w3id.org/okn/o/sd#ConfigurationSetup)""" - + await FastAPICache.clear(namespace="ConfigurationSetup") return query_manager.post_resource( - + user=user, body=configuration_setup, rdf_type_uri=CONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, kls=ConfigurationSetup ) - + @router.get( @@ -189,18 +189,18 @@ async def configurationsetups_post( ) @cache(namespace="ConfigurationSetup", expire=1800) async def custom_configurationsetups_id_get( - id: str = Path(None, description="The ID of the resource"), + id: str = Path( description="The ID of the resource"), username: str = Query(None, description="Username to query"), custom_query_name: str = Query("custom_configurationsetups", description="Name of the custom query"), ) -> ModelConfigurationSetup: """Gets the details of a single instance of a ModelConfigurationSetup""" - + return query_manager.get_resource( id=id, username=username,custom_query_name=custom_query_name, - + rdf_type_uri=CONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=CONFIGURATIONSETUP_TYPE_NAME, kls=ConfigurationSetup ) - + diff --git a/src/openapi_server/apis/constraint_api.py b/src/openapi_server/apis/constraint_api.py index 6abf439..ed57112 100644 --- a/src/openapi_server/apis/constraint_api.py +++ b/src/openapi_server/apis/constraint_api.py @@ -45,16 +45,16 @@ async def constraints_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Constraint]: """Gets a list of all instances of Constraint (more information in https://w3id.org/okn/o/sd#Constraint)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=CONSTRAINT_TYPE_URI, - rdf_type_name=CONSTRAINT_TYPE_NAME, + rdf_type_name=CONSTRAINT_TYPE_NAME, kls=Constraint ) - + @router.delete( @@ -68,24 +68,24 @@ async def constraints_get( response_model_by_alias=True, ) async def constraints_id_delete( - id: str = Path(None, description="The ID of the Constraint to be retrieved"), + id: str = Path( description="The ID of the Constraint to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Constraint (more information in https://w3id.org/okn/o/sd#Constraint)""" - + await FastAPICache.clear(namespace="Constraint") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=CONSTRAINT_TYPE_URI, - rdf_type_name=CONSTRAINT_TYPE_NAME, + rdf_type_name=CONSTRAINT_TYPE_NAME, kls=Constraint ) - + @router.get( @@ -99,20 +99,20 @@ async def constraints_id_delete( ) @cache(namespace="Constraint", expire=1800) async def constraints_id_get( - id: str = Path(None, description="The ID of the Constraint to be retrieved"), + id: str = Path( description="The ID of the Constraint to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Constraint: """Gets the details of a given Constraint (more information in https://w3id.org/okn/o/sd#Constraint)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=CONSTRAINT_TYPE_URI, - rdf_type_name=CONSTRAINT_TYPE_NAME, + rdf_type_name=CONSTRAINT_TYPE_NAME, kls=Constraint ) - + @router.put( @@ -126,7 +126,7 @@ async def constraints_id_get( response_model_by_alias=True, ) async def constraints_id_put( - id: str = Path(None, description="The ID of the Constraint to be retrieved"), + id: str = Path( description="The ID of the Constraint to be retrieved"), user: str = Query(None, description="Username"), constraint: Constraint = Body(None, description="An old Constraintto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def constraints_id_put( ), ) -> Constraint: """Updates an existing Constraint (more information in https://w3id.org/okn/o/sd#Constraint)""" - + await FastAPICache.clear(namespace="Constraint") return query_manager.put_resource( id=id, user=user, body=constraint, rdf_type_uri=CONSTRAINT_TYPE_URI, - rdf_type_name=CONSTRAINT_TYPE_NAME, + rdf_type_name=CONSTRAINT_TYPE_NAME, kls=Constraint ) - + @router.post( @@ -164,14 +164,14 @@ async def constraints_post( ), ) -> Constraint: """Create a new instance of Constraint (more information in https://w3id.org/okn/o/sd#Constraint)""" - + await FastAPICache.clear(namespace="Constraint") return query_manager.post_resource( - + user=user, body=constraint, rdf_type_uri=CONSTRAINT_TYPE_URI, - rdf_type_name=CONSTRAINT_TYPE_NAME, + rdf_type_name=CONSTRAINT_TYPE_NAME, kls=Constraint ) - + diff --git a/src/openapi_server/apis/coupled_model_api.py b/src/openapi_server/apis/coupled_model_api.py index 3183e59..d5ef10e 100644 --- a/src/openapi_server/apis/coupled_model_api.py +++ b/src/openapi_server/apis/coupled_model_api.py @@ -45,16 +45,16 @@ async def coupledmodels_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[CoupledModel]: """Gets a list of all instances of CoupledModel (more information in https://w3id.org/okn/o/sdm#CoupledModel)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=COUPLEDMODEL_TYPE_URI, - rdf_type_name=COUPLEDMODEL_TYPE_NAME, + rdf_type_name=COUPLEDMODEL_TYPE_NAME, kls=CoupledModel ) - + @router.delete( @@ -68,24 +68,24 @@ async def coupledmodels_get( response_model_by_alias=True, ) async def coupledmodels_id_delete( - id: str = Path(None, description="The ID of the CoupledModel to be retrieved"), + id: str = Path( description="The ID of the CoupledModel to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing CoupledModel (more information in https://w3id.org/okn/o/sdm#CoupledModel)""" - + await FastAPICache.clear(namespace="CoupledModel") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=COUPLEDMODEL_TYPE_URI, - rdf_type_name=COUPLEDMODEL_TYPE_NAME, + rdf_type_name=COUPLEDMODEL_TYPE_NAME, kls=CoupledModel ) - + @router.get( @@ -99,20 +99,20 @@ async def coupledmodels_id_delete( ) @cache(namespace="CoupledModel", expire=1800) async def coupledmodels_id_get( - id: str = Path(None, description="The ID of the CoupledModel to be retrieved"), + id: str = Path( description="The ID of the CoupledModel to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> CoupledModel: """Gets the details of a given CoupledModel (more information in https://w3id.org/okn/o/sdm#CoupledModel)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=COUPLEDMODEL_TYPE_URI, - rdf_type_name=COUPLEDMODEL_TYPE_NAME, + rdf_type_name=COUPLEDMODEL_TYPE_NAME, kls=CoupledModel ) - + @router.put( @@ -126,7 +126,7 @@ async def coupledmodels_id_get( response_model_by_alias=True, ) async def coupledmodels_id_put( - id: str = Path(None, description="The ID of the CoupledModel to be retrieved"), + id: str = Path( description="The ID of the CoupledModel to be retrieved"), user: str = Query(None, description="Username"), coupled_model: CoupledModel = Body(None, description="An old CoupledModelto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def coupledmodels_id_put( ), ) -> CoupledModel: """Updates an existing CoupledModel (more information in https://w3id.org/okn/o/sdm#CoupledModel)""" - + await FastAPICache.clear(namespace="CoupledModel") return query_manager.put_resource( id=id, user=user, body=coupled_model, rdf_type_uri=COUPLEDMODEL_TYPE_URI, - rdf_type_name=COUPLEDMODEL_TYPE_NAME, + rdf_type_name=COUPLEDMODEL_TYPE_NAME, kls=CoupledModel ) - + @router.post( @@ -164,14 +164,14 @@ async def coupledmodels_post( ), ) -> CoupledModel: """Create a new instance of CoupledModel (more information in https://w3id.org/okn/o/sdm#CoupledModel)""" - + await FastAPICache.clear(namespace="CoupledModel") return query_manager.post_resource( - + user=user, body=coupled_model, rdf_type_uri=COUPLEDMODEL_TYPE_URI, - rdf_type_name=COUPLEDMODEL_TYPE_NAME, + rdf_type_name=COUPLEDMODEL_TYPE_NAME, kls=CoupledModel ) - + diff --git a/src/openapi_server/apis/data_transformation_api.py b/src/openapi_server/apis/data_transformation_api.py index 4a49054..ea84eec 100644 --- a/src/openapi_server/apis/data_transformation_api.py +++ b/src/openapi_server/apis/data_transformation_api.py @@ -39,21 +39,21 @@ ) @cache(namespace="DataTransformation", expire=1800) async def custom_datasetspecifications_id_datatransformations_get( - id: str = Path(None, description="The ID of the dataspecification"), + id: str = Path( description="The ID of the dataspecification"), custom_query_name: str = Query("custom_datatransformations", description="Name of the custom query"), username: str = Query(None, description="Username to query"), ) -> List[DataTransformation]: """Gets a list of data transformations related a dataset""" - + return query_manager.get_resource( id=id, custom_query_name=custom_query_name,username=username, - + rdf_type_uri=DATATRANSFORMATION_TYPE_URI, - rdf_type_name=DATATRANSFORMATION_TYPE_NAME, + rdf_type_name=DATATRANSFORMATION_TYPE_NAME, kls=DataTransformation ) - + @router.get( @@ -73,16 +73,16 @@ async def datatransformations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[DataTransformation]: """Gets a list of all instances of DataTransformation (more information in https://w3id.org/okn/o/sd#DataTransformation)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=DATATRANSFORMATION_TYPE_URI, - rdf_type_name=DATATRANSFORMATION_TYPE_NAME, + rdf_type_name=DATATRANSFORMATION_TYPE_NAME, kls=DataTransformation ) - + @router.delete( @@ -96,24 +96,24 @@ async def datatransformations_get( response_model_by_alias=True, ) async def datatransformations_id_delete( - id: str = Path(None, description="The ID of the DataTransformation to be retrieved"), + id: str = Path( description="The ID of the DataTransformation to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing DataTransformation (more information in https://w3id.org/okn/o/sd#DataTransformation)""" - + await FastAPICache.clear(namespace="DataTransformation") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=DATATRANSFORMATION_TYPE_URI, - rdf_type_name=DATATRANSFORMATION_TYPE_NAME, + rdf_type_name=DATATRANSFORMATION_TYPE_NAME, kls=DataTransformation ) - + @router.get( @@ -127,20 +127,20 @@ async def datatransformations_id_delete( ) @cache(namespace="DataTransformation", expire=1800) async def datatransformations_id_get( - id: str = Path(None, description="The ID of the DataTransformation to be retrieved"), + id: str = Path( description="The ID of the DataTransformation to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> DataTransformation: """Gets the details of a given DataTransformation (more information in https://w3id.org/okn/o/sd#DataTransformation)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=DATATRANSFORMATION_TYPE_URI, - rdf_type_name=DATATRANSFORMATION_TYPE_NAME, + rdf_type_name=DATATRANSFORMATION_TYPE_NAME, kls=DataTransformation ) - + @router.put( @@ -154,7 +154,7 @@ async def datatransformations_id_get( response_model_by_alias=True, ) async def datatransformations_id_put( - id: str = Path(None, description="The ID of the DataTransformation to be retrieved"), + id: str = Path( description="The ID of the DataTransformation to be retrieved"), user: str = Query(None, description="Username"), data_transformation: DataTransformation = Body(None, description="An old DataTransformationto be updated"), token_BearerAuth: TokenModel = Security( @@ -162,17 +162,17 @@ async def datatransformations_id_put( ), ) -> DataTransformation: """Updates an existing DataTransformation (more information in https://w3id.org/okn/o/sd#DataTransformation)""" - + await FastAPICache.clear(namespace="DataTransformation") return query_manager.put_resource( id=id, user=user, body=data_transformation, rdf_type_uri=DATATRANSFORMATION_TYPE_URI, - rdf_type_name=DATATRANSFORMATION_TYPE_NAME, + rdf_type_name=DATATRANSFORMATION_TYPE_NAME, kls=DataTransformation ) - + @router.post( @@ -192,14 +192,14 @@ async def datatransformations_post( ), ) -> DataTransformation: """Create a new instance of DataTransformation (more information in https://w3id.org/okn/o/sd#DataTransformation)""" - + await FastAPICache.clear(namespace="DataTransformation") return query_manager.post_resource( - + user=user, body=data_transformation, rdf_type_uri=DATATRANSFORMATION_TYPE_URI, - rdf_type_name=DATATRANSFORMATION_TYPE_NAME, + rdf_type_name=DATATRANSFORMATION_TYPE_NAME, kls=DataTransformation ) - + diff --git a/src/openapi_server/apis/data_transformation_setup_api.py b/src/openapi_server/apis/data_transformation_setup_api.py index 85248d9..275aa92 100644 --- a/src/openapi_server/apis/data_transformation_setup_api.py +++ b/src/openapi_server/apis/data_transformation_setup_api.py @@ -45,16 +45,16 @@ async def datatransformationsetups_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[DataTransformationSetup]: """Gets a list of all instances of DataTransformationSetup (more information in https://w3id.org/okn/o/sd#DataTransformationSetup)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=DATATRANSFORMATIONSETUP_TYPE_URI, - rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, + rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, kls=DataTransformationSetup ) - + @router.delete( @@ -68,24 +68,24 @@ async def datatransformationsetups_get( response_model_by_alias=True, ) async def datatransformationsetups_id_delete( - id: str = Path(None, description="The ID of the DataTransformationSetup to be retrieved"), + id: str = Path( description="The ID of the DataTransformationSetup to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing DataTransformationSetup (more information in https://w3id.org/okn/o/sd#DataTransformationSetup)""" - + await FastAPICache.clear(namespace="DataTransformationSetup") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=DATATRANSFORMATIONSETUP_TYPE_URI, - rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, + rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, kls=DataTransformationSetup ) - + @router.get( @@ -99,20 +99,20 @@ async def datatransformationsetups_id_delete( ) @cache(namespace="DataTransformationSetup", expire=1800) async def datatransformationsetups_id_get( - id: str = Path(None, description="The ID of the DataTransformationSetup to be retrieved"), + id: str = Path( description="The ID of the DataTransformationSetup to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> DataTransformationSetup: """Gets the details of a given DataTransformationSetup (more information in https://w3id.org/okn/o/sd#DataTransformationSetup)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=DATATRANSFORMATIONSETUP_TYPE_URI, - rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, + rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, kls=DataTransformationSetup ) - + @router.put( @@ -126,7 +126,7 @@ async def datatransformationsetups_id_get( response_model_by_alias=True, ) async def datatransformationsetups_id_put( - id: str = Path(None, description="The ID of the DataTransformationSetup to be retrieved"), + id: str = Path( description="The ID of the DataTransformationSetup to be retrieved"), user: str = Query(None, description="Username"), data_transformation_setup: DataTransformationSetup = Body(None, description="An old DataTransformationSetupto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def datatransformationsetups_id_put( ), ) -> DataTransformationSetup: """Updates an existing DataTransformationSetup (more information in https://w3id.org/okn/o/sd#DataTransformationSetup)""" - + await FastAPICache.clear(namespace="DataTransformationSetup") return query_manager.put_resource( id=id, user=user, body=data_transformation_setup, rdf_type_uri=DATATRANSFORMATIONSETUP_TYPE_URI, - rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, + rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, kls=DataTransformationSetup ) - + @router.post( @@ -164,14 +164,14 @@ async def datatransformationsetups_post( ), ) -> DataTransformationSetup: """Create a new instance of DataTransformationSetup (more information in https://w3id.org/okn/o/sd#DataTransformationSetup)""" - + await FastAPICache.clear(namespace="DataTransformationSetup") return query_manager.post_resource( - + user=user, body=data_transformation_setup, rdf_type_uri=DATATRANSFORMATIONSETUP_TYPE_URI, - rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, + rdf_type_name=DATATRANSFORMATIONSETUP_TYPE_NAME, kls=DataTransformationSetup ) - + diff --git a/src/openapi_server/apis/dataset_specification_api.py b/src/openapi_server/apis/dataset_specification_api.py index 0e0e2dd..705723b 100644 --- a/src/openapi_server/apis/dataset_specification_api.py +++ b/src/openapi_server/apis/dataset_specification_api.py @@ -39,21 +39,21 @@ ) @cache(namespace="DatasetSpecification", expire=1800) async def custom_configuration_id_inputs_get( - id: str = Path(None, description="The ID of the resource"), + id: str = Path( description="The ID of the resource"), username: str = Query(None, description="Username to query"), custom_query_name: str = Query("search_datasetspecification_by_configurationid", description="Name of the custom query"), ) -> List[DatasetSpecification]: """Gets all inputs of a configuration""" - + return query_manager.get_resource( id=id, username=username,custom_query_name=custom_query_name, - + rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + @router.get( @@ -72,16 +72,16 @@ async def custom_datasetspecifications_get( custom_query_name: str = Query("custom_allinputs", description="Name of the custom query"), ) -> List[DatasetSpecification]: """Gets all inputs of a configuration""" - + return query_manager.get_resource( - + username=username,configurationid=configurationid,custom_query_name=custom_query_name, - + rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + @router.get( @@ -101,16 +101,16 @@ async def datasetspecifications_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[DatasetSpecification]: """Gets a list of all instances of DatasetSpecification (more information in https://w3id.org/okn/o/sd#DatasetSpecification)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + @router.delete( @@ -124,24 +124,24 @@ async def datasetspecifications_get( response_model_by_alias=True, ) async def datasetspecifications_id_delete( - id: str = Path(None, description="The ID of the DatasetSpecification to be retrieved"), + id: str = Path( description="The ID of the DatasetSpecification to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing DatasetSpecification (more information in https://w3id.org/okn/o/sd#DatasetSpecification)""" - + await FastAPICache.clear(namespace="DatasetSpecification") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + @router.get( @@ -155,20 +155,20 @@ async def datasetspecifications_id_delete( ) @cache(namespace="DatasetSpecification", expire=1800) async def datasetspecifications_id_get( - id: str = Path(None, description="The ID of the DatasetSpecification to be retrieved"), + id: str = Path( description="The ID of the DatasetSpecification to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> DatasetSpecification: """Gets the details of a given DatasetSpecification (more information in https://w3id.org/okn/o/sd#DatasetSpecification)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + @router.put( @@ -182,7 +182,7 @@ async def datasetspecifications_id_get( response_model_by_alias=True, ) async def datasetspecifications_id_put( - id: str = Path(None, description="The ID of the DatasetSpecification to be retrieved"), + id: str = Path( description="The ID of the DatasetSpecification to be retrieved"), user: str = Query(None, description="Username"), dataset_specification: DatasetSpecification = Body(None, description="An old DatasetSpecificationto be updated"), token_BearerAuth: TokenModel = Security( @@ -190,17 +190,17 @@ async def datasetspecifications_id_put( ), ) -> DatasetSpecification: """Updates an existing DatasetSpecification (more information in https://w3id.org/okn/o/sd#DatasetSpecification)""" - + await FastAPICache.clear(namespace="DatasetSpecification") return query_manager.put_resource( id=id, user=user, body=dataset_specification, rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + @router.post( @@ -220,14 +220,14 @@ async def datasetspecifications_post( ), ) -> DatasetSpecification: """Create a new instance of DatasetSpecification (more information in https://w3id.org/okn/o/sd#DatasetSpecification)""" - + await FastAPICache.clear(namespace="DatasetSpecification") return query_manager.post_resource( - + user=user, body=dataset_specification, rdf_type_uri=DATASETSPECIFICATION_TYPE_URI, - rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, + rdf_type_name=DATASETSPECIFICATION_TYPE_NAME, kls=DatasetSpecification ) - + diff --git a/src/openapi_server/apis/empirical_model_api.py b/src/openapi_server/apis/empirical_model_api.py index 870167a..0252eff 100644 --- a/src/openapi_server/apis/empirical_model_api.py +++ b/src/openapi_server/apis/empirical_model_api.py @@ -45,16 +45,16 @@ async def empiricalmodels_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[EmpiricalModel]: """Gets a list of all instances of EmpiricalModel (more information in https://w3id.org/okn/o/sdm#EmpiricalModel)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=EMPIRICALMODEL_TYPE_URI, - rdf_type_name=EMPIRICALMODEL_TYPE_NAME, + rdf_type_name=EMPIRICALMODEL_TYPE_NAME, kls=EmpiricalModel ) - + @router.delete( @@ -68,24 +68,24 @@ async def empiricalmodels_get( response_model_by_alias=True, ) async def empiricalmodels_id_delete( - id: str = Path(None, description="The ID of the EmpiricalModel to be retrieved"), + id: str = Path( description="The ID of the EmpiricalModel to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing EmpiricalModel (more information in https://w3id.org/okn/o/sdm#EmpiricalModel)""" - + await FastAPICache.clear(namespace="EmpiricalModel") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=EMPIRICALMODEL_TYPE_URI, - rdf_type_name=EMPIRICALMODEL_TYPE_NAME, + rdf_type_name=EMPIRICALMODEL_TYPE_NAME, kls=EmpiricalModel ) - + @router.get( @@ -99,20 +99,20 @@ async def empiricalmodels_id_delete( ) @cache(namespace="EmpiricalModel", expire=1800) async def empiricalmodels_id_get( - id: str = Path(None, description="The ID of the EmpiricalModel to be retrieved"), + id: str = Path( description="The ID of the EmpiricalModel to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> EmpiricalModel: """Gets the details of a given EmpiricalModel (more information in https://w3id.org/okn/o/sdm#EmpiricalModel)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=EMPIRICALMODEL_TYPE_URI, - rdf_type_name=EMPIRICALMODEL_TYPE_NAME, + rdf_type_name=EMPIRICALMODEL_TYPE_NAME, kls=EmpiricalModel ) - + @router.put( @@ -126,7 +126,7 @@ async def empiricalmodels_id_get( response_model_by_alias=True, ) async def empiricalmodels_id_put( - id: str = Path(None, description="The ID of the EmpiricalModel to be retrieved"), + id: str = Path( description="The ID of the EmpiricalModel to be retrieved"), user: str = Query(None, description="Username"), empirical_model: EmpiricalModel = Body(None, description="An old EmpiricalModelto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def empiricalmodels_id_put( ), ) -> EmpiricalModel: """Updates an existing EmpiricalModel (more information in https://w3id.org/okn/o/sdm#EmpiricalModel)""" - + await FastAPICache.clear(namespace="EmpiricalModel") return query_manager.put_resource( id=id, user=user, body=empirical_model, rdf_type_uri=EMPIRICALMODEL_TYPE_URI, - rdf_type_name=EMPIRICALMODEL_TYPE_NAME, + rdf_type_name=EMPIRICALMODEL_TYPE_NAME, kls=EmpiricalModel ) - + @router.post( @@ -164,14 +164,14 @@ async def empiricalmodels_post( ), ) -> EmpiricalModel: """Create a new instance of EmpiricalModel (more information in https://w3id.org/okn/o/sdm#EmpiricalModel)""" - + await FastAPICache.clear(namespace="EmpiricalModel") return query_manager.post_resource( - + user=user, body=empirical_model, rdf_type_uri=EMPIRICALMODEL_TYPE_URI, - rdf_type_name=EMPIRICALMODEL_TYPE_NAME, + rdf_type_name=EMPIRICALMODEL_TYPE_NAME, kls=EmpiricalModel ) - + diff --git a/src/openapi_server/apis/emulator_api.py b/src/openapi_server/apis/emulator_api.py index 3c7e93c..7fa53e7 100644 --- a/src/openapi_server/apis/emulator_api.py +++ b/src/openapi_server/apis/emulator_api.py @@ -45,16 +45,16 @@ async def emulators_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Emulator]: """Gets a list of all instances of Emulator (more information in https://w3id.org/okn/o/sdm#Emulator)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=EMULATOR_TYPE_URI, - rdf_type_name=EMULATOR_TYPE_NAME, + rdf_type_name=EMULATOR_TYPE_NAME, kls=Emulator ) - + @router.delete( @@ -68,24 +68,24 @@ async def emulators_get( response_model_by_alias=True, ) async def emulators_id_delete( - id: str = Path(None, description="The ID of the Emulator to be retrieved"), + id: str = Path( description="The ID of the Emulator to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Emulator (more information in https://w3id.org/okn/o/sdm#Emulator)""" - + await FastAPICache.clear(namespace="Emulator") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=EMULATOR_TYPE_URI, - rdf_type_name=EMULATOR_TYPE_NAME, + rdf_type_name=EMULATOR_TYPE_NAME, kls=Emulator ) - + @router.get( @@ -99,20 +99,20 @@ async def emulators_id_delete( ) @cache(namespace="Emulator", expire=1800) async def emulators_id_get( - id: str = Path(None, description="The ID of the Emulator to be retrieved"), + id: str = Path( description="The ID of the Emulator to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Emulator: """Gets the details of a given Emulator (more information in https://w3id.org/okn/o/sdm#Emulator)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=EMULATOR_TYPE_URI, - rdf_type_name=EMULATOR_TYPE_NAME, + rdf_type_name=EMULATOR_TYPE_NAME, kls=Emulator ) - + @router.put( @@ -126,7 +126,7 @@ async def emulators_id_get( response_model_by_alias=True, ) async def emulators_id_put( - id: str = Path(None, description="The ID of the Emulator to be retrieved"), + id: str = Path( description="The ID of the Emulator to be retrieved"), user: str = Query(None, description="Username"), emulator: Emulator = Body(None, description="An old Emulatorto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def emulators_id_put( ), ) -> Emulator: """Updates an existing Emulator (more information in https://w3id.org/okn/o/sdm#Emulator)""" - + await FastAPICache.clear(namespace="Emulator") return query_manager.put_resource( id=id, user=user, body=emulator, rdf_type_uri=EMULATOR_TYPE_URI, - rdf_type_name=EMULATOR_TYPE_NAME, + rdf_type_name=EMULATOR_TYPE_NAME, kls=Emulator ) - + @router.post( @@ -164,14 +164,14 @@ async def emulators_post( ), ) -> Emulator: """Create a new instance of Emulator (more information in https://w3id.org/okn/o/sdm#Emulator)""" - + await FastAPICache.clear(namespace="Emulator") return query_manager.post_resource( - + user=user, body=emulator, rdf_type_uri=EMULATOR_TYPE_URI, - rdf_type_name=EMULATOR_TYPE_NAME, + rdf_type_name=EMULATOR_TYPE_NAME, kls=Emulator ) - + diff --git a/src/openapi_server/apis/equation_api.py b/src/openapi_server/apis/equation_api.py index a99f826..a4308df 100644 --- a/src/openapi_server/apis/equation_api.py +++ b/src/openapi_server/apis/equation_api.py @@ -45,16 +45,16 @@ async def equations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Equation]: """Gets a list of all instances of Equation (more information in https://w3id.org/okn/o/sdm#Equation)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=EQUATION_TYPE_URI, - rdf_type_name=EQUATION_TYPE_NAME, + rdf_type_name=EQUATION_TYPE_NAME, kls=Equation ) - + @router.delete( @@ -68,24 +68,24 @@ async def equations_get( response_model_by_alias=True, ) async def equations_id_delete( - id: str = Path(None, description="The ID of the Equation to be retrieved"), + id: str = Path( description="The ID of the Equation to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Equation (more information in https://w3id.org/okn/o/sdm#Equation)""" - + await FastAPICache.clear(namespace="Equation") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=EQUATION_TYPE_URI, - rdf_type_name=EQUATION_TYPE_NAME, + rdf_type_name=EQUATION_TYPE_NAME, kls=Equation ) - + @router.get( @@ -99,20 +99,20 @@ async def equations_id_delete( ) @cache(namespace="Equation", expire=1800) async def equations_id_get( - id: str = Path(None, description="The ID of the Equation to be retrieved"), + id: str = Path( description="The ID of the Equation to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Equation: """Gets the details of a given Equation (more information in https://w3id.org/okn/o/sdm#Equation)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=EQUATION_TYPE_URI, - rdf_type_name=EQUATION_TYPE_NAME, + rdf_type_name=EQUATION_TYPE_NAME, kls=Equation ) - + @router.put( @@ -126,7 +126,7 @@ async def equations_id_get( response_model_by_alias=True, ) async def equations_id_put( - id: str = Path(None, description="The ID of the Equation to be retrieved"), + id: str = Path( description="The ID of the Equation to be retrieved"), user: str = Query(None, description="Username"), equation: Equation = Body(None, description="An old Equationto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def equations_id_put( ), ) -> Equation: """Updates an existing Equation (more information in https://w3id.org/okn/o/sdm#Equation)""" - + await FastAPICache.clear(namespace="Equation") return query_manager.put_resource( id=id, user=user, body=equation, rdf_type_uri=EQUATION_TYPE_URI, - rdf_type_name=EQUATION_TYPE_NAME, + rdf_type_name=EQUATION_TYPE_NAME, kls=Equation ) - + @router.post( @@ -164,14 +164,14 @@ async def equations_post( ), ) -> Equation: """Create a new instance of Equation (more information in https://w3id.org/okn/o/sdm#Equation)""" - + await FastAPICache.clear(namespace="Equation") return query_manager.post_resource( - + user=user, body=equation, rdf_type_uri=EQUATION_TYPE_URI, - rdf_type_name=EQUATION_TYPE_NAME, + rdf_type_name=EQUATION_TYPE_NAME, kls=Equation ) - + diff --git a/src/openapi_server/apis/funding_information_api.py b/src/openapi_server/apis/funding_information_api.py index 044c1b5..4cbb4ae 100644 --- a/src/openapi_server/apis/funding_information_api.py +++ b/src/openapi_server/apis/funding_information_api.py @@ -45,16 +45,16 @@ async def fundinginformations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[FundingInformation]: """Gets a list of all instances of FundingInformation (more information in https://w3id.org/okn/o/sd#FundingInformation)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=FUNDINGINFORMATION_TYPE_URI, - rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, + rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, kls=FundingInformation ) - + @router.delete( @@ -68,24 +68,24 @@ async def fundinginformations_get( response_model_by_alias=True, ) async def fundinginformations_id_delete( - id: str = Path(None, description="The ID of the FundingInformation to be retrieved"), + id: str = Path( description="The ID of the FundingInformation to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing FundingInformation (more information in https://w3id.org/okn/o/sd#FundingInformation)""" - + await FastAPICache.clear(namespace="FundingInformation") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=FUNDINGINFORMATION_TYPE_URI, - rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, + rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, kls=FundingInformation ) - + @router.get( @@ -99,20 +99,20 @@ async def fundinginformations_id_delete( ) @cache(namespace="FundingInformation", expire=1800) async def fundinginformations_id_get( - id: str = Path(None, description="The ID of the FundingInformation to be retrieved"), + id: str = Path( description="The ID of the FundingInformation to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> FundingInformation: """Gets the details of a given FundingInformation (more information in https://w3id.org/okn/o/sd#FundingInformation)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=FUNDINGINFORMATION_TYPE_URI, - rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, + rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, kls=FundingInformation ) - + @router.put( @@ -126,7 +126,7 @@ async def fundinginformations_id_get( response_model_by_alias=True, ) async def fundinginformations_id_put( - id: str = Path(None, description="The ID of the FundingInformation to be retrieved"), + id: str = Path( description="The ID of the FundingInformation to be retrieved"), user: str = Query(None, description="Username"), funding_information: FundingInformation = Body(None, description="An old FundingInformationto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def fundinginformations_id_put( ), ) -> FundingInformation: """Updates an existing FundingInformation (more information in https://w3id.org/okn/o/sd#FundingInformation)""" - + await FastAPICache.clear(namespace="FundingInformation") return query_manager.put_resource( id=id, user=user, body=funding_information, rdf_type_uri=FUNDINGINFORMATION_TYPE_URI, - rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, + rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, kls=FundingInformation ) - + @router.post( @@ -164,14 +164,14 @@ async def fundinginformations_post( ), ) -> FundingInformation: """Create a new instance of FundingInformation (more information in https://w3id.org/okn/o/sd#FundingInformation)""" - + await FastAPICache.clear(namespace="FundingInformation") return query_manager.post_resource( - + user=user, body=funding_information, rdf_type_uri=FUNDINGINFORMATION_TYPE_URI, - rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, + rdf_type_name=FUNDINGINFORMATION_TYPE_NAME, kls=FundingInformation ) - + diff --git a/src/openapi_server/apis/geo_coordinates_api.py b/src/openapi_server/apis/geo_coordinates_api.py index 02ae317..001286f 100644 --- a/src/openapi_server/apis/geo_coordinates_api.py +++ b/src/openapi_server/apis/geo_coordinates_api.py @@ -45,16 +45,16 @@ async def geocoordinatess_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[GeoCoordinates]: """Gets a list of all instances of GeoCoordinates (more information in https://w3id.org/okn/o/sdm#GeoCoordinates)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=GEOCOORDINATES_TYPE_URI, - rdf_type_name=GEOCOORDINATES_TYPE_NAME, + rdf_type_name=GEOCOORDINATES_TYPE_NAME, kls=GeoCoordinates ) - + @router.delete( @@ -68,24 +68,24 @@ async def geocoordinatess_get( response_model_by_alias=True, ) async def geocoordinatess_id_delete( - id: str = Path(None, description="The ID of the GeoCoordinates to be retrieved"), + id: str = Path( description="The ID of the GeoCoordinates to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing GeoCoordinates (more information in https://w3id.org/okn/o/sdm#GeoCoordinates)""" - + await FastAPICache.clear(namespace="GeoCoordinates") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=GEOCOORDINATES_TYPE_URI, - rdf_type_name=GEOCOORDINATES_TYPE_NAME, + rdf_type_name=GEOCOORDINATES_TYPE_NAME, kls=GeoCoordinates ) - + @router.get( @@ -99,20 +99,20 @@ async def geocoordinatess_id_delete( ) @cache(namespace="GeoCoordinates", expire=1800) async def geocoordinatess_id_get( - id: str = Path(None, description="The ID of the GeoCoordinates to be retrieved"), + id: str = Path( description="The ID of the GeoCoordinates to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> GeoCoordinates: """Gets the details of a given GeoCoordinates (more information in https://w3id.org/okn/o/sdm#GeoCoordinates)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=GEOCOORDINATES_TYPE_URI, - rdf_type_name=GEOCOORDINATES_TYPE_NAME, + rdf_type_name=GEOCOORDINATES_TYPE_NAME, kls=GeoCoordinates ) - + @router.put( @@ -126,7 +126,7 @@ async def geocoordinatess_id_get( response_model_by_alias=True, ) async def geocoordinatess_id_put( - id: str = Path(None, description="The ID of the GeoCoordinates to be retrieved"), + id: str = Path( description="The ID of the GeoCoordinates to be retrieved"), user: str = Query(None, description="Username"), geo_coordinates: GeoCoordinates = Body(None, description="An old GeoCoordinatesto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def geocoordinatess_id_put( ), ) -> GeoCoordinates: """Updates an existing GeoCoordinates (more information in https://w3id.org/okn/o/sdm#GeoCoordinates)""" - + await FastAPICache.clear(namespace="GeoCoordinates") return query_manager.put_resource( id=id, user=user, body=geo_coordinates, rdf_type_uri=GEOCOORDINATES_TYPE_URI, - rdf_type_name=GEOCOORDINATES_TYPE_NAME, + rdf_type_name=GEOCOORDINATES_TYPE_NAME, kls=GeoCoordinates ) - + @router.post( @@ -164,14 +164,14 @@ async def geocoordinatess_post( ), ) -> GeoCoordinates: """Create a new instance of GeoCoordinates (more information in https://w3id.org/okn/o/sdm#GeoCoordinates)""" - + await FastAPICache.clear(namespace="GeoCoordinates") return query_manager.post_resource( - + user=user, body=geo_coordinates, rdf_type_uri=GEOCOORDINATES_TYPE_URI, - rdf_type_name=GEOCOORDINATES_TYPE_NAME, + rdf_type_name=GEOCOORDINATES_TYPE_NAME, kls=GeoCoordinates ) - + diff --git a/src/openapi_server/apis/geo_shape_api.py b/src/openapi_server/apis/geo_shape_api.py index 2b3512d..486aca1 100644 --- a/src/openapi_server/apis/geo_shape_api.py +++ b/src/openapi_server/apis/geo_shape_api.py @@ -45,16 +45,16 @@ async def geoshapes_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[GeoShape]: """Gets a list of all instances of GeoShape (more information in https://w3id.org/okn/o/sdm#GeoShape)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=GEOSHAPE_TYPE_URI, - rdf_type_name=GEOSHAPE_TYPE_NAME, + rdf_type_name=GEOSHAPE_TYPE_NAME, kls=GeoShape ) - + @router.delete( @@ -68,24 +68,24 @@ async def geoshapes_get( response_model_by_alias=True, ) async def geoshapes_id_delete( - id: str = Path(None, description="The ID of the GeoShape to be retrieved"), + id: str = Path( description="The ID of the GeoShape to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing GeoShape (more information in https://w3id.org/okn/o/sdm#GeoShape)""" - + await FastAPICache.clear(namespace="GeoShape") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=GEOSHAPE_TYPE_URI, - rdf_type_name=GEOSHAPE_TYPE_NAME, + rdf_type_name=GEOSHAPE_TYPE_NAME, kls=GeoShape ) - + @router.get( @@ -99,20 +99,20 @@ async def geoshapes_id_delete( ) @cache(namespace="GeoShape", expire=1800) async def geoshapes_id_get( - id: str = Path(None, description="The ID of the GeoShape to be retrieved"), + id: str = Path( description="The ID of the GeoShape to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> GeoShape: """Gets the details of a given GeoShape (more information in https://w3id.org/okn/o/sdm#GeoShape)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=GEOSHAPE_TYPE_URI, - rdf_type_name=GEOSHAPE_TYPE_NAME, + rdf_type_name=GEOSHAPE_TYPE_NAME, kls=GeoShape ) - + @router.put( @@ -126,7 +126,7 @@ async def geoshapes_id_get( response_model_by_alias=True, ) async def geoshapes_id_put( - id: str = Path(None, description="The ID of the GeoShape to be retrieved"), + id: str = Path( description="The ID of the GeoShape to be retrieved"), user: str = Query(None, description="Username"), geo_shape: GeoShape = Body(None, description="An old GeoShapeto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def geoshapes_id_put( ), ) -> GeoShape: """Updates an existing GeoShape (more information in https://w3id.org/okn/o/sdm#GeoShape)""" - + await FastAPICache.clear(namespace="GeoShape") return query_manager.put_resource( id=id, user=user, body=geo_shape, rdf_type_uri=GEOSHAPE_TYPE_URI, - rdf_type_name=GEOSHAPE_TYPE_NAME, + rdf_type_name=GEOSHAPE_TYPE_NAME, kls=GeoShape ) - + @router.post( @@ -164,14 +164,14 @@ async def geoshapes_post( ), ) -> GeoShape: """Create a new instance of GeoShape (more information in https://w3id.org/okn/o/sdm#GeoShape)""" - + await FastAPICache.clear(namespace="GeoShape") return query_manager.post_resource( - + user=user, body=geo_shape, rdf_type_uri=GEOSHAPE_TYPE_URI, - rdf_type_name=GEOSHAPE_TYPE_NAME, + rdf_type_name=GEOSHAPE_TYPE_NAME, kls=GeoShape ) - + diff --git a/src/openapi_server/apis/grid_api.py b/src/openapi_server/apis/grid_api.py index 2199895..823a6d2 100644 --- a/src/openapi_server/apis/grid_api.py +++ b/src/openapi_server/apis/grid_api.py @@ -45,16 +45,16 @@ async def grids_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Grid]: """Gets a list of all instances of Grid (more information in https://w3id.org/okn/o/sdm#Grid)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=GRID_TYPE_URI, - rdf_type_name=GRID_TYPE_NAME, + rdf_type_name=GRID_TYPE_NAME, kls=Grid ) - + @router.delete( @@ -68,24 +68,24 @@ async def grids_get( response_model_by_alias=True, ) async def grids_id_delete( - id: str = Path(None, description="The ID of the Grid to be retrieved"), + id: str = Path( description="The ID of the Grid to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Grid (more information in https://w3id.org/okn/o/sdm#Grid)""" - + await FastAPICache.clear(namespace="Grid") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=GRID_TYPE_URI, - rdf_type_name=GRID_TYPE_NAME, + rdf_type_name=GRID_TYPE_NAME, kls=Grid ) - + @router.get( @@ -99,20 +99,20 @@ async def grids_id_delete( ) @cache(namespace="Grid", expire=1800) async def grids_id_get( - id: str = Path(None, description="The ID of the Grid to be retrieved"), + id: str = Path( description="The ID of the Grid to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Grid: """Gets the details of a given Grid (more information in https://w3id.org/okn/o/sdm#Grid)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=GRID_TYPE_URI, - rdf_type_name=GRID_TYPE_NAME, + rdf_type_name=GRID_TYPE_NAME, kls=Grid ) - + @router.put( @@ -126,7 +126,7 @@ async def grids_id_get( response_model_by_alias=True, ) async def grids_id_put( - id: str = Path(None, description="The ID of the Grid to be retrieved"), + id: str = Path( description="The ID of the Grid to be retrieved"), user: str = Query(None, description="Username"), grid: Grid = Body(None, description="An old Gridto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def grids_id_put( ), ) -> Grid: """Updates an existing Grid (more information in https://w3id.org/okn/o/sdm#Grid)""" - + await FastAPICache.clear(namespace="Grid") return query_manager.put_resource( id=id, user=user, body=grid, rdf_type_uri=GRID_TYPE_URI, - rdf_type_name=GRID_TYPE_NAME, + rdf_type_name=GRID_TYPE_NAME, kls=Grid ) - + @router.post( @@ -164,14 +164,14 @@ async def grids_post( ), ) -> Grid: """Create a new instance of Grid (more information in https://w3id.org/okn/o/sdm#Grid)""" - + await FastAPICache.clear(namespace="Grid") return query_manager.post_resource( - + user=user, body=grid, rdf_type_uri=GRID_TYPE_URI, - rdf_type_name=GRID_TYPE_NAME, + rdf_type_name=GRID_TYPE_NAME, kls=Grid ) - + diff --git a/src/openapi_server/apis/hybrid_model_api.py b/src/openapi_server/apis/hybrid_model_api.py index eae53a1..2be8e09 100644 --- a/src/openapi_server/apis/hybrid_model_api.py +++ b/src/openapi_server/apis/hybrid_model_api.py @@ -45,16 +45,16 @@ async def hybridmodels_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[HybridModel]: """Gets a list of all instances of HybridModel (more information in https://w3id.org/okn/o/sdm#HybridModel)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=HYBRIDMODEL_TYPE_URI, - rdf_type_name=HYBRIDMODEL_TYPE_NAME, + rdf_type_name=HYBRIDMODEL_TYPE_NAME, kls=HybridModel ) - + @router.delete( @@ -68,24 +68,24 @@ async def hybridmodels_get( response_model_by_alias=True, ) async def hybridmodels_id_delete( - id: str = Path(None, description="The ID of the HybridModel to be retrieved"), + id: str = Path( description="The ID of the HybridModel to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing HybridModel (more information in https://w3id.org/okn/o/sdm#HybridModel)""" - + await FastAPICache.clear(namespace="HybridModel") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=HYBRIDMODEL_TYPE_URI, - rdf_type_name=HYBRIDMODEL_TYPE_NAME, + rdf_type_name=HYBRIDMODEL_TYPE_NAME, kls=HybridModel ) - + @router.get( @@ -99,20 +99,20 @@ async def hybridmodels_id_delete( ) @cache(namespace="HybridModel", expire=1800) async def hybridmodels_id_get( - id: str = Path(None, description="The ID of the HybridModel to be retrieved"), + id: str = Path( description="The ID of the HybridModel to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> HybridModel: """Gets the details of a given HybridModel (more information in https://w3id.org/okn/o/sdm#HybridModel)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=HYBRIDMODEL_TYPE_URI, - rdf_type_name=HYBRIDMODEL_TYPE_NAME, + rdf_type_name=HYBRIDMODEL_TYPE_NAME, kls=HybridModel ) - + @router.put( @@ -126,7 +126,7 @@ async def hybridmodels_id_get( response_model_by_alias=True, ) async def hybridmodels_id_put( - id: str = Path(None, description="The ID of the HybridModel to be retrieved"), + id: str = Path( description="The ID of the HybridModel to be retrieved"), user: str = Query(None, description="Username"), hybrid_model: HybridModel = Body(None, description="An old HybridModelto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def hybridmodels_id_put( ), ) -> HybridModel: """Updates an existing HybridModel (more information in https://w3id.org/okn/o/sdm#HybridModel)""" - + await FastAPICache.clear(namespace="HybridModel") return query_manager.put_resource( id=id, user=user, body=hybrid_model, rdf_type_uri=HYBRIDMODEL_TYPE_URI, - rdf_type_name=HYBRIDMODEL_TYPE_NAME, + rdf_type_name=HYBRIDMODEL_TYPE_NAME, kls=HybridModel ) - + @router.post( @@ -164,14 +164,14 @@ async def hybridmodels_post( ), ) -> HybridModel: """Create a new instance of HybridModel (more information in https://w3id.org/okn/o/sdm#HybridModel)""" - + await FastAPICache.clear(namespace="HybridModel") return query_manager.post_resource( - + user=user, body=hybrid_model, rdf_type_uri=HYBRIDMODEL_TYPE_URI, - rdf_type_name=HYBRIDMODEL_TYPE_NAME, + rdf_type_name=HYBRIDMODEL_TYPE_NAME, kls=HybridModel ) - + diff --git a/src/openapi_server/apis/image_api.py b/src/openapi_server/apis/image_api.py index 89370d3..c404db6 100644 --- a/src/openapi_server/apis/image_api.py +++ b/src/openapi_server/apis/image_api.py @@ -45,16 +45,16 @@ async def images_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Image]: """Gets a list of all instances of Image (more information in https://w3id.org/okn/o/sd#Image)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=IMAGE_TYPE_URI, - rdf_type_name=IMAGE_TYPE_NAME, + rdf_type_name=IMAGE_TYPE_NAME, kls=Image ) - + @router.delete( @@ -68,24 +68,24 @@ async def images_get( response_model_by_alias=True, ) async def images_id_delete( - id: str = Path(None, description="The ID of the Image to be retrieved"), + id: str = Path( description="The ID of the Image to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Image (more information in https://w3id.org/okn/o/sd#Image)""" - + await FastAPICache.clear(namespace="Image") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=IMAGE_TYPE_URI, - rdf_type_name=IMAGE_TYPE_NAME, + rdf_type_name=IMAGE_TYPE_NAME, kls=Image ) - + @router.get( @@ -99,20 +99,20 @@ async def images_id_delete( ) @cache(namespace="Image", expire=1800) async def images_id_get( - id: str = Path(None, description="The ID of the Image to be retrieved"), + id: str = Path( description="The ID of the Image to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Image: """Gets the details of a given Image (more information in https://w3id.org/okn/o/sd#Image)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=IMAGE_TYPE_URI, - rdf_type_name=IMAGE_TYPE_NAME, + rdf_type_name=IMAGE_TYPE_NAME, kls=Image ) - + @router.put( @@ -126,7 +126,7 @@ async def images_id_get( response_model_by_alias=True, ) async def images_id_put( - id: str = Path(None, description="The ID of the Image to be retrieved"), + id: str = Path( description="The ID of the Image to be retrieved"), user: str = Query(None, description="Username"), image: Image = Body(None, description="An old Imageto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def images_id_put( ), ) -> Image: """Updates an existing Image (more information in https://w3id.org/okn/o/sd#Image)""" - + await FastAPICache.clear(namespace="Image") return query_manager.put_resource( id=id, user=user, body=image, rdf_type_uri=IMAGE_TYPE_URI, - rdf_type_name=IMAGE_TYPE_NAME, + rdf_type_name=IMAGE_TYPE_NAME, kls=Image ) - + @router.post( @@ -164,14 +164,14 @@ async def images_post( ), ) -> Image: """Create a new instance of Image (more information in https://w3id.org/okn/o/sd#Image)""" - + await FastAPICache.clear(namespace="Image") return query_manager.post_resource( - + user=user, body=image, rdf_type_uri=IMAGE_TYPE_URI, - rdf_type_name=IMAGE_TYPE_NAME, + rdf_type_name=IMAGE_TYPE_NAME, kls=Image ) - + diff --git a/src/openapi_server/apis/intervention_api.py b/src/openapi_server/apis/intervention_api.py index 3d4764e..ef94b4d 100644 --- a/src/openapi_server/apis/intervention_api.py +++ b/src/openapi_server/apis/intervention_api.py @@ -45,16 +45,16 @@ async def interventions_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Intervention]: """Gets a list of all instances of Intervention (more information in https://w3id.org/okn/o/sdm#Intervention)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=INTERVENTION_TYPE_URI, - rdf_type_name=INTERVENTION_TYPE_NAME, + rdf_type_name=INTERVENTION_TYPE_NAME, kls=Intervention ) - + @router.delete( @@ -68,24 +68,24 @@ async def interventions_get( response_model_by_alias=True, ) async def interventions_id_delete( - id: str = Path(None, description="The ID of the Intervention to be retrieved"), + id: str = Path( description="The ID of the Intervention to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Intervention (more information in https://w3id.org/okn/o/sdm#Intervention)""" - + await FastAPICache.clear(namespace="Intervention") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=INTERVENTION_TYPE_URI, - rdf_type_name=INTERVENTION_TYPE_NAME, + rdf_type_name=INTERVENTION_TYPE_NAME, kls=Intervention ) - + @router.get( @@ -99,20 +99,20 @@ async def interventions_id_delete( ) @cache(namespace="Intervention", expire=1800) async def interventions_id_get( - id: str = Path(None, description="The ID of the Intervention to be retrieved"), + id: str = Path( description="The ID of the Intervention to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Intervention: """Gets the details of a given Intervention (more information in https://w3id.org/okn/o/sdm#Intervention)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=INTERVENTION_TYPE_URI, - rdf_type_name=INTERVENTION_TYPE_NAME, + rdf_type_name=INTERVENTION_TYPE_NAME, kls=Intervention ) - + @router.put( @@ -126,7 +126,7 @@ async def interventions_id_get( response_model_by_alias=True, ) async def interventions_id_put( - id: str = Path(None, description="The ID of the Intervention to be retrieved"), + id: str = Path( description="The ID of the Intervention to be retrieved"), user: str = Query(None, description="Username"), intervention: Intervention = Body(None, description="An old Interventionto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def interventions_id_put( ), ) -> Intervention: """Updates an existing Intervention (more information in https://w3id.org/okn/o/sdm#Intervention)""" - + await FastAPICache.clear(namespace="Intervention") return query_manager.put_resource( id=id, user=user, body=intervention, rdf_type_uri=INTERVENTION_TYPE_URI, - rdf_type_name=INTERVENTION_TYPE_NAME, + rdf_type_name=INTERVENTION_TYPE_NAME, kls=Intervention ) - + @router.post( @@ -164,14 +164,14 @@ async def interventions_post( ), ) -> Intervention: """Create a new instance of Intervention (more information in https://w3id.org/okn/o/sdm#Intervention)""" - + await FastAPICache.clear(namespace="Intervention") return query_manager.post_resource( - + user=user, body=intervention, rdf_type_uri=INTERVENTION_TYPE_URI, - rdf_type_name=INTERVENTION_TYPE_NAME, + rdf_type_name=INTERVENTION_TYPE_NAME, kls=Intervention ) - + diff --git a/src/openapi_server/apis/model_api.py b/src/openapi_server/apis/model_api.py index fd8c1da..74a4550 100644 --- a/src/openapi_server/apis/model_api.py +++ b/src/openapi_server/apis/model_api.py @@ -44,16 +44,16 @@ async def custom_model_index_get( username: str = Query(None, description="Username to query"), ) -> List[Model]: """Gets the details of a single instance of a Model""" - + return query_manager.get_resource( - + custom_query_name=custom_query_name,username=username,label=label, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.get( @@ -72,16 +72,16 @@ async def custom_model_intervention_get( username: str = Query(None, description="Username to query"), ) -> List[Model]: """Gets the details of a single instance of a Model""" - + return query_manager.get_resource( - + custom_query_name=custom_query_name,username=username,label=label, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.get( @@ -100,16 +100,16 @@ async def custom_model_region_get( username: str = Query(None, description="Username to query"), ) -> List[Model]: """Gets the details of a single instance of a Model""" - + return query_manager.get_resource( - + custom_query_name=custom_query_name,username=username,label=label, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.get( @@ -128,16 +128,16 @@ async def custom_models_standard_variable_get( username: str = Query(None, description="Username to query"), ) -> List[Model]: """Gets a list of model filter by the label of a standard variable""" - + return query_manager.get_resource( - + custom_query_name=custom_query_name,username=username,label=label, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.get( @@ -156,16 +156,16 @@ async def custom_models_variable_get( username: str = Query(None, description="Username to query"), ) -> List[Model]: """Get models by variable name""" - + return query_manager.get_resource( - + custom_query_name=custom_query_name,username=username,label=label, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.get( @@ -185,16 +185,16 @@ async def models_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Model]: """Gets a list of all instances of Model (more information in https://w3id.org/okn/o/sdm#Model)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.delete( @@ -208,24 +208,24 @@ async def models_get( response_model_by_alias=True, ) async def models_id_delete( - id: str = Path(None, description="The ID of the Model to be retrieved"), + id: str = Path( description="The ID of the Model to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Model (more information in https://w3id.org/okn/o/sdm#Model)""" - + await FastAPICache.clear(namespace="Model") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.get( @@ -239,20 +239,20 @@ async def models_id_delete( ) @cache(namespace="Model", expire=1800) async def models_id_get( - id: str = Path(None, description="The ID of the Model to be retrieved"), + id: str = Path( description="The ID of the Model to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Model: """Gets the details of a given Model (more information in https://w3id.org/okn/o/sdm#Model)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.put( @@ -266,7 +266,7 @@ async def models_id_get( response_model_by_alias=True, ) async def models_id_put( - id: str = Path(None, description="The ID of the Model to be retrieved"), + id: str = Path( description="The ID of the Model to be retrieved"), user: str = Query(None, description="Username"), model: Model = Body(None, description="An old Modelto be updated"), token_BearerAuth: TokenModel = Security( @@ -274,17 +274,17 @@ async def models_id_put( ), ) -> Model: """Updates an existing Model (more information in https://w3id.org/okn/o/sdm#Model)""" - + await FastAPICache.clear(namespace="Model") return query_manager.put_resource( id=id, user=user, body=model, rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + @router.post( @@ -304,14 +304,14 @@ async def models_post( ), ) -> Model: """Create a new instance of Model (more information in https://w3id.org/okn/o/sdm#Model)""" - + await FastAPICache.clear(namespace="Model") return query_manager.post_resource( - + user=user, body=model, rdf_type_uri=MODEL_TYPE_URI, - rdf_type_name=MODEL_TYPE_NAME, + rdf_type_name=MODEL_TYPE_NAME, kls=Model ) - + diff --git a/src/openapi_server/apis/model_category_api.py b/src/openapi_server/apis/model_category_api.py index 5172d4a..b457d49 100644 --- a/src/openapi_server/apis/model_category_api.py +++ b/src/openapi_server/apis/model_category_api.py @@ -45,16 +45,16 @@ async def modelcategorys_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[ModelCategory]: """Gets a list of all instances of ModelCategory (more information in https://w3id.org/okn/o/sdm#ModelCategory)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=MODELCATEGORY_TYPE_URI, - rdf_type_name=MODELCATEGORY_TYPE_NAME, + rdf_type_name=MODELCATEGORY_TYPE_NAME, kls=ModelCategory ) - + @router.delete( @@ -68,24 +68,24 @@ async def modelcategorys_get( response_model_by_alias=True, ) async def modelcategorys_id_delete( - id: str = Path(None, description="The ID of the ModelCategory to be retrieved"), + id: str = Path( description="The ID of the ModelCategory to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing ModelCategory (more information in https://w3id.org/okn/o/sdm#ModelCategory)""" - + await FastAPICache.clear(namespace="ModelCategory") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=MODELCATEGORY_TYPE_URI, - rdf_type_name=MODELCATEGORY_TYPE_NAME, + rdf_type_name=MODELCATEGORY_TYPE_NAME, kls=ModelCategory ) - + @router.get( @@ -99,20 +99,20 @@ async def modelcategorys_id_delete( ) @cache(namespace="ModelCategory", expire=1800) async def modelcategorys_id_get( - id: str = Path(None, description="The ID of the ModelCategory to be retrieved"), + id: str = Path( description="The ID of the ModelCategory to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> ModelCategory: """Gets the details of a given ModelCategory (more information in https://w3id.org/okn/o/sdm#ModelCategory)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=MODELCATEGORY_TYPE_URI, - rdf_type_name=MODELCATEGORY_TYPE_NAME, + rdf_type_name=MODELCATEGORY_TYPE_NAME, kls=ModelCategory ) - + @router.put( @@ -126,7 +126,7 @@ async def modelcategorys_id_get( response_model_by_alias=True, ) async def modelcategorys_id_put( - id: str = Path(None, description="The ID of the ModelCategory to be retrieved"), + id: str = Path( description="The ID of the ModelCategory to be retrieved"), user: str = Query(None, description="Username"), model_category: ModelCategory = Body(None, description="An old ModelCategoryto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def modelcategorys_id_put( ), ) -> ModelCategory: """Updates an existing ModelCategory (more information in https://w3id.org/okn/o/sdm#ModelCategory)""" - + await FastAPICache.clear(namespace="ModelCategory") return query_manager.put_resource( id=id, user=user, body=model_category, rdf_type_uri=MODELCATEGORY_TYPE_URI, - rdf_type_name=MODELCATEGORY_TYPE_NAME, + rdf_type_name=MODELCATEGORY_TYPE_NAME, kls=ModelCategory ) - + @router.post( @@ -164,14 +164,14 @@ async def modelcategorys_post( ), ) -> ModelCategory: """Create a new instance of ModelCategory (more information in https://w3id.org/okn/o/sdm#ModelCategory)""" - + await FastAPICache.clear(namespace="ModelCategory") return query_manager.post_resource( - + user=user, body=model_category, rdf_type_uri=MODELCATEGORY_TYPE_URI, - rdf_type_name=MODELCATEGORY_TYPE_NAME, + rdf_type_name=MODELCATEGORY_TYPE_NAME, kls=ModelCategory ) - + diff --git a/src/openapi_server/apis/model_configuration_api.py b/src/openapi_server/apis/model_configuration_api.py index 6cc403f..f4c521b 100644 --- a/src/openapi_server/apis/model_configuration_api.py +++ b/src/openapi_server/apis/model_configuration_api.py @@ -39,21 +39,21 @@ ) @cache(namespace="ModelConfiguration", expire=1800) async def custom_modelconfigurations_id_get( - id: str = Path(None, description="The ID of the resource"), + id: str = Path( description="The ID of the resource"), username: str = Query(None, description="Username to query"), custom_query_name: str = Query("custom_modelconfigurations", description="Name of the custom query"), ) -> ModelConfiguration: """Gets the details of a single instance of a ModelConfiguration""" - + return query_manager.get_resource( id=id, username=username,custom_query_name=custom_query_name, - + rdf_type_uri=MODELCONFIGURATION_TYPE_URI, - rdf_type_name=MODELCONFIGURATION_TYPE_NAME, + rdf_type_name=MODELCONFIGURATION_TYPE_NAME, kls=ModelConfiguration ) - + @router.get( @@ -73,16 +73,16 @@ async def modelconfigurations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[ModelConfiguration]: """Gets a list of all instances of ModelConfiguration (more information in https://w3id.org/okn/o/sdm#ModelConfiguration)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=MODELCONFIGURATION_TYPE_URI, - rdf_type_name=MODELCONFIGURATION_TYPE_NAME, + rdf_type_name=MODELCONFIGURATION_TYPE_NAME, kls=ModelConfiguration ) - + @router.delete( @@ -96,24 +96,24 @@ async def modelconfigurations_get( response_model_by_alias=True, ) async def modelconfigurations_id_delete( - id: str = Path(None, description="The ID of the ModelConfiguration to be retrieved"), + id: str = Path( description="The ID of the ModelConfiguration to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing ModelConfiguration (more information in https://w3id.org/okn/o/sdm#ModelConfiguration)""" - + await FastAPICache.clear(namespace="ModelConfiguration") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=MODELCONFIGURATION_TYPE_URI, - rdf_type_name=MODELCONFIGURATION_TYPE_NAME, + rdf_type_name=MODELCONFIGURATION_TYPE_NAME, kls=ModelConfiguration ) - + @router.get( @@ -127,20 +127,20 @@ async def modelconfigurations_id_delete( ) @cache(namespace="ModelConfiguration", expire=1800) async def modelconfigurations_id_get( - id: str = Path(None, description="The ID of the ModelConfiguration to be retrieved"), + id: str = Path( description="The ID of the ModelConfiguration to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> ModelConfiguration: """Gets the details of a given ModelConfiguration (more information in https://w3id.org/okn/o/sdm#ModelConfiguration)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=MODELCONFIGURATION_TYPE_URI, - rdf_type_name=MODELCONFIGURATION_TYPE_NAME, + rdf_type_name=MODELCONFIGURATION_TYPE_NAME, kls=ModelConfiguration ) - + @router.put( @@ -154,7 +154,7 @@ async def modelconfigurations_id_get( response_model_by_alias=True, ) async def modelconfigurations_id_put( - id: str = Path(None, description="The ID of the ModelConfiguration to be retrieved"), + id: str = Path( description="The ID of the ModelConfiguration to be retrieved"), user: str = Query(None, description="Username"), model_configuration: ModelConfiguration = Body(None, description="An old ModelConfigurationto be updated"), token_BearerAuth: TokenModel = Security( @@ -162,17 +162,17 @@ async def modelconfigurations_id_put( ), ) -> ModelConfiguration: """Updates an existing ModelConfiguration (more information in https://w3id.org/okn/o/sdm#ModelConfiguration)""" - + await FastAPICache.clear(namespace="ModelConfiguration") return query_manager.put_resource( id=id, user=user, body=model_configuration, rdf_type_uri=MODELCONFIGURATION_TYPE_URI, - rdf_type_name=MODELCONFIGURATION_TYPE_NAME, + rdf_type_name=MODELCONFIGURATION_TYPE_NAME, kls=ModelConfiguration ) - + @router.post( @@ -192,14 +192,14 @@ async def modelconfigurations_post( ), ) -> ModelConfiguration: """Create a new instance of ModelConfiguration (more information in https://w3id.org/okn/o/sdm#ModelConfiguration)""" - + await FastAPICache.clear(namespace="ModelConfiguration") return query_manager.post_resource( - + user=user, body=model_configuration, rdf_type_uri=MODELCONFIGURATION_TYPE_URI, - rdf_type_name=MODELCONFIGURATION_TYPE_NAME, + rdf_type_name=MODELCONFIGURATION_TYPE_NAME, kls=ModelConfiguration ) - + diff --git a/src/openapi_server/apis/model_configuration_setup_api.py b/src/openapi_server/apis/model_configuration_setup_api.py index ab70b02..cf7935a 100644 --- a/src/openapi_server/apis/model_configuration_setup_api.py +++ b/src/openapi_server/apis/model_configuration_setup_api.py @@ -39,21 +39,21 @@ ) @cache(namespace="ModelConfigurationSetup", expire=1800) async def custom_modelconfigurationsetups_id_get( - id: str = Path(None, description="The ID of the resource"), + id: str = Path( description="The ID of the resource"), username: str = Query(None, description="Username to query"), custom_query_name: str = Query("custom_modelconfigurationsetups", description="Name of the custom query"), ) -> ModelConfigurationSetup: """Gets the details of a single instance of a ModelConfigurationSetup""" - + return query_manager.get_resource( id=id, username=username,custom_query_name=custom_query_name, - + rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + @router.get( @@ -72,16 +72,16 @@ async def custom_modelconfigurationsetups_variable_get( username: str = Query(None, description="Username to query"), ) -> List[ModelConfigurationSetup]: """Get model configurations by variable name""" - + return query_manager.get_resource( - + custom_query_name=custom_query_name,username=username,label=label, - + rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + @router.get( @@ -101,16 +101,16 @@ async def modelconfigurationsetups_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[ModelConfigurationSetup]: """Gets a list of all instances of ModelConfigurationSetup (more information in https://w3id.org/okn/o/sdm#ModelConfigurationSetup)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + @router.delete( @@ -124,24 +124,24 @@ async def modelconfigurationsetups_get( response_model_by_alias=True, ) async def modelconfigurationsetups_id_delete( - id: str = Path(None, description="The ID of the ModelConfigurationSetup to be retrieved"), + id: str = Path( description="The ID of the ModelConfigurationSetup to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing ModelConfigurationSetup (more information in https://w3id.org/okn/o/sdm#ModelConfigurationSetup)""" - + await FastAPICache.clear(namespace="ModelConfigurationSetup") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + @router.get( @@ -155,20 +155,20 @@ async def modelconfigurationsetups_id_delete( ) @cache(namespace="ModelConfigurationSetup", expire=1800) async def modelconfigurationsetups_id_get( - id: str = Path(None, description="The ID of the ModelConfigurationSetup to be retrieved"), + id: str = Path( description="The ID of the ModelConfigurationSetup to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> ModelConfigurationSetup: """Gets the details of a given ModelConfigurationSetup (more information in https://w3id.org/okn/o/sdm#ModelConfigurationSetup)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + @router.put( @@ -182,7 +182,7 @@ async def modelconfigurationsetups_id_get( response_model_by_alias=True, ) async def modelconfigurationsetups_id_put( - id: str = Path(None, description="The ID of the ModelConfigurationSetup to be retrieved"), + id: str = Path( description="The ID of the ModelConfigurationSetup to be retrieved"), user: str = Query(None, description="Username"), model_configuration_setup: ModelConfigurationSetup = Body(None, description="An old ModelConfigurationSetupto be updated"), token_BearerAuth: TokenModel = Security( @@ -190,17 +190,17 @@ async def modelconfigurationsetups_id_put( ), ) -> ModelConfigurationSetup: """Updates an existing ModelConfigurationSetup (more information in https://w3id.org/okn/o/sdm#ModelConfigurationSetup)""" - + await FastAPICache.clear(namespace="ModelConfigurationSetup") return query_manager.put_resource( id=id, user=user, body=model_configuration_setup, rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + @router.post( @@ -220,14 +220,14 @@ async def modelconfigurationsetups_post( ), ) -> ModelConfigurationSetup: """Create a new instance of ModelConfigurationSetup (more information in https://w3id.org/okn/o/sdm#ModelConfigurationSetup)""" - + await FastAPICache.clear(namespace="ModelConfigurationSetup") return query_manager.post_resource( - + user=user, body=model_configuration_setup, rdf_type_uri=MODELCONFIGURATIONSETUP_TYPE_URI, - rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, + rdf_type_name=MODELCONFIGURATIONSETUP_TYPE_NAME, kls=ModelConfigurationSetup ) - + diff --git a/src/openapi_server/apis/numerical_index_api.py b/src/openapi_server/apis/numerical_index_api.py index 4990dd1..23f9360 100644 --- a/src/openapi_server/apis/numerical_index_api.py +++ b/src/openapi_server/apis/numerical_index_api.py @@ -45,16 +45,16 @@ async def numericalindexs_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[NumericalIndex]: """Gets a list of all instances of NumericalIndex (more information in https://w3id.org/okn/o/sd#NumericalIndex)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=NUMERICALINDEX_TYPE_URI, - rdf_type_name=NUMERICALINDEX_TYPE_NAME, + rdf_type_name=NUMERICALINDEX_TYPE_NAME, kls=NumericalIndex ) - + @router.delete( @@ -68,24 +68,24 @@ async def numericalindexs_get( response_model_by_alias=True, ) async def numericalindexs_id_delete( - id: str = Path(None, description="The ID of the NumericalIndex to be retrieved"), + id: str = Path( description="The ID of the NumericalIndex to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing NumericalIndex (more information in https://w3id.org/okn/o/sd#NumericalIndex)""" - + await FastAPICache.clear(namespace="NumericalIndex") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=NUMERICALINDEX_TYPE_URI, - rdf_type_name=NUMERICALINDEX_TYPE_NAME, + rdf_type_name=NUMERICALINDEX_TYPE_NAME, kls=NumericalIndex ) - + @router.get( @@ -99,20 +99,20 @@ async def numericalindexs_id_delete( ) @cache(namespace="NumericalIndex", expire=1800) async def numericalindexs_id_get( - id: str = Path(None, description="The ID of the NumericalIndex to be retrieved"), + id: str = Path( description="The ID of the NumericalIndex to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> NumericalIndex: """Gets the details of a given NumericalIndex (more information in https://w3id.org/okn/o/sd#NumericalIndex)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=NUMERICALINDEX_TYPE_URI, - rdf_type_name=NUMERICALINDEX_TYPE_NAME, + rdf_type_name=NUMERICALINDEX_TYPE_NAME, kls=NumericalIndex ) - + @router.put( @@ -126,7 +126,7 @@ async def numericalindexs_id_get( response_model_by_alias=True, ) async def numericalindexs_id_put( - id: str = Path(None, description="The ID of the NumericalIndex to be retrieved"), + id: str = Path( description="The ID of the NumericalIndex to be retrieved"), user: str = Query(None, description="Username"), numerical_index: NumericalIndex = Body(None, description="An old NumericalIndexto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def numericalindexs_id_put( ), ) -> NumericalIndex: """Updates an existing NumericalIndex (more information in https://w3id.org/okn/o/sd#NumericalIndex)""" - + await FastAPICache.clear(namespace="NumericalIndex") return query_manager.put_resource( id=id, user=user, body=numerical_index, rdf_type_uri=NUMERICALINDEX_TYPE_URI, - rdf_type_name=NUMERICALINDEX_TYPE_NAME, + rdf_type_name=NUMERICALINDEX_TYPE_NAME, kls=NumericalIndex ) - + @router.post( @@ -164,14 +164,14 @@ async def numericalindexs_post( ), ) -> NumericalIndex: """Create a new instance of NumericalIndex (more information in https://w3id.org/okn/o/sd#NumericalIndex)""" - + await FastAPICache.clear(namespace="NumericalIndex") return query_manager.post_resource( - + user=user, body=numerical_index, rdf_type_uri=NUMERICALINDEX_TYPE_URI, - rdf_type_name=NUMERICALINDEX_TYPE_NAME, + rdf_type_name=NUMERICALINDEX_TYPE_NAME, kls=NumericalIndex ) - + diff --git a/src/openapi_server/apis/organization_api.py b/src/openapi_server/apis/organization_api.py index 404555a..989b0fd 100644 --- a/src/openapi_server/apis/organization_api.py +++ b/src/openapi_server/apis/organization_api.py @@ -45,16 +45,16 @@ async def organizations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Organization]: """Gets a list of all instances of Organization (more information in https://w3id.org/okn/o/sd#Organization)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=ORGANIZATION_TYPE_URI, - rdf_type_name=ORGANIZATION_TYPE_NAME, + rdf_type_name=ORGANIZATION_TYPE_NAME, kls=Organization ) - + @router.delete( @@ -68,24 +68,24 @@ async def organizations_get( response_model_by_alias=True, ) async def organizations_id_delete( - id: str = Path(None, description="The ID of the Organization to be retrieved"), + id: str = Path( description="The ID of the Organization to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Organization (more information in https://w3id.org/okn/o/sd#Organization)""" - + await FastAPICache.clear(namespace="Organization") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=ORGANIZATION_TYPE_URI, - rdf_type_name=ORGANIZATION_TYPE_NAME, + rdf_type_name=ORGANIZATION_TYPE_NAME, kls=Organization ) - + @router.get( @@ -99,20 +99,20 @@ async def organizations_id_delete( ) @cache(namespace="Organization", expire=1800) async def organizations_id_get( - id: str = Path(None, description="The ID of the Organization to be retrieved"), + id: str = Path( description="The ID of the Organization to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Organization: """Gets the details of a given Organization (more information in https://w3id.org/okn/o/sd#Organization)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=ORGANIZATION_TYPE_URI, - rdf_type_name=ORGANIZATION_TYPE_NAME, + rdf_type_name=ORGANIZATION_TYPE_NAME, kls=Organization ) - + @router.put( @@ -126,7 +126,7 @@ async def organizations_id_get( response_model_by_alias=True, ) async def organizations_id_put( - id: str = Path(None, description="The ID of the Organization to be retrieved"), + id: str = Path( description="The ID of the Organization to be retrieved"), user: str = Query(None, description="Username"), organization: Organization = Body(None, description="An old Organizationto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def organizations_id_put( ), ) -> Organization: """Updates an existing Organization (more information in https://w3id.org/okn/o/sd#Organization)""" - + await FastAPICache.clear(namespace="Organization") return query_manager.put_resource( id=id, user=user, body=organization, rdf_type_uri=ORGANIZATION_TYPE_URI, - rdf_type_name=ORGANIZATION_TYPE_NAME, + rdf_type_name=ORGANIZATION_TYPE_NAME, kls=Organization ) - + @router.post( @@ -164,14 +164,14 @@ async def organizations_post( ), ) -> Organization: """Create a new instance of Organization (more information in https://w3id.org/okn/o/sd#Organization)""" - + await FastAPICache.clear(namespace="Organization") return query_manager.post_resource( - + user=user, body=organization, rdf_type_uri=ORGANIZATION_TYPE_URI, - rdf_type_name=ORGANIZATION_TYPE_NAME, + rdf_type_name=ORGANIZATION_TYPE_NAME, kls=Organization ) - + diff --git a/src/openapi_server/apis/parameter_api.py b/src/openapi_server/apis/parameter_api.py index b2dabc5..9e9c2cf 100644 --- a/src/openapi_server/apis/parameter_api.py +++ b/src/openapi_server/apis/parameter_api.py @@ -45,16 +45,16 @@ async def parameters_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Parameter]: """Gets a list of all instances of Parameter (more information in https://w3id.org/okn/o/sd#Parameter)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=PARAMETER_TYPE_URI, - rdf_type_name=PARAMETER_TYPE_NAME, + rdf_type_name=PARAMETER_TYPE_NAME, kls=Parameter ) - + @router.delete( @@ -68,24 +68,24 @@ async def parameters_get( response_model_by_alias=True, ) async def parameters_id_delete( - id: str = Path(None, description="The ID of the Parameter to be retrieved"), + id: str = Path( description="The ID of the Parameter to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Parameter (more information in https://w3id.org/okn/o/sd#Parameter)""" - + await FastAPICache.clear(namespace="Parameter") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=PARAMETER_TYPE_URI, - rdf_type_name=PARAMETER_TYPE_NAME, + rdf_type_name=PARAMETER_TYPE_NAME, kls=Parameter ) - + @router.get( @@ -99,20 +99,20 @@ async def parameters_id_delete( ) @cache(namespace="Parameter", expire=1800) async def parameters_id_get( - id: str = Path(None, description="The ID of the Parameter to be retrieved"), + id: str = Path( description="The ID of the Parameter to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Parameter: """Gets the details of a given Parameter (more information in https://w3id.org/okn/o/sd#Parameter)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=PARAMETER_TYPE_URI, - rdf_type_name=PARAMETER_TYPE_NAME, + rdf_type_name=PARAMETER_TYPE_NAME, kls=Parameter ) - + @router.put( @@ -126,7 +126,7 @@ async def parameters_id_get( response_model_by_alias=True, ) async def parameters_id_put( - id: str = Path(None, description="The ID of the Parameter to be retrieved"), + id: str = Path( description="The ID of the Parameter to be retrieved"), user: str = Query(None, description="Username"), parameter: Parameter = Body(None, description="An old Parameterto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def parameters_id_put( ), ) -> Parameter: """Updates an existing Parameter (more information in https://w3id.org/okn/o/sd#Parameter)""" - + await FastAPICache.clear(namespace="Parameter") return query_manager.put_resource( id=id, user=user, body=parameter, rdf_type_uri=PARAMETER_TYPE_URI, - rdf_type_name=PARAMETER_TYPE_NAME, + rdf_type_name=PARAMETER_TYPE_NAME, kls=Parameter ) - + @router.post( @@ -164,14 +164,14 @@ async def parameters_post( ), ) -> Parameter: """Create a new instance of Parameter (more information in https://w3id.org/okn/o/sd#Parameter)""" - + await FastAPICache.clear(namespace="Parameter") return query_manager.post_resource( - + user=user, body=parameter, rdf_type_uri=PARAMETER_TYPE_URI, - rdf_type_name=PARAMETER_TYPE_NAME, + rdf_type_name=PARAMETER_TYPE_NAME, kls=Parameter ) - + diff --git a/src/openapi_server/apis/person_api.py b/src/openapi_server/apis/person_api.py index a750190..e028152 100644 --- a/src/openapi_server/apis/person_api.py +++ b/src/openapi_server/apis/person_api.py @@ -45,16 +45,16 @@ async def persons_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Person]: """Gets a list of all instances of Person (more information in https://w3id.org/okn/o/sd#Person)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=PERSON_TYPE_URI, - rdf_type_name=PERSON_TYPE_NAME, + rdf_type_name=PERSON_TYPE_NAME, kls=Person ) - + @router.delete( @@ -68,24 +68,24 @@ async def persons_get( response_model_by_alias=True, ) async def persons_id_delete( - id: str = Path(None, description="The ID of the Person to be retrieved"), + id: str = Path( description="The ID of the Person to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Person (more information in https://w3id.org/okn/o/sd#Person)""" - + await FastAPICache.clear(namespace="Person") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=PERSON_TYPE_URI, - rdf_type_name=PERSON_TYPE_NAME, + rdf_type_name=PERSON_TYPE_NAME, kls=Person ) - + @router.get( @@ -99,20 +99,20 @@ async def persons_id_delete( ) @cache(namespace="Person", expire=1800) async def persons_id_get( - id: str = Path(None, description="The ID of the Person to be retrieved"), + id: str = Path( description="The ID of the Person to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Person: """Gets the details of a given Person (more information in https://w3id.org/okn/o/sd#Person)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=PERSON_TYPE_URI, - rdf_type_name=PERSON_TYPE_NAME, + rdf_type_name=PERSON_TYPE_NAME, kls=Person ) - + @router.put( @@ -126,7 +126,7 @@ async def persons_id_get( response_model_by_alias=True, ) async def persons_id_put( - id: str = Path(None, description="The ID of the Person to be retrieved"), + id: str = Path( description="The ID of the Person to be retrieved"), user: str = Query(None, description="Username"), person: Person = Body(None, description="An old Personto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def persons_id_put( ), ) -> Person: """Updates an existing Person (more information in https://w3id.org/okn/o/sd#Person)""" - + await FastAPICache.clear(namespace="Person") return query_manager.put_resource( id=id, user=user, body=person, rdf_type_uri=PERSON_TYPE_URI, - rdf_type_name=PERSON_TYPE_NAME, + rdf_type_name=PERSON_TYPE_NAME, kls=Person ) - + @router.post( @@ -164,14 +164,14 @@ async def persons_post( ), ) -> Person: """Create a new instance of Person (more information in https://w3id.org/okn/o/sd#Person)""" - + await FastAPICache.clear(namespace="Person") return query_manager.post_resource( - + user=user, body=person, rdf_type_uri=PERSON_TYPE_URI, - rdf_type_name=PERSON_TYPE_NAME, + rdf_type_name=PERSON_TYPE_NAME, kls=Person ) - + diff --git a/src/openapi_server/apis/point_based_grid_api.py b/src/openapi_server/apis/point_based_grid_api.py index eefca39..517d218 100644 --- a/src/openapi_server/apis/point_based_grid_api.py +++ b/src/openapi_server/apis/point_based_grid_api.py @@ -45,16 +45,16 @@ async def pointbasedgrids_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[PointBasedGrid]: """Gets a list of all instances of PointBasedGrid (more information in https://w3id.org/okn/o/sdm#PointBasedGrid)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=POINTBASEDGRID_TYPE_URI, - rdf_type_name=POINTBASEDGRID_TYPE_NAME, + rdf_type_name=POINTBASEDGRID_TYPE_NAME, kls=PointBasedGrid ) - + @router.delete( @@ -68,24 +68,24 @@ async def pointbasedgrids_get( response_model_by_alias=True, ) async def pointbasedgrids_id_delete( - id: str = Path(None, description="The ID of the PointBasedGrid to be retrieved"), + id: str = Path( description="The ID of the PointBasedGrid to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing PointBasedGrid (more information in https://w3id.org/okn/o/sdm#PointBasedGrid)""" - + await FastAPICache.clear(namespace="PointBasedGrid") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=POINTBASEDGRID_TYPE_URI, - rdf_type_name=POINTBASEDGRID_TYPE_NAME, + rdf_type_name=POINTBASEDGRID_TYPE_NAME, kls=PointBasedGrid ) - + @router.get( @@ -99,20 +99,20 @@ async def pointbasedgrids_id_delete( ) @cache(namespace="PointBasedGrid", expire=1800) async def pointbasedgrids_id_get( - id: str = Path(None, description="The ID of the PointBasedGrid to be retrieved"), + id: str = Path( description="The ID of the PointBasedGrid to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> PointBasedGrid: """Gets the details of a given PointBasedGrid (more information in https://w3id.org/okn/o/sdm#PointBasedGrid)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=POINTBASEDGRID_TYPE_URI, - rdf_type_name=POINTBASEDGRID_TYPE_NAME, + rdf_type_name=POINTBASEDGRID_TYPE_NAME, kls=PointBasedGrid ) - + @router.put( @@ -126,7 +126,7 @@ async def pointbasedgrids_id_get( response_model_by_alias=True, ) async def pointbasedgrids_id_put( - id: str = Path(None, description="The ID of the PointBasedGrid to be retrieved"), + id: str = Path( description="The ID of the PointBasedGrid to be retrieved"), user: str = Query(None, description="Username"), point_based_grid: PointBasedGrid = Body(None, description="An old PointBasedGridto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def pointbasedgrids_id_put( ), ) -> PointBasedGrid: """Updates an existing PointBasedGrid (more information in https://w3id.org/okn/o/sdm#PointBasedGrid)""" - + await FastAPICache.clear(namespace="PointBasedGrid") return query_manager.put_resource( id=id, user=user, body=point_based_grid, rdf_type_uri=POINTBASEDGRID_TYPE_URI, - rdf_type_name=POINTBASEDGRID_TYPE_NAME, + rdf_type_name=POINTBASEDGRID_TYPE_NAME, kls=PointBasedGrid ) - + @router.post( @@ -164,14 +164,14 @@ async def pointbasedgrids_post( ), ) -> PointBasedGrid: """Create a new instance of PointBasedGrid (more information in https://w3id.org/okn/o/sdm#PointBasedGrid)""" - + await FastAPICache.clear(namespace="PointBasedGrid") return query_manager.post_resource( - + user=user, body=point_based_grid, rdf_type_uri=POINTBASEDGRID_TYPE_URI, - rdf_type_name=POINTBASEDGRID_TYPE_NAME, + rdf_type_name=POINTBASEDGRID_TYPE_NAME, kls=PointBasedGrid ) - + diff --git a/src/openapi_server/apis/process_api.py b/src/openapi_server/apis/process_api.py index 4cf095d..6c71a76 100644 --- a/src/openapi_server/apis/process_api.py +++ b/src/openapi_server/apis/process_api.py @@ -45,16 +45,16 @@ async def processs_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Process]: """Gets a list of all instances of Process (more information in https://w3id.org/okn/o/sdm#Process)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=PROCESS_TYPE_URI, - rdf_type_name=PROCESS_TYPE_NAME, + rdf_type_name=PROCESS_TYPE_NAME, kls=Process ) - + @router.delete( @@ -68,24 +68,24 @@ async def processs_get( response_model_by_alias=True, ) async def processs_id_delete( - id: str = Path(None, description="The ID of the Process to be retrieved"), + id: str = Path( description="The ID of the Process to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Process (more information in https://w3id.org/okn/o/sdm#Process)""" - + await FastAPICache.clear(namespace="Process") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=PROCESS_TYPE_URI, - rdf_type_name=PROCESS_TYPE_NAME, + rdf_type_name=PROCESS_TYPE_NAME, kls=Process ) - + @router.get( @@ -99,20 +99,20 @@ async def processs_id_delete( ) @cache(namespace="Process", expire=1800) async def processs_id_get( - id: str = Path(None, description="The ID of the Process to be retrieved"), + id: str = Path( description="The ID of the Process to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Process: """Gets the details of a given Process (more information in https://w3id.org/okn/o/sdm#Process)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=PROCESS_TYPE_URI, - rdf_type_name=PROCESS_TYPE_NAME, + rdf_type_name=PROCESS_TYPE_NAME, kls=Process ) - + @router.put( @@ -126,7 +126,7 @@ async def processs_id_get( response_model_by_alias=True, ) async def processs_id_put( - id: str = Path(None, description="The ID of the Process to be retrieved"), + id: str = Path( description="The ID of the Process to be retrieved"), user: str = Query(None, description="Username"), process: Process = Body(None, description="An old Processto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def processs_id_put( ), ) -> Process: """Updates an existing Process (more information in https://w3id.org/okn/o/sdm#Process)""" - + await FastAPICache.clear(namespace="Process") return query_manager.put_resource( id=id, user=user, body=process, rdf_type_uri=PROCESS_TYPE_URI, - rdf_type_name=PROCESS_TYPE_NAME, + rdf_type_name=PROCESS_TYPE_NAME, kls=Process ) - + @router.post( @@ -164,14 +164,14 @@ async def processs_post( ), ) -> Process: """Create a new instance of Process (more information in https://w3id.org/okn/o/sdm#Process)""" - + await FastAPICache.clear(namespace="Process") return query_manager.post_resource( - + user=user, body=process, rdf_type_uri=PROCESS_TYPE_URI, - rdf_type_name=PROCESS_TYPE_NAME, + rdf_type_name=PROCESS_TYPE_NAME, kls=Process ) - + diff --git a/src/openapi_server/apis/region_api.py b/src/openapi_server/apis/region_api.py index 8babbcb..6f02a4a 100644 --- a/src/openapi_server/apis/region_api.py +++ b/src/openapi_server/apis/region_api.py @@ -45,16 +45,16 @@ async def regions_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Region]: """Gets a list of all instances of Region (more information in https://w3id.org/okn/o/sdm#Region)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=REGION_TYPE_URI, - rdf_type_name=REGION_TYPE_NAME, + rdf_type_name=REGION_TYPE_NAME, kls=Region ) - + @router.delete( @@ -68,24 +68,24 @@ async def regions_get( response_model_by_alias=True, ) async def regions_id_delete( - id: str = Path(None, description="The ID of the Region to be retrieved"), + id: str = Path( description="The ID of the Region to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Region (more information in https://w3id.org/okn/o/sdm#Region)""" - + await FastAPICache.clear(namespace="Region") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=REGION_TYPE_URI, - rdf_type_name=REGION_TYPE_NAME, + rdf_type_name=REGION_TYPE_NAME, kls=Region ) - + @router.get( @@ -99,20 +99,20 @@ async def regions_id_delete( ) @cache(namespace="Region", expire=1800) async def regions_id_get( - id: str = Path(None, description="The ID of the Region to be retrieved"), + id: str = Path( description="The ID of the Region to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Region: """Gets the details of a given Region (more information in https://w3id.org/okn/o/sdm#Region)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=REGION_TYPE_URI, - rdf_type_name=REGION_TYPE_NAME, + rdf_type_name=REGION_TYPE_NAME, kls=Region ) - + @router.put( @@ -126,7 +126,7 @@ async def regions_id_get( response_model_by_alias=True, ) async def regions_id_put( - id: str = Path(None, description="The ID of the Region to be retrieved"), + id: str = Path( description="The ID of the Region to be retrieved"), user: str = Query(None, description="Username"), region: Region = Body(None, description="An old Regionto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def regions_id_put( ), ) -> Region: """Updates an existing Region (more information in https://w3id.org/okn/o/sdm#Region)""" - + await FastAPICache.clear(namespace="Region") return query_manager.put_resource( id=id, user=user, body=region, rdf_type_uri=REGION_TYPE_URI, - rdf_type_name=REGION_TYPE_NAME, + rdf_type_name=REGION_TYPE_NAME, kls=Region ) - + @router.post( @@ -164,14 +164,14 @@ async def regions_post( ), ) -> Region: """Create a new instance of Region (more information in https://w3id.org/okn/o/sdm#Region)""" - + await FastAPICache.clear(namespace="Region") return query_manager.post_resource( - + user=user, body=region, rdf_type_uri=REGION_TYPE_URI, - rdf_type_name=REGION_TYPE_NAME, + rdf_type_name=REGION_TYPE_NAME, kls=Region ) - + diff --git a/src/openapi_server/apis/sample_collection_api.py b/src/openapi_server/apis/sample_collection_api.py index 357f3f8..17711d4 100644 --- a/src/openapi_server/apis/sample_collection_api.py +++ b/src/openapi_server/apis/sample_collection_api.py @@ -45,16 +45,16 @@ async def samplecollections_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SampleCollection]: """Gets a list of all instances of SampleCollection (more information in https://w3id.org/okn/o/sd#SampleCollection)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SAMPLECOLLECTION_TYPE_URI, - rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, + rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, kls=SampleCollection ) - + @router.delete( @@ -68,24 +68,24 @@ async def samplecollections_get( response_model_by_alias=True, ) async def samplecollections_id_delete( - id: str = Path(None, description="The ID of the SampleCollection to be retrieved"), + id: str = Path( description="The ID of the SampleCollection to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SampleCollection (more information in https://w3id.org/okn/o/sd#SampleCollection)""" - + await FastAPICache.clear(namespace="SampleCollection") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SAMPLECOLLECTION_TYPE_URI, - rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, + rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, kls=SampleCollection ) - + @router.get( @@ -99,20 +99,20 @@ async def samplecollections_id_delete( ) @cache(namespace="SampleCollection", expire=1800) async def samplecollections_id_get( - id: str = Path(None, description="The ID of the SampleCollection to be retrieved"), + id: str = Path( description="The ID of the SampleCollection to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SampleCollection: """Gets the details of a given SampleCollection (more information in https://w3id.org/okn/o/sd#SampleCollection)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SAMPLECOLLECTION_TYPE_URI, - rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, + rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, kls=SampleCollection ) - + @router.put( @@ -126,7 +126,7 @@ async def samplecollections_id_get( response_model_by_alias=True, ) async def samplecollections_id_put( - id: str = Path(None, description="The ID of the SampleCollection to be retrieved"), + id: str = Path( description="The ID of the SampleCollection to be retrieved"), user: str = Query(None, description="Username"), sample_collection: SampleCollection = Body(None, description="An old SampleCollectionto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def samplecollections_id_put( ), ) -> SampleCollection: """Updates an existing SampleCollection (more information in https://w3id.org/okn/o/sd#SampleCollection)""" - + await FastAPICache.clear(namespace="SampleCollection") return query_manager.put_resource( id=id, user=user, body=sample_collection, rdf_type_uri=SAMPLECOLLECTION_TYPE_URI, - rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, + rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, kls=SampleCollection ) - + @router.post( @@ -164,14 +164,14 @@ async def samplecollections_post( ), ) -> SampleCollection: """Create a new instance of SampleCollection (more information in https://w3id.org/okn/o/sd#SampleCollection)""" - + await FastAPICache.clear(namespace="SampleCollection") return query_manager.post_resource( - + user=user, body=sample_collection, rdf_type_uri=SAMPLECOLLECTION_TYPE_URI, - rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, + rdf_type_name=SAMPLECOLLECTION_TYPE_NAME, kls=SampleCollection ) - + diff --git a/src/openapi_server/apis/sample_execution_api.py b/src/openapi_server/apis/sample_execution_api.py index 42f1765..0e91b81 100644 --- a/src/openapi_server/apis/sample_execution_api.py +++ b/src/openapi_server/apis/sample_execution_api.py @@ -45,16 +45,16 @@ async def sampleexecutions_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SampleExecution]: """Gets a list of all instances of SampleExecution (more information in https://w3id.org/okn/o/sd#SampleExecution)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SAMPLEEXECUTION_TYPE_URI, - rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, + rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, kls=SampleExecution ) - + @router.delete( @@ -68,24 +68,24 @@ async def sampleexecutions_get( response_model_by_alias=True, ) async def sampleexecutions_id_delete( - id: str = Path(None, description="The ID of the SampleExecution to be retrieved"), + id: str = Path( description="The ID of the SampleExecution to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SampleExecution (more information in https://w3id.org/okn/o/sd#SampleExecution)""" - + await FastAPICache.clear(namespace="SampleExecution") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SAMPLEEXECUTION_TYPE_URI, - rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, + rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, kls=SampleExecution ) - + @router.get( @@ -99,20 +99,20 @@ async def sampleexecutions_id_delete( ) @cache(namespace="SampleExecution", expire=1800) async def sampleexecutions_id_get( - id: str = Path(None, description="The ID of the SampleExecution to be retrieved"), + id: str = Path( description="The ID of the SampleExecution to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SampleExecution: """Gets the details of a given SampleExecution (more information in https://w3id.org/okn/o/sd#SampleExecution)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SAMPLEEXECUTION_TYPE_URI, - rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, + rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, kls=SampleExecution ) - + @router.put( @@ -126,7 +126,7 @@ async def sampleexecutions_id_get( response_model_by_alias=True, ) async def sampleexecutions_id_put( - id: str = Path(None, description="The ID of the SampleExecution to be retrieved"), + id: str = Path( description="The ID of the SampleExecution to be retrieved"), user: str = Query(None, description="Username"), sample_execution: SampleExecution = Body(None, description="An old SampleExecutionto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def sampleexecutions_id_put( ), ) -> SampleExecution: """Updates an existing SampleExecution (more information in https://w3id.org/okn/o/sd#SampleExecution)""" - + await FastAPICache.clear(namespace="SampleExecution") return query_manager.put_resource( id=id, user=user, body=sample_execution, rdf_type_uri=SAMPLEEXECUTION_TYPE_URI, - rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, + rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, kls=SampleExecution ) - + @router.post( @@ -164,14 +164,14 @@ async def sampleexecutions_post( ), ) -> SampleExecution: """Create a new instance of SampleExecution (more information in https://w3id.org/okn/o/sd#SampleExecution)""" - + await FastAPICache.clear(namespace="SampleExecution") return query_manager.post_resource( - + user=user, body=sample_execution, rdf_type_uri=SAMPLEEXECUTION_TYPE_URI, - rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, + rdf_type_name=SAMPLEEXECUTION_TYPE_NAME, kls=SampleExecution ) - + diff --git a/src/openapi_server/apis/sample_resource_api.py b/src/openapi_server/apis/sample_resource_api.py index 1bd431e..d29f635 100644 --- a/src/openapi_server/apis/sample_resource_api.py +++ b/src/openapi_server/apis/sample_resource_api.py @@ -45,16 +45,16 @@ async def sampleresources_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SampleResource]: """Gets a list of all instances of SampleResource (more information in https://w3id.org/okn/o/sd#SampleResource)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SAMPLERESOURCE_TYPE_URI, - rdf_type_name=SAMPLERESOURCE_TYPE_NAME, + rdf_type_name=SAMPLERESOURCE_TYPE_NAME, kls=SampleResource ) - + @router.delete( @@ -68,24 +68,24 @@ async def sampleresources_get( response_model_by_alias=True, ) async def sampleresources_id_delete( - id: str = Path(None, description="The ID of the SampleResource to be retrieved"), + id: str = Path( description="The ID of the SampleResource to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SampleResource (more information in https://w3id.org/okn/o/sd#SampleResource)""" - + await FastAPICache.clear(namespace="SampleResource") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SAMPLERESOURCE_TYPE_URI, - rdf_type_name=SAMPLERESOURCE_TYPE_NAME, + rdf_type_name=SAMPLERESOURCE_TYPE_NAME, kls=SampleResource ) - + @router.get( @@ -99,20 +99,20 @@ async def sampleresources_id_delete( ) @cache(namespace="SampleResource", expire=1800) async def sampleresources_id_get( - id: str = Path(None, description="The ID of the SampleResource to be retrieved"), + id: str = Path( description="The ID of the SampleResource to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SampleResource: """Gets the details of a given SampleResource (more information in https://w3id.org/okn/o/sd#SampleResource)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SAMPLERESOURCE_TYPE_URI, - rdf_type_name=SAMPLERESOURCE_TYPE_NAME, + rdf_type_name=SAMPLERESOURCE_TYPE_NAME, kls=SampleResource ) - + @router.put( @@ -126,7 +126,7 @@ async def sampleresources_id_get( response_model_by_alias=True, ) async def sampleresources_id_put( - id: str = Path(None, description="The ID of the SampleResource to be retrieved"), + id: str = Path( description="The ID of the SampleResource to be retrieved"), user: str = Query(None, description="Username"), sample_resource: SampleResource = Body(None, description="An old SampleResourceto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def sampleresources_id_put( ), ) -> SampleResource: """Updates an existing SampleResource (more information in https://w3id.org/okn/o/sd#SampleResource)""" - + await FastAPICache.clear(namespace="SampleResource") return query_manager.put_resource( id=id, user=user, body=sample_resource, rdf_type_uri=SAMPLERESOURCE_TYPE_URI, - rdf_type_name=SAMPLERESOURCE_TYPE_NAME, + rdf_type_name=SAMPLERESOURCE_TYPE_NAME, kls=SampleResource ) - + @router.post( @@ -164,14 +164,14 @@ async def sampleresources_post( ), ) -> SampleResource: """Create a new instance of SampleResource (more information in https://w3id.org/okn/o/sd#SampleResource)""" - + await FastAPICache.clear(namespace="SampleResource") return query_manager.post_resource( - + user=user, body=sample_resource, rdf_type_uri=SAMPLERESOURCE_TYPE_URI, - rdf_type_name=SAMPLERESOURCE_TYPE_NAME, + rdf_type_name=SAMPLERESOURCE_TYPE_NAME, kls=SampleResource ) - + diff --git a/src/openapi_server/apis/software_api.py b/src/openapi_server/apis/software_api.py index ead9a60..dd98a72 100644 --- a/src/openapi_server/apis/software_api.py +++ b/src/openapi_server/apis/software_api.py @@ -45,16 +45,16 @@ async def softwares_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Software]: """Gets a list of all instances of Software (more information in https://w3id.org/okn/o/sd#Software)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SOFTWARE_TYPE_URI, - rdf_type_name=SOFTWARE_TYPE_NAME, + rdf_type_name=SOFTWARE_TYPE_NAME, kls=Software ) - + @router.delete( @@ -68,24 +68,24 @@ async def softwares_get( response_model_by_alias=True, ) async def softwares_id_delete( - id: str = Path(None, description="The ID of the Software to be retrieved"), + id: str = Path( description="The ID of the Software to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Software (more information in https://w3id.org/okn/o/sd#Software)""" - + await FastAPICache.clear(namespace="Software") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SOFTWARE_TYPE_URI, - rdf_type_name=SOFTWARE_TYPE_NAME, + rdf_type_name=SOFTWARE_TYPE_NAME, kls=Software ) - + @router.get( @@ -99,20 +99,20 @@ async def softwares_id_delete( ) @cache(namespace="Software", expire=1800) async def softwares_id_get( - id: str = Path(None, description="The ID of the Software to be retrieved"), + id: str = Path( description="The ID of the Software to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Software: """Gets the details of a given Software (more information in https://w3id.org/okn/o/sd#Software)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SOFTWARE_TYPE_URI, - rdf_type_name=SOFTWARE_TYPE_NAME, + rdf_type_name=SOFTWARE_TYPE_NAME, kls=Software ) - + @router.put( @@ -126,7 +126,7 @@ async def softwares_id_get( response_model_by_alias=True, ) async def softwares_id_put( - id: str = Path(None, description="The ID of the Software to be retrieved"), + id: str = Path( description="The ID of the Software to be retrieved"), user: str = Query(None, description="Username"), software: Software = Body(None, description="An old Softwareto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def softwares_id_put( ), ) -> Software: """Updates an existing Software (more information in https://w3id.org/okn/o/sd#Software)""" - + await FastAPICache.clear(namespace="Software") return query_manager.put_resource( id=id, user=user, body=software, rdf_type_uri=SOFTWARE_TYPE_URI, - rdf_type_name=SOFTWARE_TYPE_NAME, + rdf_type_name=SOFTWARE_TYPE_NAME, kls=Software ) - + @router.post( @@ -164,14 +164,14 @@ async def softwares_post( ), ) -> Software: """Create a new instance of Software (more information in https://w3id.org/okn/o/sd#Software)""" - + await FastAPICache.clear(namespace="Software") return query_manager.post_resource( - + user=user, body=software, rdf_type_uri=SOFTWARE_TYPE_URI, - rdf_type_name=SOFTWARE_TYPE_NAME, + rdf_type_name=SOFTWARE_TYPE_NAME, kls=Software ) - + diff --git a/src/openapi_server/apis/software_configuration_api.py b/src/openapi_server/apis/software_configuration_api.py index 0800d69..c8d5923 100644 --- a/src/openapi_server/apis/software_configuration_api.py +++ b/src/openapi_server/apis/software_configuration_api.py @@ -45,16 +45,16 @@ async def softwareconfigurations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SoftwareConfiguration]: """Gets a list of all instances of SoftwareConfiguration (more information in https://w3id.org/okn/o/sd#SoftwareConfiguration)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SOFTWARECONFIGURATION_TYPE_URI, - rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, + rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, kls=SoftwareConfiguration ) - + @router.delete( @@ -68,24 +68,24 @@ async def softwareconfigurations_get( response_model_by_alias=True, ) async def softwareconfigurations_id_delete( - id: str = Path(None, description="The ID of the SoftwareConfiguration to be retrieved"), + id: str = Path( description="The ID of the SoftwareConfiguration to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SoftwareConfiguration (more information in https://w3id.org/okn/o/sd#SoftwareConfiguration)""" - + await FastAPICache.clear(namespace="SoftwareConfiguration") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SOFTWARECONFIGURATION_TYPE_URI, - rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, + rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, kls=SoftwareConfiguration ) - + @router.get( @@ -99,20 +99,20 @@ async def softwareconfigurations_id_delete( ) @cache(namespace="SoftwareConfiguration", expire=1800) async def softwareconfigurations_id_get( - id: str = Path(None, description="The ID of the SoftwareConfiguration to be retrieved"), + id: str = Path( description="The ID of the SoftwareConfiguration to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SoftwareConfiguration: """Gets the details of a given SoftwareConfiguration (more information in https://w3id.org/okn/o/sd#SoftwareConfiguration)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SOFTWARECONFIGURATION_TYPE_URI, - rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, + rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, kls=SoftwareConfiguration ) - + @router.put( @@ -126,7 +126,7 @@ async def softwareconfigurations_id_get( response_model_by_alias=True, ) async def softwareconfigurations_id_put( - id: str = Path(None, description="The ID of the SoftwareConfiguration to be retrieved"), + id: str = Path( description="The ID of the SoftwareConfiguration to be retrieved"), user: str = Query(None, description="Username"), software_configuration: SoftwareConfiguration = Body(None, description="An old SoftwareConfigurationto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def softwareconfigurations_id_put( ), ) -> SoftwareConfiguration: """Updates an existing SoftwareConfiguration (more information in https://w3id.org/okn/o/sd#SoftwareConfiguration)""" - + await FastAPICache.clear(namespace="SoftwareConfiguration") return query_manager.put_resource( id=id, user=user, body=software_configuration, rdf_type_uri=SOFTWARECONFIGURATION_TYPE_URI, - rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, + rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, kls=SoftwareConfiguration ) - + @router.post( @@ -164,14 +164,14 @@ async def softwareconfigurations_post( ), ) -> SoftwareConfiguration: """Create a new instance of SoftwareConfiguration (more information in https://w3id.org/okn/o/sd#SoftwareConfiguration)""" - + await FastAPICache.clear(namespace="SoftwareConfiguration") return query_manager.post_resource( - + user=user, body=software_configuration, rdf_type_uri=SOFTWARECONFIGURATION_TYPE_URI, - rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, + rdf_type_name=SOFTWARECONFIGURATION_TYPE_NAME, kls=SoftwareConfiguration ) - + diff --git a/src/openapi_server/apis/software_image_api.py b/src/openapi_server/apis/software_image_api.py index cffd858..85f4f21 100644 --- a/src/openapi_server/apis/software_image_api.py +++ b/src/openapi_server/apis/software_image_api.py @@ -45,16 +45,16 @@ async def softwareimages_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SoftwareImage]: """Gets a list of all instances of SoftwareImage (more information in https://w3id.org/okn/o/sd#SoftwareImage)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SOFTWAREIMAGE_TYPE_URI, - rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, + rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, kls=SoftwareImage ) - + @router.delete( @@ -68,24 +68,24 @@ async def softwareimages_get( response_model_by_alias=True, ) async def softwareimages_id_delete( - id: str = Path(None, description="The ID of the SoftwareImage to be retrieved"), + id: str = Path( description="The ID of the SoftwareImage to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SoftwareImage (more information in https://w3id.org/okn/o/sd#SoftwareImage)""" - + await FastAPICache.clear(namespace="SoftwareImage") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SOFTWAREIMAGE_TYPE_URI, - rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, + rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, kls=SoftwareImage ) - + @router.get( @@ -99,20 +99,20 @@ async def softwareimages_id_delete( ) @cache(namespace="SoftwareImage", expire=1800) async def softwareimages_id_get( - id: str = Path(None, description="The ID of the SoftwareImage to be retrieved"), + id: str = Path( description="The ID of the SoftwareImage to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SoftwareImage: """Gets the details of a given SoftwareImage (more information in https://w3id.org/okn/o/sd#SoftwareImage)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SOFTWAREIMAGE_TYPE_URI, - rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, + rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, kls=SoftwareImage ) - + @router.put( @@ -126,7 +126,7 @@ async def softwareimages_id_get( response_model_by_alias=True, ) async def softwareimages_id_put( - id: str = Path(None, description="The ID of the SoftwareImage to be retrieved"), + id: str = Path( description="The ID of the SoftwareImage to be retrieved"), user: str = Query(None, description="Username"), software_image: SoftwareImage = Body(None, description="An old SoftwareImageto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def softwareimages_id_put( ), ) -> SoftwareImage: """Updates an existing SoftwareImage (more information in https://w3id.org/okn/o/sd#SoftwareImage)""" - + await FastAPICache.clear(namespace="SoftwareImage") return query_manager.put_resource( id=id, user=user, body=software_image, rdf_type_uri=SOFTWAREIMAGE_TYPE_URI, - rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, + rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, kls=SoftwareImage ) - + @router.post( @@ -164,14 +164,14 @@ async def softwareimages_post( ), ) -> SoftwareImage: """Create a new instance of SoftwareImage (more information in https://w3id.org/okn/o/sd#SoftwareImage)""" - + await FastAPICache.clear(namespace="SoftwareImage") return query_manager.post_resource( - + user=user, body=software_image, rdf_type_uri=SOFTWAREIMAGE_TYPE_URI, - rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, + rdf_type_name=SOFTWAREIMAGE_TYPE_NAME, kls=SoftwareImage ) - + diff --git a/src/openapi_server/apis/software_version_api.py b/src/openapi_server/apis/software_version_api.py index 3582c6d..7ab5b60 100644 --- a/src/openapi_server/apis/software_version_api.py +++ b/src/openapi_server/apis/software_version_api.py @@ -45,16 +45,16 @@ async def softwareversions_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SoftwareVersion]: """Gets a list of all instances of SoftwareVersion (more information in https://w3id.org/okn/o/sd#SoftwareVersion)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SOFTWAREVERSION_TYPE_URI, - rdf_type_name=SOFTWAREVERSION_TYPE_NAME, + rdf_type_name=SOFTWAREVERSION_TYPE_NAME, kls=SoftwareVersion ) - + @router.delete( @@ -68,24 +68,24 @@ async def softwareversions_get( response_model_by_alias=True, ) async def softwareversions_id_delete( - id: str = Path(None, description="The ID of the SoftwareVersion to be retrieved"), + id: str = Path( description="The ID of the SoftwareVersion to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SoftwareVersion (more information in https://w3id.org/okn/o/sd#SoftwareVersion)""" - + await FastAPICache.clear(namespace="SoftwareVersion") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SOFTWAREVERSION_TYPE_URI, - rdf_type_name=SOFTWAREVERSION_TYPE_NAME, + rdf_type_name=SOFTWAREVERSION_TYPE_NAME, kls=SoftwareVersion ) - + @router.get( @@ -99,20 +99,20 @@ async def softwareversions_id_delete( ) @cache(namespace="SoftwareVersion", expire=1800) async def softwareversions_id_get( - id: str = Path(None, description="The ID of the SoftwareVersion to be retrieved"), + id: str = Path( description="The ID of the SoftwareVersion to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SoftwareVersion: """Gets the details of a given SoftwareVersion (more information in https://w3id.org/okn/o/sd#SoftwareVersion)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SOFTWAREVERSION_TYPE_URI, - rdf_type_name=SOFTWAREVERSION_TYPE_NAME, + rdf_type_name=SOFTWAREVERSION_TYPE_NAME, kls=SoftwareVersion ) - + @router.put( @@ -126,7 +126,7 @@ async def softwareversions_id_get( response_model_by_alias=True, ) async def softwareversions_id_put( - id: str = Path(None, description="The ID of the SoftwareVersion to be retrieved"), + id: str = Path( description="The ID of the SoftwareVersion to be retrieved"), user: str = Query(None, description="Username"), software_version: SoftwareVersion = Body(None, description="An old SoftwareVersionto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def softwareversions_id_put( ), ) -> SoftwareVersion: """Updates an existing SoftwareVersion (more information in https://w3id.org/okn/o/sd#SoftwareVersion)""" - + await FastAPICache.clear(namespace="SoftwareVersion") return query_manager.put_resource( id=id, user=user, body=software_version, rdf_type_uri=SOFTWAREVERSION_TYPE_URI, - rdf_type_name=SOFTWAREVERSION_TYPE_NAME, + rdf_type_name=SOFTWAREVERSION_TYPE_NAME, kls=SoftwareVersion ) - + @router.post( @@ -164,14 +164,14 @@ async def softwareversions_post( ), ) -> SoftwareVersion: """Create a new instance of SoftwareVersion (more information in https://w3id.org/okn/o/sd#SoftwareVersion)""" - + await FastAPICache.clear(namespace="SoftwareVersion") return query_manager.post_resource( - + user=user, body=software_version, rdf_type_uri=SOFTWAREVERSION_TYPE_URI, - rdf_type_name=SOFTWAREVERSION_TYPE_NAME, + rdf_type_name=SOFTWAREVERSION_TYPE_NAME, kls=SoftwareVersion ) - + diff --git a/src/openapi_server/apis/source_code_api.py b/src/openapi_server/apis/source_code_api.py index ee1ecc4..5874523 100644 --- a/src/openapi_server/apis/source_code_api.py +++ b/src/openapi_server/apis/source_code_api.py @@ -45,16 +45,16 @@ async def sourcecodes_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SourceCode]: """Gets a list of all instances of SourceCode (more information in https://w3id.org/okn/o/sd#SourceCode)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SOURCECODE_TYPE_URI, - rdf_type_name=SOURCECODE_TYPE_NAME, + rdf_type_name=SOURCECODE_TYPE_NAME, kls=SourceCode ) - + @router.delete( @@ -68,24 +68,24 @@ async def sourcecodes_get( response_model_by_alias=True, ) async def sourcecodes_id_delete( - id: str = Path(None, description="The ID of the SourceCode to be retrieved"), + id: str = Path( description="The ID of the SourceCode to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SourceCode (more information in https://w3id.org/okn/o/sd#SourceCode)""" - + await FastAPICache.clear(namespace="SourceCode") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SOURCECODE_TYPE_URI, - rdf_type_name=SOURCECODE_TYPE_NAME, + rdf_type_name=SOURCECODE_TYPE_NAME, kls=SourceCode ) - + @router.get( @@ -99,20 +99,20 @@ async def sourcecodes_id_delete( ) @cache(namespace="SourceCode", expire=1800) async def sourcecodes_id_get( - id: str = Path(None, description="The ID of the SourceCode to be retrieved"), + id: str = Path( description="The ID of the SourceCode to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SourceCode: """Gets the details of a given SourceCode (more information in https://w3id.org/okn/o/sd#SourceCode)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SOURCECODE_TYPE_URI, - rdf_type_name=SOURCECODE_TYPE_NAME, + rdf_type_name=SOURCECODE_TYPE_NAME, kls=SourceCode ) - + @router.put( @@ -126,7 +126,7 @@ async def sourcecodes_id_get( response_model_by_alias=True, ) async def sourcecodes_id_put( - id: str = Path(None, description="The ID of the SourceCode to be retrieved"), + id: str = Path( description="The ID of the SourceCode to be retrieved"), user: str = Query(None, description="Username"), source_code: SourceCode = Body(None, description="An old SourceCodeto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def sourcecodes_id_put( ), ) -> SourceCode: """Updates an existing SourceCode (more information in https://w3id.org/okn/o/sd#SourceCode)""" - + await FastAPICache.clear(namespace="SourceCode") return query_manager.put_resource( id=id, user=user, body=source_code, rdf_type_uri=SOURCECODE_TYPE_URI, - rdf_type_name=SOURCECODE_TYPE_NAME, + rdf_type_name=SOURCECODE_TYPE_NAME, kls=SourceCode ) - + @router.post( @@ -164,14 +164,14 @@ async def sourcecodes_post( ), ) -> SourceCode: """Create a new instance of SourceCode (more information in https://w3id.org/okn/o/sd#SourceCode)""" - + await FastAPICache.clear(namespace="SourceCode") return query_manager.post_resource( - + user=user, body=source_code, rdf_type_uri=SOURCECODE_TYPE_URI, - rdf_type_name=SOURCECODE_TYPE_NAME, + rdf_type_name=SOURCECODE_TYPE_NAME, kls=SourceCode ) - + diff --git a/src/openapi_server/apis/spatial_resolution_api.py b/src/openapi_server/apis/spatial_resolution_api.py index 0efc9cc..3033ca0 100644 --- a/src/openapi_server/apis/spatial_resolution_api.py +++ b/src/openapi_server/apis/spatial_resolution_api.py @@ -45,16 +45,16 @@ async def spatialresolutions_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SpatialResolution]: """Gets a list of all instances of SpatialResolution (more information in https://w3id.org/okn/o/sdm#SpatialResolution)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SPATIALRESOLUTION_TYPE_URI, - rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, + rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, kls=SpatialResolution ) - + @router.delete( @@ -68,24 +68,24 @@ async def spatialresolutions_get( response_model_by_alias=True, ) async def spatialresolutions_id_delete( - id: str = Path(None, description="The ID of the SpatialResolution to be retrieved"), + id: str = Path( description="The ID of the SpatialResolution to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SpatialResolution (more information in https://w3id.org/okn/o/sdm#SpatialResolution)""" - + await FastAPICache.clear(namespace="SpatialResolution") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SPATIALRESOLUTION_TYPE_URI, - rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, + rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, kls=SpatialResolution ) - + @router.get( @@ -99,20 +99,20 @@ async def spatialresolutions_id_delete( ) @cache(namespace="SpatialResolution", expire=1800) async def spatialresolutions_id_get( - id: str = Path(None, description="The ID of the SpatialResolution to be retrieved"), + id: str = Path( description="The ID of the SpatialResolution to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SpatialResolution: """Gets the details of a given SpatialResolution (more information in https://w3id.org/okn/o/sdm#SpatialResolution)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SPATIALRESOLUTION_TYPE_URI, - rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, + rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, kls=SpatialResolution ) - + @router.put( @@ -126,7 +126,7 @@ async def spatialresolutions_id_get( response_model_by_alias=True, ) async def spatialresolutions_id_put( - id: str = Path(None, description="The ID of the SpatialResolution to be retrieved"), + id: str = Path( description="The ID of the SpatialResolution to be retrieved"), user: str = Query(None, description="Username"), spatial_resolution: SpatialResolution = Body(None, description="An old SpatialResolutionto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def spatialresolutions_id_put( ), ) -> SpatialResolution: """Updates an existing SpatialResolution (more information in https://w3id.org/okn/o/sdm#SpatialResolution)""" - + await FastAPICache.clear(namespace="SpatialResolution") return query_manager.put_resource( id=id, user=user, body=spatial_resolution, rdf_type_uri=SPATIALRESOLUTION_TYPE_URI, - rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, + rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, kls=SpatialResolution ) - + @router.post( @@ -164,14 +164,14 @@ async def spatialresolutions_post( ), ) -> SpatialResolution: """Create a new instance of SpatialResolution (more information in https://w3id.org/okn/o/sdm#SpatialResolution)""" - + await FastAPICache.clear(namespace="SpatialResolution") return query_manager.post_resource( - + user=user, body=spatial_resolution, rdf_type_uri=SPATIALRESOLUTION_TYPE_URI, - rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, + rdf_type_name=SPATIALRESOLUTION_TYPE_NAME, kls=SpatialResolution ) - + diff --git a/src/openapi_server/apis/spatially_distributed_grid_api.py b/src/openapi_server/apis/spatially_distributed_grid_api.py index 445e16c..55248d5 100644 --- a/src/openapi_server/apis/spatially_distributed_grid_api.py +++ b/src/openapi_server/apis/spatially_distributed_grid_api.py @@ -45,16 +45,16 @@ async def spatiallydistributedgrids_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[SpatiallyDistributedGrid]: """Gets a list of all instances of SpatiallyDistributedGrid (more information in https://w3id.org/okn/o/sdm#SpatiallyDistributedGrid)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=SPATIALLYDISTRIBUTEDGRID_TYPE_URI, - rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, + rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, kls=SpatiallyDistributedGrid ) - + @router.delete( @@ -68,24 +68,24 @@ async def spatiallydistributedgrids_get( response_model_by_alias=True, ) async def spatiallydistributedgrids_id_delete( - id: str = Path(None, description="The ID of the SpatiallyDistributedGrid to be retrieved"), + id: str = Path( description="The ID of the SpatiallyDistributedGrid to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing SpatiallyDistributedGrid (more information in https://w3id.org/okn/o/sdm#SpatiallyDistributedGrid)""" - + await FastAPICache.clear(namespace="SpatiallyDistributedGrid") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=SPATIALLYDISTRIBUTEDGRID_TYPE_URI, - rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, + rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, kls=SpatiallyDistributedGrid ) - + @router.get( @@ -99,20 +99,20 @@ async def spatiallydistributedgrids_id_delete( ) @cache(namespace="SpatiallyDistributedGrid", expire=1800) async def spatiallydistributedgrids_id_get( - id: str = Path(None, description="The ID of the SpatiallyDistributedGrid to be retrieved"), + id: str = Path( description="The ID of the SpatiallyDistributedGrid to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> SpatiallyDistributedGrid: """Gets the details of a given SpatiallyDistributedGrid (more information in https://w3id.org/okn/o/sdm#SpatiallyDistributedGrid)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=SPATIALLYDISTRIBUTEDGRID_TYPE_URI, - rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, + rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, kls=SpatiallyDistributedGrid ) - + @router.put( @@ -126,7 +126,7 @@ async def spatiallydistributedgrids_id_get( response_model_by_alias=True, ) async def spatiallydistributedgrids_id_put( - id: str = Path(None, description="The ID of the SpatiallyDistributedGrid to be retrieved"), + id: str = Path( description="The ID of the SpatiallyDistributedGrid to be retrieved"), user: str = Query(None, description="Username"), spatially_distributed_grid: SpatiallyDistributedGrid = Body(None, description="An old SpatiallyDistributedGridto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def spatiallydistributedgrids_id_put( ), ) -> SpatiallyDistributedGrid: """Updates an existing SpatiallyDistributedGrid (more information in https://w3id.org/okn/o/sdm#SpatiallyDistributedGrid)""" - + await FastAPICache.clear(namespace="SpatiallyDistributedGrid") return query_manager.put_resource( id=id, user=user, body=spatially_distributed_grid, rdf_type_uri=SPATIALLYDISTRIBUTEDGRID_TYPE_URI, - rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, + rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, kls=SpatiallyDistributedGrid ) - + @router.post( @@ -164,14 +164,14 @@ async def spatiallydistributedgrids_post( ), ) -> SpatiallyDistributedGrid: """Create a new instance of SpatiallyDistributedGrid (more information in https://w3id.org/okn/o/sdm#SpatiallyDistributedGrid)""" - + await FastAPICache.clear(namespace="SpatiallyDistributedGrid") return query_manager.post_resource( - + user=user, body=spatially_distributed_grid, rdf_type_uri=SPATIALLYDISTRIBUTEDGRID_TYPE_URI, - rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, + rdf_type_name=SPATIALLYDISTRIBUTEDGRID_TYPE_NAME, kls=SpatiallyDistributedGrid ) - + diff --git a/src/openapi_server/apis/theory_guided_model_api.py b/src/openapi_server/apis/theory_guided_model_api.py index 0cbb030..b65cbe3 100644 --- a/src/openapi_server/apis/theory_guided_model_api.py +++ b/src/openapi_server/apis/theory_guided_model_api.py @@ -45,16 +45,16 @@ async def theory_guidedmodels_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[TheoryGuidedModel]: """Gets a list of all instances of Theory-GuidedModel (more information in https://w3id.org/okn/o/sdm#Theory-GuidedModel)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=THEORY_GUIDEDMODEL_TYPE_URI, - rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, + rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, kls=TheoryGuidedModel ) - + @router.delete( @@ -68,24 +68,24 @@ async def theory_guidedmodels_get( response_model_by_alias=True, ) async def theory_guidedmodels_id_delete( - id: str = Path(None, description="The ID of the Theory-GuidedModel to be retrieved"), + id: str = Path( description="The ID of the Theory-GuidedModel to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Theory-GuidedModel (more information in https://w3id.org/okn/o/sdm#Theory-GuidedModel)""" - + await FastAPICache.clear(namespace="Theory_GuidedModel") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=THEORY_GUIDEDMODEL_TYPE_URI, - rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, + rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, kls=TheoryGuidedModel ) - + @router.get( @@ -99,20 +99,20 @@ async def theory_guidedmodels_id_delete( ) @cache(namespace="Theory_GuidedModel", expire=1800) async def theory_guidedmodels_id_get( - id: str = Path(None, description="The ID of the Theory-GuidedModel to be retrieved"), + id: str = Path( description="The ID of the Theory-GuidedModel to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> TheoryGuidedModel: """Gets the details of a given Theory-GuidedModel (more information in https://w3id.org/okn/o/sdm#Theory-GuidedModel)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=THEORY_GUIDEDMODEL_TYPE_URI, - rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, + rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, kls=TheoryGuidedModel ) - + @router.put( @@ -126,7 +126,7 @@ async def theory_guidedmodels_id_get( response_model_by_alias=True, ) async def theory_guidedmodels_id_put( - id: str = Path(None, description="The ID of the Theory-GuidedModel to be retrieved"), + id: str = Path( description="The ID of the Theory-GuidedModel to be retrieved"), user: str = Query(None, description="Username"), theory_guided_model: TheoryGuidedModel = Body(None, description="An old Theory-GuidedModelto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def theory_guidedmodels_id_put( ), ) -> TheoryGuidedModel: """Updates an existing Theory-GuidedModel (more information in https://w3id.org/okn/o/sdm#Theory-GuidedModel)""" - + await FastAPICache.clear(namespace="Theory_GuidedModel") return query_manager.put_resource( id=id, user=user, body=theory_guided_model, rdf_type_uri=THEORY_GUIDEDMODEL_TYPE_URI, - rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, + rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, kls=TheoryGuidedModel ) - + @router.post( @@ -164,14 +164,14 @@ async def theory_guidedmodels_post( ), ) -> TheoryGuidedModel: """Create a new instance of Theory-GuidedModel (more information in https://w3id.org/okn/o/sdm#Theory-GuidedModel)""" - + await FastAPICache.clear(namespace="Theory_GuidedModel") return query_manager.post_resource( - + user=user, body=theory_guided_model, rdf_type_uri=THEORY_GUIDEDMODEL_TYPE_URI, - rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, + rdf_type_name=THEORY_GUIDEDMODEL_TYPE_NAME, kls=TheoryGuidedModel ) - + diff --git a/src/openapi_server/apis/time_interval_api.py b/src/openapi_server/apis/time_interval_api.py index 5142618..643813d 100644 --- a/src/openapi_server/apis/time_interval_api.py +++ b/src/openapi_server/apis/time_interval_api.py @@ -45,16 +45,16 @@ async def timeintervals_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[TimeInterval]: """Gets a list of all instances of TimeInterval (more information in https://w3id.org/okn/o/sdm#TimeInterval)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=TIMEINTERVAL_TYPE_URI, - rdf_type_name=TIMEINTERVAL_TYPE_NAME, + rdf_type_name=TIMEINTERVAL_TYPE_NAME, kls=TimeInterval ) - + @router.delete( @@ -68,24 +68,24 @@ async def timeintervals_get( response_model_by_alias=True, ) async def timeintervals_id_delete( - id: str = Path(None, description="The ID of the TimeInterval to be retrieved"), + id: str = Path( description="The ID of the TimeInterval to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing TimeInterval (more information in https://w3id.org/okn/o/sdm#TimeInterval)""" - + await FastAPICache.clear(namespace="TimeInterval") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=TIMEINTERVAL_TYPE_URI, - rdf_type_name=TIMEINTERVAL_TYPE_NAME, + rdf_type_name=TIMEINTERVAL_TYPE_NAME, kls=TimeInterval ) - + @router.get( @@ -99,20 +99,20 @@ async def timeintervals_id_delete( ) @cache(namespace="TimeInterval", expire=1800) async def timeintervals_id_get( - id: str = Path(None, description="The ID of the TimeInterval to be retrieved"), + id: str = Path( description="The ID of the TimeInterval to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> TimeInterval: """Gets the details of a given TimeInterval (more information in https://w3id.org/okn/o/sdm#TimeInterval)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=TIMEINTERVAL_TYPE_URI, - rdf_type_name=TIMEINTERVAL_TYPE_NAME, + rdf_type_name=TIMEINTERVAL_TYPE_NAME, kls=TimeInterval ) - + @router.put( @@ -126,7 +126,7 @@ async def timeintervals_id_get( response_model_by_alias=True, ) async def timeintervals_id_put( - id: str = Path(None, description="The ID of the TimeInterval to be retrieved"), + id: str = Path( description="The ID of the TimeInterval to be retrieved"), user: str = Query(None, description="Username"), time_interval: TimeInterval = Body(None, description="An old TimeIntervalto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def timeintervals_id_put( ), ) -> TimeInterval: """Updates an existing TimeInterval (more information in https://w3id.org/okn/o/sdm#TimeInterval)""" - + await FastAPICache.clear(namespace="TimeInterval") return query_manager.put_resource( id=id, user=user, body=time_interval, rdf_type_uri=TIMEINTERVAL_TYPE_URI, - rdf_type_name=TIMEINTERVAL_TYPE_NAME, + rdf_type_name=TIMEINTERVAL_TYPE_NAME, kls=TimeInterval ) - + @router.post( @@ -164,14 +164,14 @@ async def timeintervals_post( ), ) -> TimeInterval: """Create a new instance of TimeInterval (more information in https://w3id.org/okn/o/sdm#TimeInterval)""" - + await FastAPICache.clear(namespace="TimeInterval") return query_manager.post_resource( - + user=user, body=time_interval, rdf_type_uri=TIMEINTERVAL_TYPE_URI, - rdf_type_name=TIMEINTERVAL_TYPE_NAME, + rdf_type_name=TIMEINTERVAL_TYPE_NAME, kls=TimeInterval ) - + diff --git a/src/openapi_server/apis/unit_api.py b/src/openapi_server/apis/unit_api.py index cb96d1a..923f75e 100644 --- a/src/openapi_server/apis/unit_api.py +++ b/src/openapi_server/apis/unit_api.py @@ -45,16 +45,16 @@ async def units_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Unit]: """Gets a list of all instances of Unit (more information in https://w3id.org/okn/o/sd#Unit)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=UNIT_TYPE_URI, - rdf_type_name=UNIT_TYPE_NAME, + rdf_type_name=UNIT_TYPE_NAME, kls=Unit ) - + @router.delete( @@ -68,24 +68,24 @@ async def units_get( response_model_by_alias=True, ) async def units_id_delete( - id: str = Path(None, description="The ID of the Unit to be retrieved"), + id: str = Path( description="The ID of the Unit to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Unit (more information in https://w3id.org/okn/o/sd#Unit)""" - + await FastAPICache.clear(namespace="Unit") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=UNIT_TYPE_URI, - rdf_type_name=UNIT_TYPE_NAME, + rdf_type_name=UNIT_TYPE_NAME, kls=Unit ) - + @router.get( @@ -99,20 +99,20 @@ async def units_id_delete( ) @cache(namespace="Unit", expire=1800) async def units_id_get( - id: str = Path(None, description="The ID of the Unit to be retrieved"), + id: str = Path( description="The ID of the Unit to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Unit: """Gets the details of a given Unit (more information in https://w3id.org/okn/o/sd#Unit)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=UNIT_TYPE_URI, - rdf_type_name=UNIT_TYPE_NAME, + rdf_type_name=UNIT_TYPE_NAME, kls=Unit ) - + @router.put( @@ -126,7 +126,7 @@ async def units_id_get( response_model_by_alias=True, ) async def units_id_put( - id: str = Path(None, description="The ID of the Unit to be retrieved"), + id: str = Path( description="The ID of the Unit to be retrieved"), user: str = Query(None, description="Username"), unit: Unit = Body(None, description="An old Unitto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def units_id_put( ), ) -> Unit: """Updates an existing Unit (more information in https://w3id.org/okn/o/sd#Unit)""" - + await FastAPICache.clear(namespace="Unit") return query_manager.put_resource( id=id, user=user, body=unit, rdf_type_uri=UNIT_TYPE_URI, - rdf_type_name=UNIT_TYPE_NAME, + rdf_type_name=UNIT_TYPE_NAME, kls=Unit ) - + @router.post( @@ -164,14 +164,14 @@ async def units_post( ), ) -> Unit: """Create a new instance of Unit (more information in https://w3id.org/okn/o/sd#Unit)""" - + await FastAPICache.clear(namespace="Unit") return query_manager.post_resource( - + user=user, body=unit, rdf_type_uri=UNIT_TYPE_URI, - rdf_type_name=UNIT_TYPE_NAME, + rdf_type_name=UNIT_TYPE_NAME, kls=Unit ) - + diff --git a/src/openapi_server/apis/variable_api.py b/src/openapi_server/apis/variable_api.py index 1e1d9b4..decad83 100644 --- a/src/openapi_server/apis/variable_api.py +++ b/src/openapi_server/apis/variable_api.py @@ -45,16 +45,16 @@ async def variables_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Variable]: """Gets a list of all instances of Variable (more information in https://w3id.org/okn/o/sd#Variable)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=VARIABLE_TYPE_URI, - rdf_type_name=VARIABLE_TYPE_NAME, + rdf_type_name=VARIABLE_TYPE_NAME, kls=Variable ) - + @router.delete( @@ -68,24 +68,24 @@ async def variables_get( response_model_by_alias=True, ) async def variables_id_delete( - id: str = Path(None, description="The ID of the Variable to be retrieved"), + id: str = Path( description="The ID of the Variable to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Variable (more information in https://w3id.org/okn/o/sd#Variable)""" - + await FastAPICache.clear(namespace="Variable") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=VARIABLE_TYPE_URI, - rdf_type_name=VARIABLE_TYPE_NAME, + rdf_type_name=VARIABLE_TYPE_NAME, kls=Variable ) - + @router.get( @@ -99,20 +99,20 @@ async def variables_id_delete( ) @cache(namespace="Variable", expire=1800) async def variables_id_get( - id: str = Path(None, description="The ID of the Variable to be retrieved"), + id: str = Path( description="The ID of the Variable to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Variable: """Gets the details of a given Variable (more information in https://w3id.org/okn/o/sd#Variable)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=VARIABLE_TYPE_URI, - rdf_type_name=VARIABLE_TYPE_NAME, + rdf_type_name=VARIABLE_TYPE_NAME, kls=Variable ) - + @router.put( @@ -126,7 +126,7 @@ async def variables_id_get( response_model_by_alias=True, ) async def variables_id_put( - id: str = Path(None, description="The ID of the Variable to be retrieved"), + id: str = Path( description="The ID of the Variable to be retrieved"), user: str = Query(None, description="Username"), variable: Variable = Body(None, description="An old Variableto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def variables_id_put( ), ) -> Variable: """Updates an existing Variable (more information in https://w3id.org/okn/o/sd#Variable)""" - + await FastAPICache.clear(namespace="Variable") return query_manager.put_resource( id=id, user=user, body=variable, rdf_type_uri=VARIABLE_TYPE_URI, - rdf_type_name=VARIABLE_TYPE_NAME, + rdf_type_name=VARIABLE_TYPE_NAME, kls=Variable ) - + @router.post( @@ -164,14 +164,14 @@ async def variables_post( ), ) -> Variable: """Create a new instance of Variable (more information in https://w3id.org/okn/o/sd#Variable)""" - + await FastAPICache.clear(namespace="Variable") return query_manager.post_resource( - + user=user, body=variable, rdf_type_uri=VARIABLE_TYPE_URI, - rdf_type_name=VARIABLE_TYPE_NAME, + rdf_type_name=VARIABLE_TYPE_NAME, kls=Variable ) - + diff --git a/src/openapi_server/apis/variable_presentation_api.py b/src/openapi_server/apis/variable_presentation_api.py index 5532c6e..9fe40ba 100644 --- a/src/openapi_server/apis/variable_presentation_api.py +++ b/src/openapi_server/apis/variable_presentation_api.py @@ -45,16 +45,16 @@ async def variablepresentations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[VariablePresentation]: """Gets a list of all instances of VariablePresentation (more information in https://w3id.org/okn/o/sd#VariablePresentation)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=VARIABLEPRESENTATION_TYPE_URI, - rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, + rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, kls=VariablePresentation ) - + @router.delete( @@ -68,24 +68,24 @@ async def variablepresentations_get( response_model_by_alias=True, ) async def variablepresentations_id_delete( - id: str = Path(None, description="The ID of the VariablePresentation to be retrieved"), + id: str = Path( description="The ID of the VariablePresentation to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing VariablePresentation (more information in https://w3id.org/okn/o/sd#VariablePresentation)""" - + await FastAPICache.clear(namespace="VariablePresentation") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=VARIABLEPRESENTATION_TYPE_URI, - rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, + rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, kls=VariablePresentation ) - + @router.get( @@ -99,20 +99,20 @@ async def variablepresentations_id_delete( ) @cache(namespace="VariablePresentation", expire=1800) async def variablepresentations_id_get( - id: str = Path(None, description="The ID of the VariablePresentation to be retrieved"), + id: str = Path( description="The ID of the VariablePresentation to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> VariablePresentation: """Gets the details of a given VariablePresentation (more information in https://w3id.org/okn/o/sd#VariablePresentation)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=VARIABLEPRESENTATION_TYPE_URI, - rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, + rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, kls=VariablePresentation ) - + @router.put( @@ -126,7 +126,7 @@ async def variablepresentations_id_get( response_model_by_alias=True, ) async def variablepresentations_id_put( - id: str = Path(None, description="The ID of the VariablePresentation to be retrieved"), + id: str = Path( description="The ID of the VariablePresentation to be retrieved"), user: str = Query(None, description="Username"), variable_presentation: VariablePresentation = Body(None, description="An old VariablePresentationto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def variablepresentations_id_put( ), ) -> VariablePresentation: """Updates an existing VariablePresentation (more information in https://w3id.org/okn/o/sd#VariablePresentation)""" - + await FastAPICache.clear(namespace="VariablePresentation") return query_manager.put_resource( id=id, user=user, body=variable_presentation, rdf_type_uri=VARIABLEPRESENTATION_TYPE_URI, - rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, + rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, kls=VariablePresentation ) - + @router.post( @@ -164,14 +164,14 @@ async def variablepresentations_post( ), ) -> VariablePresentation: """Create a new instance of VariablePresentation (more information in https://w3id.org/okn/o/sd#VariablePresentation)""" - + await FastAPICache.clear(namespace="VariablePresentation") return query_manager.post_resource( - + user=user, body=variable_presentation, rdf_type_uri=VARIABLEPRESENTATION_TYPE_URI, - rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, + rdf_type_name=VARIABLEPRESENTATION_TYPE_NAME, kls=VariablePresentation ) - + diff --git a/src/openapi_server/apis/visualization_api.py b/src/openapi_server/apis/visualization_api.py index b6e8d7d..4a4ea08 100644 --- a/src/openapi_server/apis/visualization_api.py +++ b/src/openapi_server/apis/visualization_api.py @@ -45,16 +45,16 @@ async def visualizations_get( per_page: int = Query(100, description="Items per page", ge=1, le=200), ) -> List[Visualization]: """Gets a list of all instances of Visualization (more information in https://w3id.org/okn/o/sd#Visualization)""" - + return query_manager.get_resource( - + username=username,label=label,page=page,per_page=per_page, - + rdf_type_uri=VISUALIZATION_TYPE_URI, - rdf_type_name=VISUALIZATION_TYPE_NAME, + rdf_type_name=VISUALIZATION_TYPE_NAME, kls=Visualization ) - + @router.delete( @@ -68,24 +68,24 @@ async def visualizations_get( response_model_by_alias=True, ) async def visualizations_id_delete( - id: str = Path(None, description="The ID of the Visualization to be retrieved"), + id: str = Path( description="The ID of the Visualization to be retrieved"), user: str = Query(None, description="Username"), token_BearerAuth: TokenModel = Security( get_token_BearerAuth ), ) -> None: """Delete an existing Visualization (more information in https://w3id.org/okn/o/sd#Visualization)""" - + await FastAPICache.clear(namespace="Visualization") return query_manager.delete_resource( id=id, user=user, - + rdf_type_uri=VISUALIZATION_TYPE_URI, - rdf_type_name=VISUALIZATION_TYPE_NAME, + rdf_type_name=VISUALIZATION_TYPE_NAME, kls=Visualization ) - + @router.get( @@ -99,20 +99,20 @@ async def visualizations_id_delete( ) @cache(namespace="Visualization", expire=1800) async def visualizations_id_get( - id: str = Path(None, description="The ID of the Visualization to be retrieved"), + id: str = Path( description="The ID of the Visualization to be retrieved"), username: str = Query(None, description="Name of the user graph to query"), ) -> Visualization: """Gets the details of a given Visualization (more information in https://w3id.org/okn/o/sd#Visualization)""" - + return query_manager.get_resource( id=id, username=username, - + rdf_type_uri=VISUALIZATION_TYPE_URI, - rdf_type_name=VISUALIZATION_TYPE_NAME, + rdf_type_name=VISUALIZATION_TYPE_NAME, kls=Visualization ) - + @router.put( @@ -126,7 +126,7 @@ async def visualizations_id_get( response_model_by_alias=True, ) async def visualizations_id_put( - id: str = Path(None, description="The ID of the Visualization to be retrieved"), + id: str = Path( description="The ID of the Visualization to be retrieved"), user: str = Query(None, description="Username"), visualization: Visualization = Body(None, description="An old Visualizationto be updated"), token_BearerAuth: TokenModel = Security( @@ -134,17 +134,17 @@ async def visualizations_id_put( ), ) -> Visualization: """Updates an existing Visualization (more information in https://w3id.org/okn/o/sd#Visualization)""" - + await FastAPICache.clear(namespace="Visualization") return query_manager.put_resource( id=id, user=user, body=visualization, rdf_type_uri=VISUALIZATION_TYPE_URI, - rdf_type_name=VISUALIZATION_TYPE_NAME, + rdf_type_name=VISUALIZATION_TYPE_NAME, kls=Visualization ) - + @router.post( @@ -164,14 +164,14 @@ async def visualizations_post( ), ) -> Visualization: """Create a new instance of Visualization (more information in https://w3id.org/okn/o/sd#Visualization)""" - + await FastAPICache.clear(namespace="Visualization") return query_manager.post_resource( - + user=user, body=visualization, rdf_type_uri=VISUALIZATION_TYPE_URI, - rdf_type_name=VISUALIZATION_TYPE_NAME, + rdf_type_name=VISUALIZATION_TYPE_NAME, kls=Visualization ) - + diff --git a/src/openapi_server/models/ckan_response.py b/src/openapi_server/models/ckan_response.py new file mode 100644 index 0000000..ecc0a10 --- /dev/null +++ b/src/openapi_server/models/ckan_response.py @@ -0,0 +1,7 @@ +from pydantic import BaseModel + +class CKANItem(BaseModel): + Name: str + +class CKANResponse(BaseModel): + ResultSet: list[CKANItem] From 1b94e20d2793231dfc5c3f592b4e1aef23283831 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 12:45:15 -0400 Subject: [PATCH 4/8] fix: test 3.11 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 400ff47..680d85e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.7 AS builder +FROM python:3.11 AS builder WORKDIR /usr/src/app RUN python3 -m venv /venv From e251d132e13714d54017137b060fd9f1bf6bada4 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 12:47:53 -0400 Subject: [PATCH 5/8] fix: test python --- .github/workflows/python-packages.yml | 32 +++++++++++++-------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/python-packages.yml b/.github/workflows/python-packages.yml index fb3c734..bed7b52 100644 --- a/.github/workflows/python-packages.yml +++ b/.github/workflows/python-packages.yml @@ -11,22 +11,22 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.7, 3.8, 3.9] + python-version: [3.8, 3.9, 3.10, 3.11] os: [ubuntu-latest] steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 pytest - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install flake8 pytest + - name: Lint with flake8 + run: | + # stop the build if there are Python syntax errors or undefined names + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics From 88f6b765d7bb579e02c0a40302892edd0853d7eb Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 12:48:33 -0400 Subject: [PATCH 6/8] fix: test --- .github/workflows/python-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-packages.yml b/.github/workflows/python-packages.yml index bed7b52..81a52db 100644 --- a/.github/workflows/python-packages.yml +++ b/.github/workflows/python-packages.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: [3.8, 3.9, 3.10, 3.11] + python-version: [3.8, 3.9, 3.11] os: [ubuntu-latest] steps: From 9d3d08be00f26f3bdc2bf2e46a8a8ce181a043ef Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 13:01:43 -0400 Subject: [PATCH 7/8] fix: remove orjson --- requirements.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ee25a02..0382fe1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -37,7 +37,6 @@ MarkupSafe==2.1.1 mccabe==0.7.0 mdurl==0.1.2 obasparql==5.0.2 -orjson==3.8.0 pendulum==2.1.2 ply==3.11 promise==2.3 From 322ee7eb7d273f73cd3ad339b0ce8c18b25d6fc5 Mon Sep 17 00:00:00 2001 From: Maximiliano Osorio Date: Fri, 11 Apr 2025 19:25:44 -0400 Subject: [PATCH 8/8] chore: restrict Docker workflow triggers to 'main' branch and remove unnecessary conditions --- .github/workflows/docker-amd64.yml | 3 +-- .github/workflows/docker-arm64.yml | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker-amd64.yml b/.github/workflows/docker-amd64.yml index d57a73c..1f66120 100644 --- a/.github/workflows/docker-amd64.yml +++ b/.github/workflows/docker-amd64.yml @@ -3,7 +3,7 @@ name: Docker on: push: branches: - - '*' + - 'main' tags: - v* pull_request: @@ -16,7 +16,6 @@ env: jobs: build-amd64: runs-on: ubuntu-latest - if: github.event_name == 'push' steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/docker-arm64.yml b/.github/workflows/docker-arm64.yml index 139e45f..f597779 100644 --- a/.github/workflows/docker-arm64.yml +++ b/.github/workflows/docker-arm64.yml @@ -3,10 +3,9 @@ name: Docker on: push: branches: - - '*' + - 'main' tags: - v* - pull_request: env: DOCKER_IMAGE_NAME: model-catalog-fastapi @@ -16,7 +15,6 @@ env: jobs: build-arm64: runs-on: ubuntu-latest - if: github.event_name == 'push' steps: - uses: actions/checkout@v2