samvera / questioning_authority

Question your authorities
Other
54 stars 30 forks source link

check for loc? should check template URI instead of authority name #245

Closed elrayle closed 5 years ago

elrayle commented 5 years ago

Description

LOC requires special processing of their ids. So there is a check to determine if the current authority is the LOC authority. Currently, this check is done by looking at the authority name. However, if a site creates a custom configuration for LOC and uses a different authority name, their authority configuration will not get the special processing. So the method determining whether or not the authority is LOC needs to be more flexible.

Background for Special Processing

There is special processing required for LOC ids. In the graph, the id is in predicate loc:lccn and is in the form 'n 1234'. To create the URI, the blank must be removed from the id specified in the graph. The example would become 'n1234'.

Expected

loc? should return true for any authority with template URI starting with 'http://id.loc.gov/authorities/'

Actual

loc? returns true only if authority_name=='LOC'