Skip to content

Fix/150 collection permalinks - #170

Merged
RalphBln merged 13 commits into
mainfrom
fix/150-collection-permalinks
Nov 6, 2026
Merged

RalphBln merged 13 commits into
mainfrom
fix/150-collection-permalinks

Conversation

@RalphBln

Copy link
Copy Markdown
Collaborator

This PR resolves #150.

It adds the possibility to use the collection permalink as a query parameter (e.g. https://terminology.services.base4nfdi.de/api-gateway/artefacts?collectionId=https://w3id.org/ts4nfdi/collection/dc45621d-7e40-47ce-9616-4133f0b54edf) and adds the collection permalink to the search result (if the collection uuid or permalink IRI has been used in the query).

The PR introduces the property http://base4nfdi.de/ts4nfdi/schema/collectionIRI because some artefacts have a value for http://www.w3.org/2002/07/owl#versionIRI already set (e.g., OLS uses the versionIRI property), which would then be overwritten.

@RalphBln
RalphBln requested review from jusa3, kespera and nichtich June 10, 2026 18:51
return addCollectionIRI(filterOutByTerminologies(terminologiesCollection.getTerminologies(), data), terminologiesCollection);
}

protected AggregatedApiResponse addCollectionIRI(AggregatedApiResponse response, TerminologyCollection terminologyCollection) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The field should not be http://base4nfdi.de/ts4nfdi/schema/collectionIRI but iri. The iri field should then be mapped to the subject URI in JSON-LD context document:

"@context": {
    "iri": "@id"

Existing field versionIRI could better be merged into identifier (unless there is a clear definition of its semantic difference, I don't see one).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ok, there was a mixup between semantic artefacts and collections. Now this starts making sense to me.

So we want collections to have their permalink as their @id/iri. We do not need collection information in semantic artefacts.

@nichtich nichtich mentioned this pull request Jun 11, 2026
11 of 17 tasks
@codecov-commenter

codecov-commenter commented Jul 14, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 23.52941% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...gateway/controller/TrailingSlashHandlerFilter.java 7.14% 13 Missing ⚠️
...collections/CollectionsJsonLdMessageConverter.java 42.85% 7 Missing and 1 partial ⚠️
...tics/apigateway/collections/CollectionService.java 25.00% 3 Missing ⚠️
...y/collections/models/TerminologyCollectionDto.java 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@RalphBln

RalphBln commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author
  • Removed collection information from what we call semantic artefacts (=terminologies) again.
  • Results can be filtered by collections using either the collection GUID or the entire collection IRI (permalink).
  • Collection output now looks like this:
  {
    "@type": "collection:Collection",
    "@context": {
      "collection": "https://w3id.org/ts4nfdi/collection/",
      "terminologies": "collection:terminologies",
      "creator": "http://purl.org/dc/terms/creator",
      "description": "http://purl.org/dc/terms/description",
      "collaborators": "collection:collaborators",
      "label": "http://www.w3.org/2000/01/rdf-schema#label"
    },
    "label": "basics",
    "creator": "ralph",
    "description": "Just the basics, like rdf, owl, skos, dc, ...",
    "collaborators": [],
    "terminologies": [
      ...
    ],
    "@id": "https://w3id.org/ts4nfdi/collection/914d4490-b756-495b-be32-e15d3b3b2f22",
    "collection:isPublic": true
  }

@RalphBln

RalphBln commented Oct 2, 2026

Copy link
Copy Markdown
Collaborator Author

@nichtich: Do you need the alias "iri": "@id"?

@RalphBln
RalphBln requested a review from nichtich October 2, 2026 13:47

@jusa3 jusa3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Works. Can be merged when #170 (comment) is solved.


@GetMapping("/")
@GetMapping(value = {"", "/"}, produces = CollectionsJsonLdMessageConverter.MEDIA_TYPE_APPLICATION_LD_JSON_VALUE)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This change leads to a duplicate entry in the Swagger docs. Is this intended?

grafik

@RalphBln RalphBln Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

See issue #246 and commits c3a87dc and 2828f62

@nichtich nichtich left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Look like it works as intended.

@RalphBln
RalphBln merged commit 8a25cd2 into main Nov 6, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Include URIs of collection entities

4 participants