Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
On Thursday, 7th July from 1 to 3 pm there will be a maintenance with a short downtime of GitLab.
Open sidebar
nomad-lab
nomad-FAIR
Commits
39976286
Commit
39976286
authored
May 11, 2021
by
Markus Scheidgen
Browse files
Fixed URL ports. Added creators to catalog in dcat api.
parent
069fc49f
Pipeline
#101321
passed with stages
in 30 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
nomad/app/flask/dcat/mapping.py
View file @
39976286
...
...
@@ -40,12 +40,12 @@ def get_optional_entry_prop(entry, name):
class
Mapping
():
def
__init__
(
self
):
self
.
g
=
Graph
()
self
.
g
.
namespace_manager
.
bind
(
'rdf'
,
RDF
)
self
.
g
.
namespace_manager
.
bind
(
'dcat'
,
DCAT
)
self
.
g
.
namespace_manager
.
bind
(
'dct'
,
DCT
)
self
.
g
.
namespace_manager
.
bind
(
'vcard'
,
VCARD
)
self
.
g
.
namespace_manager
.
bind
(
'foaf'
,
FOAF
)
self
.
g
.
namespace_manager
.
bind
(
'hydra'
,
HYDRA
)
self
.
g
.
bind
(
'rdf'
,
RDF
)
self
.
g
.
bind
(
'dcat'
,
DCAT
)
self
.
g
.
bind
(
'dct'
,
DCT
)
self
.
g
.
bind
(
'vcard'
,
VCARD
)
self
.
g
.
bind
(
'foaf'
,
FOAF
)
self
.
g
.
bind
(
'hydra'
,
HYDRA
)
self
.
persons
=
{}
...
...
@@ -76,6 +76,9 @@ class Mapping():
self
.
g
.
add
((
hydra_collection
,
RDF
.
type
,
HYDRA
.
collection
))
for
person
in
self
.
persons
.
values
():
self
.
g
.
add
((
catalog
,
DCT
.
creator
,
person
))
def
map_entry
(
self
,
entry
:
EntryMetadata
,
slim
=
False
):
dataset
=
URIRef
(
url
(
'datasets'
,
entry
.
calc_id
))
...
...
nomad/config.py
View file @
39976286
...
...
@@ -177,8 +177,7 @@ tests = NomadConfig(
def
api_url
(
ssl
:
bool
=
True
,
api
:
str
=
'api'
):
protocol
=
'https'
if
services
.
https
and
ssl
else
'http'
host_and_port
=
services
.
api_host
.
strip
(
'/'
)
standard_port
=
443
if
protocol
==
'https'
else
80
if
services
.
api_port
!=
standard_port
:
if
services
.
api_port
not
in
[
80
,
443
]:
host_and_port
+=
':'
+
str
(
services
.
api_port
)
base_path
=
services
.
api_base_path
.
strip
(
'/'
)
return
f
'
{
protocol
}
://
{
host_and_port
}
/
{
base_path
}
/
{
api
}
'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment