diff --git a/community/community-adapter-input-representations/build.gradle.kts b/community/community-adapter-input-representations/build.gradle.kts index fa62af33a..c00ae996f 100644 --- a/community/community-adapter-input-representations/build.gradle.kts +++ b/community/community-adapter-input-representations/build.gradle.kts @@ -9,4 +9,5 @@ dependencies { api(project(":community:community-core-model")) api(project(":graph:graph-core-model")) api(project(":graph:graph-ports-input")) + implementation(project(":graph:graph-core-constants")) } diff --git a/community/community-adapter-input-rest-spring-mvc/build.gradle.kts b/community/community-adapter-input-rest-spring-mvc/build.gradle.kts index 9f0875e30..37143b0b5 100644 --- a/community/community-adapter-input-rest-spring-mvc/build.gradle.kts +++ b/community/community-adapter-input-rest-spring-mvc/build.gradle.kts @@ -16,6 +16,7 @@ testing { implementation(testFixtures(project(":media-storage:media-storage-core-model"))) implementation(project(":common:serialization")) implementation(project(":content-types:content-types-core-model")) + implementation(project(":graph:graph-core-constants")) implementation("io.kotest:kotest-assertions-shared") implementation("io.mockk:mockk-dsl") implementation("io.mockk:mockk-jvm") diff --git a/community/community-core-model/build.gradle.kts b/community/community-core-model/build.gradle.kts index c84b03740..38cd744cb 100644 --- a/community/community-core-model/build.gradle.kts +++ b/community/community-core-model/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { testFixturesApi(project(":media-storage:media-storage-core-model")) testFixturesImplementation(project(":graph:graph-core-model")) testFixturesImplementation(testFixtures(project(":testing:spring"))) + testFixturesImplementation(project(":graph:graph-core-constants")) } testing { diff --git a/community/community-core-services/build.gradle.kts b/community/community-core-services/build.gradle.kts index 0ee87c911..48ed5a898 100644 --- a/community/community-core-services/build.gradle.kts +++ b/community/community-core-services/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { api(project(":media-storage:media-storage-ports-input")) implementation(project(":content-types:content-types-core-model")) implementation(project(":graph:graph-core-model")) // for ResearchFields + implementation(project(":graph:graph-core-constants")) implementation("org.springframework:spring-core") } diff --git a/content-types/content-types-adapter-input-rest-spring-mvc/build.gradle.kts b/content-types/content-types-adapter-input-rest-spring-mvc/build.gradle.kts index 9dd309e6c..4eb376449 100644 --- a/content-types/content-types-adapter-input-rest-spring-mvc/build.gradle.kts +++ b/content-types/content-types-adapter-input-rest-spring-mvc/build.gradle.kts @@ -34,10 +34,11 @@ dependencies { implementation(project(":common:datatypes")) implementation(project(":common:functional")) implementation(project(":common:serialization")) + implementation(project(":graph:graph-core-constants")) testFixturesApi(project(":content-types:content-types-adapter-input-representations")) testFixturesImplementation(project(":common:datatypes")) testFixturesImplementation(project(":common:identifiers")) - testFixturesImplementation(project(":graph:graph-core-model")) + testFixturesImplementation(project(":graph:graph-core-constants")) } testing { diff --git a/content-types/content-types-adapter-output-simcomp/build.gradle.kts b/content-types/content-types-adapter-output-simcomp/build.gradle.kts index 9d78a4aca..6683f6f52 100644 --- a/content-types/content-types-adapter-output-simcomp/build.gradle.kts +++ b/content-types/content-types-adapter-output-simcomp/build.gradle.kts @@ -33,19 +33,20 @@ testing { val test by getting(JvmTestSuite::class) { dependencies { implementation("io.kotest:kotest-assertions-api") + implementation("io.kotest:kotest-assertions-core") implementation("io.kotest:kotest-assertions-shared") implementation("io.kotest:kotest-common") + implementation("io.kotest:kotest-runner-junit5") implementation("io.mockk:mockk-dsl") implementation("io.mockk:mockk-jvm") implementation("org.assertj:assertj-core") implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core") implementation("org.junit.jupiter:junit-jupiter-api") implementation("org.springframework:spring-test") - implementation("io.kotest:kotest-runner-junit5") - implementation("io.kotest:kotest-assertions-core") implementation(project(":common:serialization")) implementation(project(":content-types:content-types-adapter-output-simcomp")) implementation(project(":graph:graph-adapter-input-rest-spring-mvc")) + implementation(project(":graph:graph-core-constants")) implementation(testFixtures(project(":common:spring-webmvc"))) implementation(testFixtures(project(":common:testing"))) implementation(testFixtures(project(":content-types:content-types-core-model"))) diff --git a/content-types/content-types-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts b/content-types/content-types-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts index f2f358b2b..d8895fc51 100644 --- a/content-types/content-types-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts +++ b/content-types/content-types-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts @@ -43,4 +43,5 @@ dependencies { api("org.neo4j:neo4j-cypher-dsl") api(project(":common:neo4j-dsl")) implementation("dev.forkhandles:values4k") + implementation(project(":graph:graph-core-constants")) } diff --git a/content-types/content-types-adapter-output-web/build.gradle.kts b/content-types/content-types-adapter-output-web/build.gradle.kts index 37b736548..c76a1c92c 100644 --- a/content-types/content-types-adapter-output-web/build.gradle.kts +++ b/content-types/content-types-adapter-output-web/build.gradle.kts @@ -14,6 +14,7 @@ dependencies { implementation("org.springframework:spring-web") implementation("dev.forkhandles:values4k") implementation(project(":common:spring-webmvc")) + implementation(project(":integrations:datacite-serialization")) } testing { diff --git a/content-types/content-types-adapter-output-web/src/main/kotlin/org/orkg/contenttypes/adapter/output/web/DataCiteDoiServiceAdapter.kt b/content-types/content-types-adapter-output-web/src/main/kotlin/org/orkg/contenttypes/adapter/output/web/DataCiteDoiServiceAdapter.kt index 60868ff16..601ced9a4 100644 --- a/content-types/content-types-adapter-output-web/src/main/kotlin/org/orkg/contenttypes/adapter/output/web/DataCiteDoiServiceAdapter.kt +++ b/content-types/content-types-adapter-output-web/src/main/kotlin/org/orkg/contenttypes/adapter/output/web/DataCiteDoiServiceAdapter.kt @@ -12,16 +12,16 @@ import org.orkg.common.exceptions.ServiceUnavailable import org.orkg.contenttypes.domain.Author import org.orkg.contenttypes.domain.configuration.DataCiteConfiguration import org.orkg.contenttypes.domain.identifiers.DOI -import org.orkg.contenttypes.domain.json.DataCiteJson -import org.orkg.contenttypes.domain.json.DataCiteJson.Attributes -import org.orkg.contenttypes.domain.json.DataCiteJson.Creator -import org.orkg.contenttypes.domain.json.DataCiteJson.Description -import org.orkg.contenttypes.domain.json.DataCiteJson.NameIdentifier -import org.orkg.contenttypes.domain.json.DataCiteJson.RelatedIdentifier -import org.orkg.contenttypes.domain.json.DataCiteJson.Rights -import org.orkg.contenttypes.domain.json.DataCiteJson.Subject -import org.orkg.contenttypes.domain.json.DataCiteJson.Title -import org.orkg.contenttypes.domain.json.DataCiteJson.Type +import org.orkg.integration.datacite.json.DataCiteJson +import org.orkg.integration.datacite.json.DataCiteJson.Attributes +import org.orkg.integration.datacite.json.DataCiteJson.Creator +import org.orkg.integration.datacite.json.DataCiteJson.Description +import org.orkg.integration.datacite.json.DataCiteJson.NameIdentifier +import org.orkg.integration.datacite.json.DataCiteJson.RelatedIdentifier +import org.orkg.integration.datacite.json.DataCiteJson.Rights +import org.orkg.integration.datacite.json.DataCiteJson.Subject +import org.orkg.integration.datacite.json.DataCiteJson.Title +import org.orkg.integration.datacite.json.DataCiteJson.Type import org.orkg.contenttypes.output.DoiService import org.springframework.http.HttpStatus import org.springframework.http.MediaType diff --git a/content-types/content-types-core-model/build.gradle.kts b/content-types/content-types-core-model/build.gradle.kts index 2f1b9dd5f..286614ada 100644 --- a/content-types/content-types-core-model/build.gradle.kts +++ b/content-types/content-types-core-model/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { api(project(":common:datatypes")) api(project(":common:spring-webmvc")) api(project(":graph:graph-core-model")) + implementation(project(":graph:graph-core-constants")) api("org.springframework:spring-web") testFixturesApi(project(":common:identifiers")) @@ -27,6 +28,7 @@ dependencies { testFixturesImplementation("org.eclipse.rdf4j:rdf4j-common-io") testFixturesImplementation("dev.forkhandles:values4k") testFixturesImplementation(testFixtures(project(":graph:graph-core-model"))) + testFixturesImplementation(project(":graph:graph-core-constants")) } testing { diff --git a/content-types/content-types-core-services/build.gradle.kts b/content-types/content-types-core-services/build.gradle.kts index 1a1b441a8..507b51b19 100644 --- a/content-types/content-types-core-services/build.gradle.kts +++ b/content-types/content-types-core-services/build.gradle.kts @@ -7,15 +7,13 @@ plugins { dependencies { api("org.eclipse.rdf4j:rdf4j-common-io") + api("org.jbibtex:jbibtex") api("org.springframework.data:spring-data-commons") api("org.springframework:spring-beans") api("org.springframework:spring-context") - api(project(":common:spring-data")) - api("org.jbibtex:jbibtex") api(project(":common:functional")) - implementation(project(":common:pagination")) - implementation(project(":common:datatypes")) api(project(":common:identifiers")) + api(project(":common:spring-data")) api(project(":community:community-core-model")) api(project(":community:community-ports-input")) // used in LegacyPaperService api(project(":community:community-ports-output")) @@ -27,6 +25,9 @@ dependencies { api(project(":graph:graph-ports-output")) api(project(":statistics:statistics-core-model")) implementation("dev.forkhandles:values4k") + implementation(project(":common:datatypes")) + implementation(project(":common:pagination")) + implementation(project(":graph:graph-core-constants")) } testing { diff --git a/content-types/content-types-ports-input/build.gradle.kts b/content-types/content-types-ports-input/build.gradle.kts index 4b74ead26..085abe288 100644 --- a/content-types/content-types-ports-input/build.gradle.kts +++ b/content-types/content-types-ports-input/build.gradle.kts @@ -17,6 +17,7 @@ dependencies { testFixturesApi(project(":content-types:content-types-core-model")) testFixturesApi(project(":content-types:content-types-ports-input")) testFixturesImplementation("dev.forkhandles:values4k") + testFixturesImplementation(project(":graph:graph-core-constants")) testFixturesImplementation(project(":graph:graph-core-model")) testFixturesImplementation(testFixtures(project(":content-types:content-types-core-model"))) testFixturesImplementation("org.eclipse.rdf4j:rdf4j-common-io") diff --git a/content-types/content-types-ports-output/build.gradle.kts b/content-types/content-types-ports-output/build.gradle.kts index 010dab059..d90672d19 100644 --- a/content-types/content-types-ports-output/build.gradle.kts +++ b/content-types/content-types-ports-output/build.gradle.kts @@ -20,6 +20,7 @@ dependencies { testFixturesImplementation(project(":common:pagination")) testFixturesImplementation(project(":common:identifiers")) testFixturesImplementation(project(":content-types:content-types-core-model")) + testFixturesImplementation(project(":graph:graph-core-constants")) testFixturesImplementation(project(":graph:graph-core-model")) testFixturesImplementation(testFixtures(project(":common:testing"))) testFixturesImplementation(testFixtures(project(":content-types:content-types-core-model"))) diff --git a/curation/curation-ports-output/build.gradle.kts b/curation/curation-ports-output/build.gradle.kts index 792460eaf..98b21cc6e 100644 --- a/curation/curation-ports-output/build.gradle.kts +++ b/curation/curation-ports-output/build.gradle.kts @@ -16,6 +16,7 @@ dependencies { testFixturesImplementation("io.kotest:kotest-runner-junit5") testFixturesImplementation("io.kotest:kotest-assertions-core") testFixturesImplementation(project(":common:identifiers")) + testFixturesImplementation(project(":graph:graph-core-constants")) testFixturesImplementation(project(":graph:graph-core-model")) testFixturesImplementation(testFixtures(project(":graph:graph-core-model"))) } diff --git a/data-export/data-export-core/build.gradle.kts b/data-export/data-export-core/build.gradle.kts index 9a1845c48..bb984e86b 100644 --- a/data-export/data-export-core/build.gradle.kts +++ b/data-export/data-export-core/build.gradle.kts @@ -6,12 +6,10 @@ plugins { } dependencies { + api("com.fasterxml.jackson.core:jackson-databind") api("org.eclipse.rdf4j:rdf4j-model-api") - implementation("org.eclipse.rdf4j:rdf4j-common-io") api("org.springframework:spring-beans") api("org.springframework:spring-context") - api("com.fasterxml.jackson.core:jackson-databind") - implementation(project(":common:pagination")) api(project(":common:identifiers")) api(project(":content-types:content-types-ports-input")) api(project(":content-types:content-types-ports-output")) @@ -19,11 +17,15 @@ dependencies { api(project(":graph:graph-core-model")) api(project(":graph:graph-ports-output")) implementation("com.fasterxml.jackson.core:jackson-core") + implementation("org.eclipse.rdf4j:rdf4j-common-io") implementation("org.eclipse.rdf4j:rdf4j-model") implementation("org.eclipse.rdf4j:rdf4j-model-vocabulary") + implementation("org.slf4j:slf4j-api") implementation("org.springframework.data:spring-data-commons") + implementation(project(":common:pagination")) implementation(project(":content-types:content-types-core-model")) - implementation("org.slf4j:slf4j-api") + implementation(project(":integrations:datacite-serialization")) + implementation(project(":graph:graph-core-constants")) testFixturesImplementation("io.kotest:kotest-runner-junit5") testFixturesImplementation("io.kotest:kotest-assertions-shared") diff --git a/data-export/data-export-core/src/main/kotlin/org/orkg/export/domain/ExportComparisonService.kt b/data-export/data-export-core/src/main/kotlin/org/orkg/export/domain/ExportComparisonService.kt index 73df0d955..4864e65c3 100644 --- a/data-export/data-export-core/src/main/kotlin/org/orkg/export/domain/ExportComparisonService.kt +++ b/data-export/data-export-core/src/main/kotlin/org/orkg/export/domain/ExportComparisonService.kt @@ -4,20 +4,20 @@ import com.fasterxml.jackson.databind.ObjectMapper import java.io.Writer import java.net.URI import org.orkg.contenttypes.domain.Comparison -import org.orkg.contenttypes.domain.json.DataCiteJson -import org.orkg.contenttypes.domain.json.DataCiteJson.Attributes -import org.orkg.contenttypes.domain.json.DataCiteJson.Creator -import org.orkg.contenttypes.domain.json.DataCiteJson.Description -import org.orkg.contenttypes.domain.json.DataCiteJson.NameIdentifier -import org.orkg.contenttypes.domain.json.DataCiteJson.RelatedIdentifier -import org.orkg.contenttypes.domain.json.DataCiteJson.Rights -import org.orkg.contenttypes.domain.json.DataCiteJson.Subject -import org.orkg.contenttypes.domain.json.DataCiteJson.Title -import org.orkg.contenttypes.domain.json.DataCiteJson.Type import org.orkg.contenttypes.input.ComparisonUseCases import org.orkg.contenttypes.output.ComparisonRepository import org.orkg.export.input.ExportUnpublishedComparisonUseCase import org.orkg.graph.domain.Classes +import org.orkg.integration.datacite.json.DataCiteJson +import org.orkg.integration.datacite.json.DataCiteJson.Attributes +import org.orkg.integration.datacite.json.DataCiteJson.Creator +import org.orkg.integration.datacite.json.DataCiteJson.Description +import org.orkg.integration.datacite.json.DataCiteJson.NameIdentifier +import org.orkg.integration.datacite.json.DataCiteJson.RelatedIdentifier +import org.orkg.integration.datacite.json.DataCiteJson.Rights +import org.orkg.integration.datacite.json.DataCiteJson.Subject +import org.orkg.integration.datacite.json.DataCiteJson.Title +import org.orkg.integration.datacite.json.DataCiteJson.Type import org.springframework.beans.factory.annotation.Value import org.springframework.data.domain.Page import org.springframework.data.domain.PageRequest diff --git a/graph/graph-adapter-input-representations/build.gradle.kts b/graph/graph-adapter-input-representations/build.gradle.kts index 58420b6a5..4dac2abb4 100644 --- a/graph/graph-adapter-input-representations/build.gradle.kts +++ b/graph/graph-adapter-input-representations/build.gradle.kts @@ -4,8 +4,6 @@ plugins { dependencies { api("com.fasterxml.jackson.core:jackson-annotations") - api("com.fasterxml.jackson.core:jackson-annotations") - api("org.eclipse.rdf4j:rdf4j-common-io") api("org.eclipse.rdf4j:rdf4j-common-io") api("org.springframework.data:spring-data-commons") api(project(":common:identifiers")) @@ -14,6 +12,7 @@ dependencies { api(project(":graph:graph-core-model")) api(project(":graph:graph-ports-input")) implementation(project(":common:pagination")) + implementation(project(":graph:graph-core-constants")) } testing { diff --git a/graph/graph-adapter-input-rest-spring-mvc/build.gradle.kts b/graph/graph-adapter-input-rest-spring-mvc/build.gradle.kts index be050799a..4025df921 100644 --- a/graph/graph-adapter-input-rest-spring-mvc/build.gradle.kts +++ b/graph/graph-adapter-input-rest-spring-mvc/build.gradle.kts @@ -36,6 +36,7 @@ testing { dependencies { implementation(project(":common:serialization")) implementation(project(":common:pagination")) + implementation(project(":graph:graph-core-constants")) implementation(testFixtures(project(":community:community-core-model"))) implementation(testFixtures(project(":graph:graph-core-model"))) implementation(testFixtures(project(":testing:spring"))) diff --git a/graph/graph-adapter-output-in-memory/build.gradle.kts b/graph/graph-adapter-output-in-memory/build.gradle.kts index 68f6d1ba0..4e5f25785 100644 --- a/graph/graph-adapter-output-in-memory/build.gradle.kts +++ b/graph/graph-adapter-output-in-memory/build.gradle.kts @@ -13,6 +13,7 @@ dependencies { api(project(":graph:graph-ports-output")) implementation("org.eclipse.rdf4j:rdf4j-common-io") implementation(project(":common:spring-webmvc")) + implementation(project(":graph:graph-core-constants")) } testing { diff --git a/graph/graph-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts b/graph/graph-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts index 693f58dec..fd8d12a9e 100644 --- a/graph/graph-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts +++ b/graph/graph-adapter-output-spring-data-neo4j-sdn6/build.gradle.kts @@ -16,6 +16,7 @@ dependencies { implementation(project(":common:datatypes")) implementation(project(":common:spring-webmvc")) implementation(project(":common:string-utils")) + implementation(project(":graph:graph-core-constants")) api("org.neo4j.driver:neo4j-java-driver") api("org.neo4j:neo4j-cypher-dsl") diff --git a/graph/graph-core-constants/build.gradle.kts b/graph/graph-core-constants/build.gradle.kts new file mode 100644 index 000000000..ea0e5ddde --- /dev/null +++ b/graph/graph-core-constants/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("org.orkg.gradle.kotlin-library") +} + +dependencies { + api(project(":common:identifiers")) +} diff --git a/graph/graph-core-constants/src/main/kotlin/org/orkg/graph/domain/Constants.kt b/graph/graph-core-constants/src/main/kotlin/org/orkg/graph/domain/Constants.kt new file mode 100644 index 000000000..f0ea6d5f4 --- /dev/null +++ b/graph/graph-core-constants/src/main/kotlin/org/orkg/graph/domain/Constants.kt @@ -0,0 +1,196 @@ +package org.orkg.graph.domain + +import org.orkg.common.ThingId + +object Predicates { + val addresses = ThingId("P0") + val comparesContribution = ThingId("compareContribution") + val csvwCells = ThingId("CSVW_Cells") + val csvwColumn = ThingId("CSVW_Column") + val csvwColumns = ThingId("CSVW_Columns") + val csvwNumber = ThingId("CSVW_Number") + val csvwRows = ThingId("CSVW_Rows") + val csvwTitles = ThingId("CSVW_Titles") + val csvwValue = ThingId("CSVW_Value") + val description = ThingId("description") + val employs = ThingId("P2") + val exampleOfUsage = ThingId("exampleOfUsage") + val field = ThingId("P24") + val hasAuthor = ThingId("P27") + val hasAuthors = ThingId("hasAuthors") + val hasContent = ThingId("hasContent") + val hasContribution = ThingId("P31") + val hasDOI = ThingId("P26") + val hasEntities = ThingId("hasEntities") + val hasEntity = ThingId("HasEntity") + val hasEntry = ThingId("HasEntry") + val hasEvaluation = ThingId("HAS_EVALUATION") + val hasGoogleScholarId = ThingId("googleScholarID") + val hasHeadingLevel = ThingId("HasHeadingLevel") + val hasImage = ThingId("Image") + val hasISBN = ThingId("P37140") + val hasISSN = ThingId("P74029") + val hasLink = ThingId("HasLink") + val hasLinkedInId = ThingId("linkedInID") + val hasListElement = ThingId("hasListElement") + val hasObjectPosition = ThingId("hasObjectPosition") + val hasOpenAlexId = ThingId("P151073") + val hasORCID = ThingId("HAS_ORCID") + val hasPaper = ThingId("HasPaper") + val hasPublishedVersion = ThingId("hasPublishedVersion") + val hasPreviousVersion = ThingId("hasPreviousVersion") + val hasReference = ThingId("HasReference") + val hasRelatedFigure = ThingId("RelatedFigure") + val hasRelatedResource = ThingId("RelatedResource") + val hasResearchField = ThingId("P30") + val hasResearchGateId = ThingId("researchGateID") + val hasResearchProblem = ThingId("P32") + val hasSection = ThingId("HasSection") + val hasSections = ThingId("hasSections") + val hasSubfield = ThingId("P36") + val hasSubject = ThingId("hasSubject") + val hasSubjectPosition = ThingId("hasSubjectPosition") + val hasURL = ThingId("url") + val hasVenue = ThingId("HAS_VENUE") + val hasVisualization = ThingId("hasVisualization") + val hasWebOfScienceId = ThingId("P58083") + val hasWebsite = ThingId("website") + val hasWikidataId = ThingId("P76020") + val isAnonymized = ThingId("IsAnonymized") + val mentions = ThingId("mentions") + val monthPublished = ThingId("P28") + val placeholder = ThingId("placeholder") + val reference = ThingId("reference") + val sameAs = ThingId("SAME_AS") + val shClass = ThingId("sh:class") + val shClosed = ThingId("sh:closed") + val shDatatype = ThingId("sh:datatype") + val shMaxCount = ThingId("sh:maxCount") + val shMaxInclusive = ThingId("sh:maxInclusive") + val shMinCount = ThingId("sh:minCount") + val shMinInclusive = ThingId("sh:minInclusive") + val shOrder = ThingId("sh:order") + val showProperty = ThingId("ShowProperty") + val shPath = ThingId("sh:path") + val shPattern = ThingId("sh:pattern") + val shProperty = ThingId("sh:property") + val shTargetClass = ThingId("sh:targetClass") + val sustainableDevelopmentGoal = ThingId("sustainableDevelopmentGoal") + val templateLabelFormat = ThingId("TemplateLabelFormat") + val templateOfPredicate = ThingId("TemplateOfPredicate") + val templateOfResearchField = ThingId("TemplateOfResearchField") + val templateOfResearchProblem = ThingId("TemplateOfResearchProblem") + val yields = ThingId("P1") + val yearPublished = ThingId("P29") +} + +object Classes { + val `class` = ThingId("Class") + val acknowledgements = ThingId("Acknowledgements") + val author = ThingId("Author") + val background = ThingId("Background") + val base64Binary = ThingId("Base64Binary") + val boolean = ThingId("Boolean") + val byte = ThingId("Byte") + val caption = ThingId("Caption") + val cell = ThingId("Cell") + val classes = ThingId("Classes") + val column = ThingId("Column") + val comparison = ThingId("Comparison") + val comparisonPublished = ThingId("ComparisonPublished") + val comparisonRelatedFigure = ThingId("ComparisonRelatedFigure") + val comparisonRelatedResource = ThingId("ComparisonRelatedResource") + val comparisonSection = ThingId("ComparisonSection") + val conclusion = ThingId("Conclusion") + val contribution = ThingId("Contribution") + val contributionSmartReview = ThingId("ContributionSmartReview") + val data = ThingId("Data") + val dataset = ThingId("Dataset") + val datasetDescription = ThingId("DatasetDescription") + val date = ThingId("Date") + val dateTime = ThingId("DateTime") + val dateTimeStamp = ThingId("DateTimeStamp") + val dayTimeDuration = ThingId("DayTimeDuration") + val decimal = ThingId("Decimal") + val deletedComparison = ThingId("ComparisonDeleted") + val discussion = ThingId("Discussion") + val double = ThingId("Double") + val duration = ThingId("Duration") + val epilogue = ThingId("Epilogue") + val evaluation = ThingId("Evaluation") + val externalResourceDescription = ThingId("ExternalResourceDescription") + val float = ThingId("Float") + val futureWork = ThingId("FutureWork") + val gregorianDay = ThingId("GregorianDay") + val gregorianMonth = ThingId("GregorianMonth") + val gregorianMonthDay = ThingId("GregorianMonthDay") + val gregorianYear = ThingId("GregorianYear") + val gregorianYearMonth = ThingId("GregorianYearMonth") + val hexBinary = ThingId("HexBinary") + val int32 = ThingId("Int") + val integer = ThingId("Integer") + val introduction = ThingId("Introduction") + val language = ThingId("LanguageTag") + val legend = ThingId("Legend") + val latestVersion = ThingId("LatestVersion") + val list = ThingId("List") + val listSection = ThingId("ListSection") + val literal = ThingId("Literal") + val literatureList = ThingId("LiteratureList") + val literatureListPublished = ThingId("LiteratureListPublished") + val long = ThingId("Long") + val materials = ThingId("Materials") + val methods = ThingId("Methods") + val model = ThingId("Model") + val motivation = ThingId("Motivation") + val negativeInteger = ThingId("NegativeInteger") + val nodeShape = ThingId("NodeShape") + val nonNegativeInteger = ThingId("NonNegativeInteger") + val nonPositiveInteger = ThingId("NonPositiveInteger") + val normalizedString = ThingId("NormalizedString") + val ontologySection = ThingId("OntologySection") + val paper = ThingId("Paper") + val paperDeleted = ThingId("PaperDeleted") + val paperVersion = ThingId("PaperVersion") + val positiveInteger = ThingId("PositiveInteger") + val postscript = ThingId("Postscript") + val predicate = ThingId("Predicate") + val predicates = ThingId("Predicates") + val problem = ThingId("Problem") + val problemStatement = ThingId("ProblemStatement") + val prologue = ThingId("Prologue") + val propertySection = ThingId("PropertySection") + val propertyShape = ThingId("PropertyShape") + val relatedWork = ThingId("RelatedWork") + val researchField = ThingId("ResearchField") + val resource = ThingId("Resource") + val resources = ThingId("Resources") + val resourceSection = ThingId("ResourceSection") + val results = ThingId("Results") + val rosettaNodeShape = ThingId("RosettaNodeShape") + val rosettaStoneStatement = ThingId("RosettaStoneStatement") + val row = ThingId("Row") + val table = ThingId("Table") + val token = ThingId("Token") + val scenario = ThingId("Scenario") + val section = ThingId("Section") + val short = ThingId("Short") + val smartReview = ThingId("SmartReview") + val smartReviewPublished = ThingId("SmartReviewPublished") + val software = ThingId("Software") + val string = ThingId("String") + val supplementaryInformationDescription = ThingId("SupplementaryInformationDescription") + val sustainableDevelopmentGoal = ThingId("SustainableDevelopmentGoal") + val textSection = ThingId("TextSection") + val thing = ThingId("Thing") + val time = ThingId("Time") + val unsignedByte = ThingId("UnsignedByte") + val unsignedInt = ThingId("UnsignedInt") + val unsignedLong = ThingId("UnsignedLong") + val unsignedShort = ThingId("UnsignedShort") + val uri = ThingId("URI") + val venue = ThingId("Venue") + val visualization = ThingId("Visualization") + val visualizationSection = ThingId("VisualizationSection") + val yearMonthDuration = ThingId("YearMonthDuration") +} diff --git a/graph/graph-core-model/build.gradle.kts b/graph/graph-core-model/build.gradle.kts index 434d1e113..18bc56a26 100644 --- a/graph/graph-core-model/build.gradle.kts +++ b/graph/graph-core-model/build.gradle.kts @@ -9,6 +9,7 @@ dependencies { api("org.springframework:spring-web") api("dev.forkhandles:values4k") api(project(":common:identifiers")) + implementation(project(":graph:graph-core-constants")) api(project(":common:spring-webmvc")) implementation(project(":common:datatypes")) implementation(project(":common:string-utils")) @@ -19,6 +20,7 @@ dependencies { testFixturesApi(project(":common:identifiers")) testFixturesImplementation(testFixtures(project(":testing:spring"))) testFixturesRuntimeOnly("org.springframework:spring-core") + testFixturesImplementation(project(":graph:graph-core-constants")) } testing { diff --git a/graph/graph-core-model/src/main/kotlin/org/orkg/graph/domain/Constants.kt b/graph/graph-core-model/src/main/kotlin/org/orkg/graph/domain/Constants.kt index 003acf7a6..6b62ab16f 100644 --- a/graph/graph-core-model/src/main/kotlin/org/orkg/graph/domain/Constants.kt +++ b/graph/graph-core-model/src/main/kotlin/org/orkg/graph/domain/Constants.kt @@ -41,199 +41,6 @@ val reservedClassIds = setOf( Classes.thing ) -object Predicates { - val addresses = ThingId("P0") - val comparesContribution = ThingId("compareContribution") - val csvwCells = ThingId("CSVW_Cells") - val csvwColumn = ThingId("CSVW_Column") - val csvwColumns = ThingId("CSVW_Columns") - val csvwNumber = ThingId("CSVW_Number") - val csvwRows = ThingId("CSVW_Rows") - val csvwTitles = ThingId("CSVW_Titles") - val csvwValue = ThingId("CSVW_Value") - val description = ThingId("description") - val employs = ThingId("P2") - val exampleOfUsage = ThingId("exampleOfUsage") - val field = ThingId("P24") - val hasAuthor = ThingId("P27") - val hasAuthors = ThingId("hasAuthors") - val hasContent = ThingId("hasContent") - val hasContribution = ThingId("P31") - val hasDOI = ThingId("P26") - val hasEntities = ThingId("hasEntities") - val hasEntity = ThingId("HasEntity") - val hasEntry = ThingId("HasEntry") - val hasEvaluation = ThingId("HAS_EVALUATION") - val hasGoogleScholarId = ThingId("googleScholarID") - val hasHeadingLevel = ThingId("HasHeadingLevel") - val hasImage = ThingId("Image") - val hasISBN = ThingId("P37140") - val hasISSN = ThingId("P74029") - val hasLink = ThingId("HasLink") - val hasLinkedInId = ThingId("linkedInID") - val hasListElement = ThingId("hasListElement") - val hasObjectPosition = ThingId("hasObjectPosition") - val hasOpenAlexId = ThingId("P151073") - val hasORCID = ThingId("HAS_ORCID") - val hasPaper = ThingId("HasPaper") - val hasPublishedVersion = ThingId("hasPublishedVersion") - val hasPreviousVersion = ThingId("hasPreviousVersion") - val hasReference = ThingId("HasReference") - val hasRelatedFigure = ThingId("RelatedFigure") - val hasRelatedResource = ThingId("RelatedResource") - val hasResearchField = ThingId("P30") - val hasResearchGateId = ThingId("researchGateID") - val hasResearchProblem = ThingId("P32") - val hasSection = ThingId("HasSection") - val hasSections = ThingId("hasSections") - val hasSubfield = ThingId("P36") - val hasSubject = ThingId("hasSubject") - val hasSubjectPosition = ThingId("hasSubjectPosition") - val hasURL = ThingId("url") - val hasVenue = ThingId("HAS_VENUE") - val hasVisualization = ThingId("hasVisualization") - val hasWebOfScienceId = ThingId("P58083") - val hasWebsite = ThingId("website") - val hasWikidataId = ThingId("P76020") - val isAnonymized = ThingId("IsAnonymized") - val mentions = ThingId("mentions") - val monthPublished = ThingId("P28") - val placeholder = ThingId("placeholder") - val reference = ThingId("reference") - val sameAs = ThingId("SAME_AS") - val shClass = ThingId("sh:class") - val shClosed = ThingId("sh:closed") - val shDatatype = ThingId("sh:datatype") - val shMaxCount = ThingId("sh:maxCount") - val shMaxInclusive = ThingId("sh:maxInclusive") - val shMinCount = ThingId("sh:minCount") - val shMinInclusive = ThingId("sh:minInclusive") - val shOrder = ThingId("sh:order") - val showProperty = ThingId("ShowProperty") - val shPath = ThingId("sh:path") - val shPattern = ThingId("sh:pattern") - val shProperty = ThingId("sh:property") - val shTargetClass = ThingId("sh:targetClass") - val sustainableDevelopmentGoal = ThingId("sustainableDevelopmentGoal") - val templateLabelFormat = ThingId("TemplateLabelFormat") - val templateOfPredicate = ThingId("TemplateOfPredicate") - val templateOfResearchField = ThingId("TemplateOfResearchField") - val templateOfResearchProblem = ThingId("TemplateOfResearchProblem") - val yields = ThingId("P1") - val yearPublished = ThingId("P29") -} - -object Classes { - val `class` = ThingId("Class") - val acknowledgements = ThingId("Acknowledgements") - val author = ThingId("Author") - val background = ThingId("Background") - val base64Binary = ThingId("Base64Binary") - val boolean = ThingId("Boolean") - val byte = ThingId("Byte") - val caption = ThingId("Caption") - val cell = ThingId("Cell") - val classes = ThingId("Classes") - val column = ThingId("Column") - val comparison = ThingId("Comparison") - val comparisonPublished = ThingId("ComparisonPublished") - val comparisonRelatedFigure = ThingId("ComparisonRelatedFigure") - val comparisonRelatedResource = ThingId("ComparisonRelatedResource") - val comparisonSection = ThingId("ComparisonSection") - val conclusion = ThingId("Conclusion") - val contribution = ThingId("Contribution") - val contributionSmartReview = ThingId("ContributionSmartReview") - val data = ThingId("Data") - val dataset = ThingId("Dataset") - val datasetDescription = ThingId("DatasetDescription") - val date = ThingId("Date") - val dateTime = ThingId("DateTime") - val dateTimeStamp = ThingId("DateTimeStamp") - val dayTimeDuration = ThingId("DayTimeDuration") - val decimal = ThingId("Decimal") - val deletedComparison = ThingId("ComparisonDeleted") - val discussion = ThingId("Discussion") - val double = ThingId("Double") - val duration = ThingId("Duration") - val epilogue = ThingId("Epilogue") - val evaluation = ThingId("Evaluation") - val externalResourceDescription = ThingId("ExternalResourceDescription") - val float = ThingId("Float") - val futureWork = ThingId("FutureWork") - val gregorianDay = ThingId("GregorianDay") - val gregorianMonth = ThingId("GregorianMonth") - val gregorianMonthDay = ThingId("GregorianMonthDay") - val gregorianYear = ThingId("GregorianYear") - val gregorianYearMonth = ThingId("GregorianYearMonth") - val hexBinary = ThingId("HexBinary") - val int32 = ThingId("Int") - val integer = ThingId("Integer") - val introduction = ThingId("Introduction") - val language = ThingId("LanguageTag") - val legend = ThingId("Legend") - val latestVersion = ThingId("LatestVersion") - val list = ThingId("List") - val listSection = ThingId("ListSection") - val literal = ThingId("Literal") - val literatureList = ThingId("LiteratureList") - val literatureListPublished = ThingId("LiteratureListPublished") - val long = ThingId("Long") - val materials = ThingId("Materials") - val methods = ThingId("Methods") - val model = ThingId("Model") - val motivation = ThingId("Motivation") - val negativeInteger = ThingId("NegativeInteger") - val nodeShape = ThingId("NodeShape") - val nonNegativeInteger = ThingId("NonNegativeInteger") - val nonPositiveInteger = ThingId("NonPositiveInteger") - val normalizedString = ThingId("NormalizedString") - val ontologySection = ThingId("OntologySection") - val paper = ThingId("Paper") - val paperDeleted = ThingId("PaperDeleted") - val paperVersion = ThingId("PaperVersion") - val positiveInteger = ThingId("PositiveInteger") - val postscript = ThingId("Postscript") - val predicate = ThingId("Predicate") - val predicates = ThingId("Predicates") - val problem = ThingId("Problem") - val problemStatement = ThingId("ProblemStatement") - val prologue = ThingId("Prologue") - val propertySection = ThingId("PropertySection") - val propertyShape = ThingId("PropertyShape") - val relatedWork = ThingId("RelatedWork") - val researchField = ThingId("ResearchField") - val resource = ThingId("Resource") - val resources = ThingId("Resources") - val resourceSection = ThingId("ResourceSection") - val results = ThingId("Results") - val rosettaNodeShape = ThingId("RosettaNodeShape") - val rosettaStoneStatement = ThingId("RosettaStoneStatement") - val row = ThingId("Row") - val table = ThingId("Table") - val token = ThingId("Token") - val scenario = ThingId("Scenario") - val section = ThingId("Section") - val short = ThingId("Short") - val smartReview = ThingId("SmartReview") - val smartReviewPublished = ThingId("SmartReviewPublished") - val software = ThingId("Software") - val string = ThingId("String") - val supplementaryInformationDescription = ThingId("SupplementaryInformationDescription") - val sustainableDevelopmentGoal = ThingId("SustainableDevelopmentGoal") - val textSection = ThingId("TextSection") - val thing = ThingId("Thing") - val time = ThingId("Time") - val unsignedByte = ThingId("UnsignedByte") - val unsignedInt = ThingId("UnsignedInt") - val unsignedLong = ThingId("UnsignedLong") - val unsignedShort = ThingId("UnsignedShort") - val uri = ThingId("URI") - val venue = ThingId("Venue") - val visualization = ThingId("Visualization") - val visualizationSection = ThingId("VisualizationSection") - val yearMonthDuration = ThingId("YearMonthDuration") -} - object Literals { enum class XSD( fragment: String, diff --git a/graph/graph-core-services/build.gradle.kts b/graph/graph-core-services/build.gradle.kts index f89f04f73..f3c67ab69 100644 --- a/graph/graph-core-services/build.gradle.kts +++ b/graph/graph-core-services/build.gradle.kts @@ -12,8 +12,9 @@ dependencies { api(project(":graph:graph-core-model")) api(project(":graph:graph-ports-input")) api(project(":graph:graph-ports-output")) - implementation(project(":common:pagination")) implementation(project(":common:datatypes")) + implementation(project(":common:pagination")) + implementation(project(":graph:graph-core-constants")) api("org.eclipse.rdf4j:rdf4j-common-io") api("org.springframework.data:spring-data-commons") diff --git a/graph/graph-ports-output/build.gradle.kts b/graph/graph-ports-output/build.gradle.kts index 8e38d3c65..3fd1cfff3 100644 --- a/graph/graph-ports-output/build.gradle.kts +++ b/graph/graph-ports-output/build.gradle.kts @@ -18,6 +18,7 @@ dependencies { testFixturesImplementation("dev.forkhandles:fabrikate4k") testFixturesImplementation("io.kotest:kotest-assertions-core") testFixturesImplementation(project(":common:identifiers")) + testFixturesImplementation(project(":graph:graph-core-constants")) testFixturesImplementation(project(":graph:graph-core-model")) testFixturesImplementation(testFixtures(project(":common:testing"))) testFixturesImplementation(testFixtures(project(":graph:graph-core-model"))) diff --git a/integrations/datacite-serialization/build.gradle.kts b/integrations/datacite-serialization/build.gradle.kts new file mode 100644 index 000000000..cd7838dac --- /dev/null +++ b/integrations/datacite-serialization/build.gradle.kts @@ -0,0 +1,3 @@ +plugins { + id("org.orkg.gradle.kotlin-library") +} diff --git a/content-types/content-types-core-model/src/main/kotlin/org/orkg/contenttypes/domain/json/DataCiteJson.kt b/integrations/datacite-serialization/src/main/kotlin/org/orkg/integration/datacite/json/DataCiteJson.kt similarity index 77% rename from content-types/content-types-core-model/src/main/kotlin/org/orkg/contenttypes/domain/json/DataCiteJson.kt rename to integrations/datacite-serialization/src/main/kotlin/org/orkg/integration/datacite/json/DataCiteJson.kt index fb304b49e..a3b72077f 100644 --- a/content-types/content-types-core-model/src/main/kotlin/org/orkg/contenttypes/domain/json/DataCiteJson.kt +++ b/integrations/datacite-serialization/src/main/kotlin/org/orkg/integration/datacite/json/DataCiteJson.kt @@ -1,7 +1,6 @@ -package org.orkg.contenttypes.domain.json +package org.orkg.integration.datacite.json import com.fasterxml.jackson.annotation.JsonInclude -import com.fasterxml.jackson.annotation.JsonInclude.Include import com.fasterxml.jackson.annotation.JsonTypeInfo import com.fasterxml.jackson.annotation.JsonTypeName import java.net.URI @@ -10,13 +9,13 @@ import java.net.URI @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME) data class DataCiteJson( val attributes: Attributes, - val type: String = "dois" + val type: String = "dois", ) { - @JsonInclude(Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_NULL) data class Attributes( - @JsonInclude(Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_NULL) val doi: String? = null, - @JsonInclude(Include.NON_NULL) + @JsonInclude(JsonInclude.Include.NON_NULL) val event: String? = null, val creators: List, val titles: List, @@ -28,55 +27,55 @@ data class DataCiteJson( val descriptions: List<Description>, val url: URI, val language: String = "en", - val publisher: String = "Open Research Knowledge Graph" + val publisher: String = "Open Research Knowledge Graph", ) data class Creator( val name: String, val nameIdentifiers: List<NameIdentifier>, - val nameType: String = "Personal" + val nameType: String = "Personal", ) data class NameIdentifier( val schemeUri: URI, val nameIdentifier: String, - val nameIdentifierScheme: String + val nameIdentifierScheme: String, ) { companion object { fun fromORCID(orcid: String): NameIdentifier = NameIdentifier( schemeUri = URI.create("https://orcid.org"), nameIdentifier = "https://orcid.org/$orcid", - nameIdentifierScheme = "ORCID" + nameIdentifierScheme = "ORCID", ) } } data class Title( val title: String, - val lang: String = "en" + val lang: String = "en", ) data class Subject( val subject: String, - val lang: String = "en" + val lang: String = "en", ) data class Type( val resourceType: String, - val resourceTypeGeneral: String + val resourceTypeGeneral: String, ) data class RelatedIdentifier( val relatedIdentifier: String, val relatedIdentifierType: String, - val relationType: String = "IsVariantFormOf" + val relationType: String = "IsVariantFormOf", ) { companion object { fun fromDOI(doi: String): RelatedIdentifier = RelatedIdentifier( relatedIdentifier = sanitizeDOI(doi), - relatedIdentifierType = "DOI" + relatedIdentifierType = "DOI", ) private fun sanitizeDOI(doi: String): String = @@ -92,18 +91,18 @@ data class DataCiteJson( data class Rights( val rights: String, - val rightsUri: URI + val rightsUri: URI, ) { companion object { val CC_BY_SA_4_0 = Rights( rights = "Creative Commons Attribution-ShareAlike 4.0 International License.", - rightsUri = URI.create("https://creativecommons.org/licenses/by-sa/4.0/") + rightsUri = URI.create("https://creativecommons.org/licenses/by-sa/4.0/"), ) } } data class Description( val description: String, - val descriptionType: String = "Abstract" + val descriptionType: String = "Abstract", ) } diff --git a/profiling/profiling-adapter-output/build.gradle.kts b/profiling/profiling-adapter-output/build.gradle.kts index 09182726d..516d2dd51 100644 --- a/profiling/profiling-adapter-output/build.gradle.kts +++ b/profiling/profiling-adapter-output/build.gradle.kts @@ -15,4 +15,5 @@ dependencies { api(project(":profiling:profiling-core-model")) api(project(":profiling:profiling-ports-output")) implementation(project(":community:community-core-model")) + implementation(project(":graph:graph-core-constants")) } diff --git a/rest-api-server/build.gradle.kts b/rest-api-server/build.gradle.kts index 81674e836..7d5e6f1df 100644 --- a/rest-api-server/build.gradle.kts +++ b/rest-api-server/build.gradle.kts @@ -42,6 +42,7 @@ testing { implementation(project(":common:pagination")) implementation(testFixtures(project(":common:testing"))) implementation(project(":graph:graph-core-services")) + implementation(project(":graph:graph-core-constants")) implementation(project(":graph:graph-ports-output")) implementation(testFixtures(project(":graph:graph-adapter-input-rest-spring-mvc"))) implementation(project(":content-types:content-types-ports-output")) @@ -128,6 +129,7 @@ dependencies { runtimeOnly(project(":graph:graph-adapter-input-rest-spring-mvc")) implementation(project(":graph:graph-adapter-output-spring-data-neo4j-sdn6")) runtimeOnly(project(":graph:graph-adapter-output-web")) + implementation(project(":graph:graph-core-constants")) implementation(project(":graph:graph-core-model")) implementation(project(":graph:graph-core-services")) implementation(project(":graph:graph-ports-input")) diff --git a/settings.gradle.kts b/settings.gradle.kts index eab9f375f..6e7594c87 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,6 +33,7 @@ include( // services. This name might also reflect better that we may be able to split it out as a separate application (or // "microservice", if you prefer.) Also, we will share the ports from within the domain project for the time being. // This may change in the future. + "graph:graph-core-constants", "graph:graph-core-model", "graph:graph-core-services", "graph:graph-ports-input", @@ -114,3 +115,4 @@ include( ) include("widget") include("rest-api-server") +include(":integrations:datacite-serialization") diff --git a/statistics/statistics-ports-output/build.gradle.kts b/statistics/statistics-ports-output/build.gradle.kts index ef4f2fd78..0912a8fa5 100644 --- a/statistics/statistics-ports-output/build.gradle.kts +++ b/statistics/statistics-ports-output/build.gradle.kts @@ -12,6 +12,7 @@ dependencies { testFixturesImplementation("dev.forkhandles:fabrikate4k") testFixturesImplementation("io.kotest:kotest-runner-junit5") testFixturesImplementation(project(":common:identifiers")) + testFixturesImplementation(project(":graph:graph-core-constants")) testFixturesImplementation(project(":graph:graph-core-model")) testFixturesImplementation(testFixtures(project(":graph:graph-core-model"))) } diff --git a/widget/build.gradle.kts b/widget/build.gradle.kts index cb73f8e58..85cf6dad4 100644 --- a/widget/build.gradle.kts +++ b/widget/build.gradle.kts @@ -12,6 +12,7 @@ dependencies { implementation(project(":common:spring-webmvc")) api(project(":graph:graph-ports-input")) implementation(project(":graph:graph-core-model")) + implementation(project(":graph:graph-core-constants")) } testing {