Page MenuHomePhabricator

Adjust the SPARQL generation for datatype quantity
Closed, ResolvedPublic

Description

The sparql generate for quantity datatype needs to be adjusted for the new property value relation types

https://gerrit.wikimedia.org/r/plugins/gitiles/wikidata/query-builder/+/refs/heads/master/src/sparql/QuantityValuePatternBuilder.ts#251

Probably the following function needs adjustment:

	private getFilterOperatorFromRelation( propertyValueRelation: PropertyValueRelation ): string | null {
		switch ( propertyValueRelation ) {
			case PropertyValueRelation.Matching:
				return '=';
			case PropertyValueRelation.NotMatching:
				return '!=';
			case PropertyValueRelation.Regardless:
				return null;
		}
	}

acceptance criteria

  • correct sparql is generate with < and >
  • unit tests for these conditions exist

Event Timeline

guergana.tzatchkova renamed this task from Adjusting the SPARQL generation for datatype quantity to Add additional property value relation types to PropertyValueRelation and adjust the SPARQL generation for datatype quantity.Thu, Apr 8, 9:09 AM
guergana.tzatchkova claimed this task.
guergana.tzatchkova updated the task description. (Show Details)
guergana.tzatchkova renamed this task from Add additional property value relation types to PropertyValueRelation and adjust the SPARQL generation for datatype quantity to Adjust the SPARQL generation for datatype quantity.Thu, Apr 8, 12:54 PM
guergana.tzatchkova removed guergana.tzatchkova as the assignee of this task.
guergana.tzatchkova updated the task description. (Show Details)

Change 677984 had a related patch set uploaded (by Michael Große; author: Michael Große):

[wikidata/query-builder@master] Add SPARQL generation for quantity range queries

https://gerrit.wikimedia.org/r/677984

Change 677984 merged by jenkins-bot:

[wikidata/query-builder@master] Add SPARQL generation for quantity range queries

https://gerrit.wikimedia.org/r/677984

Michael moved this task from Test (Verification) to Done on the Wikidata Query Builder board.