Skip to content

Commit

Permalink
Only fetch labels with a SPARQL service query based on base URI
Browse files Browse the repository at this point in the history
  • Loading branch information
edmondchuc committed Nov 7, 2022
1 parent 5ccdec3 commit c39fedf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/linkeddata_api/domain/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def get(
}
?uri ?labelProperty ?label .
}
{% if uri.startswith('http://linked.data.gov.au/def/tern-cv/') %}
UNION {
SERVICE <https://graphdb.tern.org.au/repositories/tern_vocabs_core> {
BIND(<{{ uri }}> as ?uri)
Expand All @@ -50,6 +51,7 @@ def get(
?uri ?labelProperty ?label .
}
}
{% endif %}
}
LIMIT 1
"""
Expand Down Expand Up @@ -97,6 +99,7 @@ def _get_from_list_query(uris: list[str]) -> str:
}
?uri ?labelProperty ?label .
}
{% if uri.startswith('http://linked.data.gov.au/def/tern-cv/') %}
UNION {
SERVICE <https://graphdb.tern.org.au/repositories/tern_vocabs_core> {
BIND(<{{ uri }}> as ?uri)
Expand All @@ -111,6 +114,7 @@ def _get_from_list_query(uris: list[str]) -> str:
?uri ?labelProperty ?label .
}
}
{% endif %}
}
LIMIT 1
}
Expand Down

0 comments on commit c39fedf

Please sign in to comment.