Skip to content

Commit

Permalink
other fixes to dcat_ap_it api
Browse files Browse the repository at this point in the history
  • Loading branch information
gtramonte committed Aug 2, 2024
1 parent 6565728 commit 352c4c7
Show file tree
Hide file tree
Showing 2 changed files with 297 additions and 96 deletions.
8 changes: 4 additions & 4 deletions api/app/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from datetime import datetime

from oai_dcat.metadata_provider import BASE_URL
from oai_dcat.oai_utils import convert_to_dcat_ap, convert_to_dcat_ap_it
from oai_dcat.oai_utils import serialize_and_concatenate_graphs, convert_to_dcat_ap_it
from fastapi import FastAPI, HTTPException, Request, status, Query, Response
from fastapi.middleware.cors import CORSMiddleware
from starlette.middleware.authentication import AuthenticationMiddleware
Expand Down Expand Up @@ -675,8 +675,8 @@ async def dcatapit(request: Request):
data = dataset_handler.get_datasets(
user_roles_names=request.auth.scopes
)
dcatap_graph = convert_to_dcat_ap(data, BASE_URL)
dcatapit_graph = convert_to_dcat_ap_it(dcatap_graph, BASE_URL)
response = dcatapit_graph.serialize(format='pretty-xml')
catalog_graph, datasets_graph, distributions_graph = convert_to_dcat_ap_it(data, BASE_URL)
# response = dcatapit_graph.serialize(format='pretty-xml')
response = serialize_and_concatenate_graphs(catalog_graph, datasets_graph, distributions_graph)

return Response(content=response, media_type="text/xml")
Loading

0 comments on commit 352c4c7

Please sign in to comment.