-
-
Notifications
You must be signed in to change notification settings - Fork 489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thesaurus / Add support for thesaurus described using OWL format #7674
Conversation
services/src/main/java/org/fao/geonet/api/registries/vocabularies/KeywordsApi.java
Fixed
Show resolved
Hide resolved
A number of DCAT related vocabularies are published using OWL format describing a concept schema and concepts. eg. https://mobilitydcat-ap.github.io/controlled-vocabularies/network-coverage/latest/index.html ```xml <owl:NamedIndividual rdf:about="https://w3id.org/mobilitydcat-ap/mobility-theme/accesibility-information-for-vehicles"> <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#Concept"/> <skos:broader rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-sub-category"/> <skos:broader rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/public-transport-non-scheduled-transport"/> <skos:inScheme rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme"/> <skos:prefLabel xml:lang="en">Accesibility information for vehicles</skos:prefLabel> </owl:NamedIndividual> ``` Add the possibility to import those files directly by converting them from OWL to SKOS format supported by GeoNetwork. API changes: * when using the `stylesheet` parameter of the upload thesaurus operation, restrict the use to known file in `xslt/services/thesaurus/` folder. Also some Sonar lint items. Funded by Wallonia region (SPW)
c57160d
to
aeb7587
Compare
Quality Gate failedFailed conditions 0.0% Coverage on New Code (required ≥ 80%) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, works fine. Code changes look good.
@@ -631,7 +632,8 @@ private Object getKeyword( | |||
value = "/{thesaurus:.+}", | |||
method = RequestMethod.GET, | |||
produces = { | |||
MediaType.TEXT_XML_VALUE | |||
MediaType.TEXT_XML_VALUE, | |||
MediaType.APPLICATION_XML_VALUE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I noticed that you added MediaType.APPLICATION_XML_VALUE
However this function uses the following content type.
response.setContentType("text/xml");
If someone calls the api requesting MediaType.APPLICATION_XML_VALUE
, I think they would expect MediaType.APPLICATION_XML_VALUE
and not MediaType.TEXT_XML_VALUE
Should
response.setContentType("text/xml");
Be replaced with
String acceptHeader = StringUtils.isBlank(request.getHeader(HttpHeaders.ACCEPT)) ? MediaType.TEXT_XML_VALUE : request.getHeader(HttpHeaders.ACCEPT);
response.setContentType(acceptHeader);
SDMX is a common format used to statistical data and can be used to describe codelist. eg https://ec.europa.eu/eurostat/databrowser/bulk?lang=en&selectedTab=codeList Add possibility to import those codelist as SKOS format. Filename must use extension `.sdmx`. Similar to #7674
SDMX is a common format used to statistical data and can be used to describe codelist. eg https://ec.europa.eu/eurostat/databrowser/bulk?lang=en&selectedTab=codeList Add possibility to import those codelist as SKOS format. Filename must use extension `.sdmx`. Similar to #7674
Follow up of #7674 Mobility DCAT theme vocabulary top concepts is available at https://mobilitydcat-ap.github.io/controlled-vocabularies/mobility-theme/latest/index.html#/ The vocabulary contains 2 top concepts: ```xml <skos:hasTopConcept rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-category"/> <skos:hasTopConcept rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-sub-category"/> ``` which are not really needed for browsing the main categories and sub categories. Use the narrower terms of the "content category" top concept as the top concepts of the scheme to facilitate keyword selection in editor and generate proper facet hierarchy in search.
Follow up of geonetwork#7674 Mobility DCAT theme vocabulary top concepts is available at https://mobilitydcat-ap.github.io/controlled-vocabularies/mobility-theme/latest/index.html#/ The vocabulary contains 2 top concepts: ```xml <skos:hasTopConcept rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-category"/> <skos:hasTopConcept rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-sub-category"/> ``` which are not really needed for browsing the main categories and sub categories. Use the narrower terms of the "content category" top concept as the top concepts of the scheme to facilitate keyword selection in editor and generate proper facet hierarchy in search.
* Thesaurus / OWL format / Mobility theme hierarchy Follow up of #7674 Mobility DCAT theme vocabulary top concepts is available at https://mobilitydcat-ap.github.io/controlled-vocabularies/mobility-theme/latest/index.html#/ The vocabulary contains 2 top concepts: ```xml <skos:hasTopConcept rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-category"/> <skos:hasTopConcept rdf:resource="https://w3id.org/mobilitydcat-ap/mobility-theme/data-content-sub-category"/> ``` which are not really needed for browsing the main categories and sub categories. Use the narrower terms of the "content category" top concept as the top concepts of the scheme to facilitate keyword selection in editor and generate proper facet hierarchy in search. * Fix test The 2 default top concepts of the vocabulary are replaced by correct one.
A number of DCAT related vocabularies are published using OWL format describing a concept schema and concepts. eg. https://mobilitydcat-ap.github.io/controlled-vocabularies/network-coverage/latest/index.html
Concepts are described using:
Add the possibility to import those files directly by converting them from OWL to SKOS format supported by GeoNetwork. Also support broader/narrower terms.
API changes:
stylesheet
parameter of the upload thesaurus operation, restrict the use to known file inxslt/services/thesaurus/
folder.Also some Sonar lint items.
Funded by Wallonia region (SPW)
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation