Skip to content

Commit

Permalink
Merge pull request #87 from phenoscape/issue-82
Browse files Browse the repository at this point in the history
Support POST for OntoTrace.
  • Loading branch information
balhoff committed Mar 22, 2019
2 parents 6f2916a + 3528f9a commit 71c0193
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions src/main/scala/org/phenoscape/kb/Main.scala
Expand Up @@ -198,13 +198,24 @@ object Main extends HttpApp with App {
}
} ~
path("ontotrace") {
parameters('entity.as[OWLClassExpression], 'taxon.as[OWLClassExpression], 'variable_only.as[Boolean].?(true), 'parts.as[Boolean].?(false)) { (entity, taxon, variableOnly, includeParts) =>
respondWithHeader(headers.`Content-Disposition`(ContentDispositionTypes.attachment, Map("filename" -> "ontotrace.xml"))) {
complete {
PresenceAbsenceOfStructure.presenceAbsenceMatrix(entity, taxon, variableOnly, includeParts)
get {
parameters('entity.as[OWLClassExpression], 'taxon.as[OWLClassExpression], 'variable_only.as[Boolean].?(true), 'parts.as[Boolean].?(false)) { (entity, taxon, variableOnly, includeParts) =>
respondWithHeader(headers.`Content-Disposition`(ContentDispositionTypes.attachment, Map("filename" -> "ontotrace.xml"))) {
complete {
PresenceAbsenceOfStructure.presenceAbsenceMatrix(entity, taxon, variableOnly, includeParts)
}
}
}
} ~
post {
formFields('entity.as[OWLClassExpression], 'taxon.as[OWLClassExpression], 'variable_only.as[Boolean].?(true), 'parts.as[Boolean].?(false)) { (entity, taxon, variableOnly, includeParts) =>
respondWithHeader(headers.`Content-Disposition`(ContentDispositionTypes.attachment, Map("filename" -> "ontotrace.xml"))) {
complete {
PresenceAbsenceOfStructure.presenceAbsenceMatrix(entity, taxon, variableOnly, includeParts)
}
}
}
}
}
} ~
pathPrefix("similarity") {
path("query") {
Expand Down Expand Up @@ -296,14 +307,14 @@ object Main extends HttpApp with App {
}
}
} ~
post {
formFields('terms.as[Seq[String]]) { iriStrings =>
complete {
val iris = iriStrings.map(IRI.create).toSet
Graph.ancestorMatrix(iris)
post {
formFields('terms.as[Seq[String]]) { iriStrings =>
complete {
val iris = iriStrings.map(IRI.create).toSet
Graph.ancestorMatrix(iris)
}
}
}
}
}
} ~
pathPrefix("characterstate") {
Expand Down

0 comments on commit 71c0193

Please sign in to comment.