lobid/lodmill — pull request #346 by fsteeg (2014-02-17 10:33:13+00:00)
Title: Support restricting queries by type

See #317.

Uses `filter` as the query parameter. The obvious choice of `type` is currently not possible due to a bug in the Play framework: playframework/playframework#2259 However, `filter` allows for a generalized approach that is not restricted to the actual type (we could filter by language, etc), which aligns pretty well with what we do with `id` or `subject` (which both map to multiple fields, providing a data abstraction).

This change removes the RDF type from properties to use for detail resolution. The type of the main entity is always included, since that triple has the main entity as subject. The resolved entities are all included for their labels. Their types cause issues when restricting queries by type. Since a solution that retains these types would be quite involved, and we have no requirement for them to be included, we simply remove them from the resolution config.

Deployed to staging:

http://staging.api.lobid.org/resource?author=118580604&filter=MultiVolumeBook
http://staging.api.lobid.org/person?q=%22Bruder+von%22&filter=UndifferentiatedPerson
http://staging.api.lobid.org/subject?name=Heinsberg&filter=BuildingOrMemorial
http://staging.api.lobid.org/subject?name=Heinsberg&filter=Family
http://staging.api.lobid.org/subject?name=Heinsberg&filter=SubjectHeading
http://staging.api.lobid.org/subject?name=Heinsberg&filter=PlaceOrGeographicName