Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DBRepo
Manage
Activity
Members
Labels
Plan
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FAIR Data Austria DB Repository
DBRepo
Commits
441933e6
Commit
441933e6
authored
Feb 10, 2022
by
Cornelia Michlits
Browse files
Options
Downloads
Patches
Plain Diff
104 - ontology change endpoint types as suggested
parent
38016203
No related branches found
No related tags found
3 merge requests
!81
New stable release
,
!43
Merge dev to master
,
!37
Resolve "Backend: Ontologies"
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
fda-units-service/app.py
+6
-10
6 additions, 10 deletions
fda-units-service/app.py
fda-units-service/us-yml/geturi.yml
+4
-9
4 additions, 9 deletions
fda-units-service/us-yml/geturi.yml
fda-units-service/us-yml/validate.yml
+4
-9
4 additions, 9 deletions
fda-units-service/us-yml/validate.yml
with
14 additions
and
28 deletions
fda-units-service/app.py
+
6
−
10
View file @
441933e6
...
@@ -48,26 +48,22 @@ def suggest():
...
@@ -48,26 +48,22 @@ def suggest():
res
=
{
"
success
"
:
False
,
"
message
"
:
str
(
e
)}
res
=
{
"
success
"
:
False
,
"
message
"
:
str
(
e
)}
return
jsonify
(
res
),
500
return
jsonify
(
res
),
500
@app.route
(
'
/api/units/validate
'
,
methods
=
[
"
POS
T
"
],
endpoint
=
'
validate
'
)
@app.route
(
'
/api/units/validate
/<unit>
'
,
methods
=
[
"
GE
T
"
],
endpoint
=
'
validate
'
)
@swag_from
(
'
validate.yml
'
)
@swag_from
(
'
validate.yml
'
)
def
valitate
():
def
valitate
(
unit
):
input_json
=
request
.
get_json
()
try
:
try
:
unit
=
str
(
input_json
[
'
ustring
'
])
res
=
validator
(
unit
)
res
=
validator
(
stringmapper
(
unit
))
return
str
(
res
),
200
return
str
(
res
),
200
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
res
=
{
"
success
"
:
False
,
"
message
"
:
str
(
e
)}
res
=
{
"
success
"
:
False
,
"
message
"
:
str
(
e
)}
return
jsonify
(
res
)
return
jsonify
(
res
)
@app.route
(
'
/api/units/uri
'
,
methods
=
[
"
GET
"
],
endpoint
=
'
uri
'
)
@app.route
(
'
/api/units/uri
/<uname>
'
,
methods
=
[
"
GET
"
],
endpoint
=
'
uri
'
)
@swag_from
(
'
geturi.yml
'
)
@swag_from
(
'
geturi.yml
'
)
def
geturi
():
def
geturi
(
uname
):
input_json
=
request
.
get_json
()
try
:
try
:
name
=
str
(
input_json
[
'
uname
'
])
res
=
get_uri
(
uname
)
res
=
get_uri
(
name
)
return
jsonify
(
res
),
200
return
jsonify
(
res
),
200
except
Exception
as
e
:
except
Exception
as
e
:
print
(
e
)
print
(
e
)
...
...
This diff is collapsed.
Click to expand it.
fda-units-service/us-yml/geturi.yml
+
4
−
9
View file @
441933e6
...
@@ -5,16 +5,11 @@ consumes:
...
@@ -5,16 +5,11 @@ consumes:
produces
:
produces
:
-
"
application/json"
-
"
application/json"
parameters
:
parameters
:
-
in
:
"
body"
-
in
:
"
path"
name
:
"
body"
type
:
"
string"
name
:
"
uname"
description
:
"
to-do
description"
description
:
"
to-do
description"
required
:
true
required
:
true
schema
:
type
:
"
object"
properties
:
uname
:
type
:
"
string"
example
:
"
metre"
responses
:
responses
:
200
:
200
:
description
:
"
OK"
description
:
"
OK"
...
...
This diff is collapsed.
Click to expand it.
fda-units-service/us-yml/validate.yml
+
4
−
9
View file @
441933e6
...
@@ -5,16 +5,11 @@ consumes:
...
@@ -5,16 +5,11 @@ consumes:
produces
:
produces
:
-
"
application/json"
-
"
application/json"
parameters
:
parameters
:
-
in
:
"
body"
-
in
:
"
path"
name
:
"
body"
type
:
"
string"
name
:
"
unit"
description
:
"
to-do
description"
description
:
"
to-do
description"
required
:
true
required
:
true
schema
:
type
:
"
object"
properties
:
ustring
:
type
:
"
string"
example
:
"
metre"
responses
:
responses
:
200
:
200
:
description
:
"
OK"
description
:
"
OK"
...
...
This diff is collapsed.
Click to expand it.
Cornelia Michlits
@cornelia.michlits
mentioned in commit
4b906847
·
Feb 21, 2022
mentioned in commit
4b906847
mentioned in commit 4b906847a09f26896a3770ecd5254ab9de78d445
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment