Skip to content

Commit

Permalink
Update output format
Browse files Browse the repository at this point in the history
  • Loading branch information
yoavnash committed Apr 9, 2024
1 parent 8423f59 commit 06f3148
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/publish-ghcr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- dockerfile: ./api/Dockerfile
image: ghcr.io/MI-FraunhoferIWM/json2rdf
context: ./api
target: production
- dockerfile: ./yarrrml-parser/Dockerfile
image: ghcr.io/MI-FraunhoferIWM/yarrrml-parser
context: ./yarrrml-parser
Expand Down
7 changes: 6 additions & 1 deletion api/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@ ENV PYTHONUNBUFFERED 1
################# DEVELOPMENT ####################################
FROM base as development

ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000", "--reload"]

ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000", "--workers", "6","--proxy-headers", "--reload"]

################# DEVELOPMENT ####################################
FROM base as production

ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"]
7 changes: 3 additions & 4 deletions api/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ def response_to_ttl(response):
json_response = json.loads(response)
knowledge_graph = json_response["output"]
g = Graph()
g.parse(data=knowledge_graph, format="nt")
knowledge_graph = g.serialize(format="n3")
print(knowledge_graph)

g.parse(data=knowledge_graph)
knowledge_graph = g.serialize(format="turtle")
print(knowledge_graph, flush=True)
return knowledge_graph

0 comments on commit 06f3148

Please sign in to comment.