Skip to content

Refname parse of values that do not start with urn:cspace fails silently #48

Description

@kspurgin

This is an old thing I found in my notes. I have no idea when I wrote this down, but I wanted to capture it.

The refname used in the example below is the one I recorded when I noted the issue:

irb(main):003:0> "nagpraPahmaInventoryNames01)'AK-Alaska'"
=> "url:pahma.cspace.berkeley.edu:vocabularies:name(nagpraPahmaInventoryNames):item:name(nagpraPahmaInventoryNames01)'AK-Alaska'"
irb(main):004:0> CollectionSpace::RefName.parse(rn)
=> {:domain=>"url", :type=>"pahma.cspace.berkeley.edu", :subtype=>nil, :identifier=>nil, :label=>nil}

Non-standard refname formats that cannot be parsed into valid results should raise an exception instead of silently returning weird results.

Today I checked both PAHMA and OMCA's production CollectionSpace instances and vocabulary term refnames are the standard format beginning with urn:cspace:, so I'm not sure if this is variation we need to deal with or not.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions