Skip to content
This repository has been archived by the owner on May 23, 2024. It is now read-only.

Update knowledge sources #638

Draft
wants to merge 3 commits into
base: generate-test-data
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ organization := "org.renci"

name := "cam-kp-api"

version := "0.3-pre4"
version := "0.3"

licenses := Seq("MIT license" -> url("https://opensource.org/licenses/MIT"))

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
version = "0.3-pre4"
version = "0.3"
host = 0.0.0.0
port = 8080
port = ${?PORT}
Expand Down
34 changes: 17 additions & 17 deletions src/main/scala/org/renci/cam/QueryService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ object QueryService extends LazyLogging {
appConfig <- getConfig[AppConfig]

// Generate the attributes we will need to produce the edge output.
originalKS <- ZIO
.fromOption(biolinkData.predicates.find(p => p.shorthand == "original_knowledge_source"))
.orElseFail(new Exception("could not get biolink:original_knowledge_source"))
primaryKS <- ZIO
.fromOption(biolinkData.predicates.find(p => p.shorthand == "primary_knowledge_source"))
.orElseFail(new Exception("could not get biolink:primary_knowledge_source"))
aggregatorKS <- ZIO
.fromOption(biolinkData.predicates.find(p => p.shorthand == "aggregator_knowledge_source"))
.orElseFail(new Exception("could not get biolink:aggregator_knowledge_source"))
Expand Down Expand Up @@ -237,7 +237,7 @@ object QueryService extends LazyLogging {
}
originalKSAttributes = originalKnowledgeSources.map { case (derivedFrom, inforesKS) =>
TRAPIAttribute(Some("infores:cam-kp"),
originalKS.iri,
primaryKS.iri,
None,
List(inforesKS),
Some(infoResBiolinkClass.iri),
Expand Down Expand Up @@ -674,9 +674,9 @@ object QueryService extends LazyLogging {
predicate = querySolution.getResource(queryEdgeID).getURI
predicateIRI = IRI(predicate)
tripleString = TripleString(source, predicate, target)
originalKS <- ZIO
.fromOption(biolinkData.predicates.find(p => p.shorthand == "original_knowledge_source"))
.orElseFail(new Exception("could not get biolink:original_knowledge_source"))
primaryKS <- ZIO
.fromOption(biolinkData.predicates.find(p => p.shorthand == "primary_knowledge_source"))
.orElseFail(new Exception("could not get biolink:primary_knowledge_source"))
aggregatorKS <- ZIO
.fromOption(biolinkData.predicates.find(p => p.shorthand == "aggregator_knowledge_source"))
.orElseFail(new Exception("could not get biolink:aggregator_knowledge_source"))
Expand All @@ -693,19 +693,19 @@ object QueryService extends LazyLogging {
Some(appConfig.location),
None,
None)
originalKSstr = provValue match {
primaryKSstr = provValue match {
case ctd if provValue.contains("ctdbase.org") => "infores:ctd"
case _ => "infores:go-cam"
}
originalKSAttribute = TRAPIAttribute(Some("infores:cam-kp"),
originalKS.iri,
None,
List(originalKSstr),
Some(infoResBiolinkClass.iri),
Some(provValue),
None,
None)
attributes = List(aggregatorKSAttribute, originalKSAttribute)
primaryKSAttribute = TRAPIAttribute(Some("infores:cam-kp"),
primaryKS.iri,
None,
List(primaryKSstr),
Some(infoResBiolinkClass.iri),
Some(provValue),
None,
None)
attributes = List(aggregatorKSAttribute, primaryKSAttribute)
relationLabelAndBiolinkPredicate <- ZIO
.fromOption(relationsMap.get(predicateIRI))
.orElseFail(new Exception("Unexpected edge relation"))
Expand Down