-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Change RDF handling for querying Projects from DB (DEV-3175) (
#2989) Co-authored-by: Christian Kleinbölting <[email protected]> Co-authored-by: Christian Kleinbölting <[email protected]>
- Loading branch information
1 parent
ca8319c
commit 884e3a8
Showing
7 changed files
with
1,567 additions
and
11 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
webapi/src/main/scala/org/knora/webapi/slice/admin/repo/rdf/RdfConversions.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright © 2021 - 2024 Swiss National Data and Service Center for the Humanities and/or DaSCH Service Platform contributors. | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package org.knora.webapi.slice.admin.repo.rdf | ||
|
||
import dsp.valueobjects.V2 | ||
import org.knora.webapi.slice.admin.domain.model.KnoraProject.* | ||
import org.knora.webapi.slice.common.repo.rdf.LangString | ||
|
||
object RdfConversions { | ||
implicit val shortcodeConverter: String => Either[String, Shortcode] = | ||
Shortcode.from | ||
|
||
implicit val shortnameConverter: String => Either[String, Shortname] = | ||
Shortname.from | ||
|
||
implicit val longnameConverter: String => Either[String, Longname] = | ||
Longname.from | ||
|
||
implicit val descriptionConverter: LangString => Either[String, Description] = langString => | ||
Description.from(V2.StringLiteralV2(langString.value, langString.lang)) | ||
|
||
implicit val keywordConverter: String => Either[String, Keyword] = | ||
Keyword.from | ||
|
||
implicit val logoConverter: String => Either[String, Logo] = | ||
Logo.from | ||
|
||
implicit val statusConverter: Boolean => Either[String, Status] = | ||
value => Right(Status.from(value)) | ||
|
||
implicit val selfjoinConverter: Boolean => Either[String, SelfJoin] = | ||
value => Right(SelfJoin.from(value)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.