Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/docker-amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker
on:
push:
branches:
- '*'
- 'main'
tags:
- v*
pull_request:
Expand All @@ -16,7 +16,6 @@ env:
jobs:
build-amd64:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2

Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/docker-arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: Docker
on:
push:
branches:
- '*'
- 'main'
tags:
- v*
pull_request:

env:
DOCKER_IMAGE_NAME: model-catalog-fastapi
Expand All @@ -16,7 +15,6 @@ env:
jobs:
build-arm64:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Byte-compiled / optimized / DLL files
env.sh
src/contexts
src/queries
__pycache__/
*.py[cod]
*$py.class
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8 AS builder
FROM python:3.11 AS builder

WORKDIR /usr/src/app
RUN python3 -m venv /venv
Expand Down
29 changes: 21 additions & 8 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
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
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
pendulum==2.1.2
ply==3.11
Expand All @@ -38,28 +44,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
Expand Down
46 changes: 23 additions & 23 deletions src/openapi_server/apis/catalog_identifier_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -126,25 +126,25 @@ 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(
get_token_BearerAuth
),
) -> 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(
Expand All @@ -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
)

46 changes: 23 additions & 23 deletions src/openapi_server/apis/causal_diagram_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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(
Expand All @@ -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(
Expand All @@ -126,25 +126,25 @@ 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(
get_token_BearerAuth
),
) -> 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(
Expand All @@ -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
)

Loading
Loading