From 45a03c83475eef45c09f30b6f1a0096b1ac44ad8 Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Wed, 1 Jul 2015 12:53:11 -0400 Subject: [PATCH] Fixed bug in annotated description service. It was not restricting query to input phenotype URI. --- .../scala/org/phenoscape/kb/CharacterDescription.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/scala/org/phenoscape/kb/CharacterDescription.scala b/src/main/scala/org/phenoscape/kb/CharacterDescription.scala index 1fdb54eb..476f2e46 100644 --- a/src/main/scala/org/phenoscape/kb/CharacterDescription.scala +++ b/src/main/scala/org/phenoscape/kb/CharacterDescription.scala @@ -68,14 +68,16 @@ object CharacterDescription { App.executeSPARQLQuery(buildCharacterDescriptionQuery(iri), fromQuerySolution(iri)).map(_.headOption) def annotatedCharacterDescriptionWithAnnotation(iri: IRI): Future[Option[AnnotatedCharacterDescription]] = { - val query = select_distinct('state, 'description, 'matrix, 'matrix_label, 'phenotype) where ( + val query = select_distinct('state, 'description, 'matrix, 'matrix_label) where ( bgp( - t('state, describes_phenotype, 'phenotype), + t('state, describes_phenotype, iri), t('state, dcDescription, 'description), t('matrix, has_character / may_have_state_value, 'state), t('matrix, rdfsLabel, 'matrix_label))) val result = App.executeSPARQLQuery(query, result => { - Term.computedLabel(IRI.create(result.getResource("phenotype").getURI)).map { phenotype => + println("Result: " + result) + Term.computedLabel(iri).map { phenotype => + println("Phenotype: " + phenotype) AnnotatedCharacterDescription( CharacterDescription( IRI.create(result.getResource("state").getURI),