Skip to content
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

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

fxprunayre
Copy link
Member

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:

<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. Also support broader/narrower terms.

image

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)

Checklist

  • I have read the contribution guidelines
  • Pull request provided for main branch, backports managed with label
  • Good housekeeping of code, cleaning up comments, tests, and documentation
  • Clean commit history broken into understandable chucks, avoiding big commits with hundreds of files, cautious of reformatting and whitespace changes
  • Clean commit messages, longer verbose messages are encouraged
  • API Changes are identified in commit messages
  • Testing provided for features or enhancements using automatic tests
  • User documentation provided for new features or enhancements in manual
  • Build documentation provided for development instructions in README.md files
  • Library management using pom.xml dependency management. Update build documentation with intended library use and library tutorials or documentation

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)
@fxprunayre fxprunayre force-pushed the 44-import-thesaurus-from-ontology branch from c57160d to aeb7587 Compare January 30, 2024 13:38
Copy link

sonarcloud bot commented Jan 30, 2024

Quality Gate Failed Quality Gate failed

Failed conditions

0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

Copy link
Member

@josegar74 josegar74 left a 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.

@fxprunayre fxprunayre merged commit a09a000 into main Feb 12, 2024
8 of 9 checks passed
@ianwallen ianwallen deleted the 44-import-thesaurus-from-ontology branch February 12, 2024 12:14
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fxprunayre

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);

fxprunayre added a commit that referenced this pull request Feb 21, 2024
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
fxprunayre added a commit that referenced this pull request Feb 22, 2024
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
fxprunayre added a commit that referenced this pull request Sep 30, 2024
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.
fxprunayre added a commit to SPW-DIG/metawal-core-geonetwork that referenced this pull request Sep 30, 2024
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.
fxprunayre added a commit that referenced this pull request Oct 10, 2024
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api change Indicate a change in the API changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants