Skip to content

Commit

Permalink
Fixed bug in annotated description service. It was not restricting qu…
Browse files Browse the repository at this point in the history
…ery to input phenotype URI.
  • Loading branch information
balhoff committed Jul 1, 2015
1 parent 1f9f288 commit 45a03c8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/scala/org/phenoscape/kb/CharacterDescription.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 45a03c8

Please sign in to comment.