lcnetdev / marc2bibframe2

Convert MARC records to BIBFRAME2 RDF
http://www.loc.gov/bibframe/
Creative Commons Zero v1.0 Universal
89 stars 35 forks source link

Avoid asserting bf:part for language entities, use rdf:value indirection instead #10

Closed osma closed 7 years ago

osma commented 7 years ago

This is a proposed fix for issue #7.

The problem is that the current code asserts bf:part properties (such as "original" or "summary") on language entities such as <http://id.loc.gov/vocabulary/languages/eng> directly, i.e. triples like this:

<http://id.loc.gov/vocabulary/languages/eng> bf:part "original" .

This causes problems especially when converting multiple records with different language information.

The proposed fix implemented in this PR is to use a blank node as the bf:language value, and add an rdf:value property that references the LC language URI. So for e.g. a record that represents a translation from English (041 $h eng), we get these RDF triples:

ex:work
  bf:language [
    a bf:Language ;
    bf:part "original" ;
    rdf:value <http://id.loc.gov/vocabulary/languages/eng>
  ] .

The PR changes both the XSL implementing the conversion and the XSpec test, making sure that the test passes.

There are other MARC fields (e.g. 008) that also get converted to bf:language properties with bf:Language values that get LC-assigned URIs, but AFAICT no record-specific extra information like bf:part is asserted for those URIs, so there is no analoguous problem and I decided not to touch their conversions.