marc2bibframe2 icon indicating copy to clipboard operation
marc2bibframe2 copied to clipboard

Linking to FAST URIs when there's $0

Open sfolsom opened this issue 5 years ago • 5 comments

Has there been any consideration to in the spec to reconcile 6XXs with FAST URIs? It could be relatively easy with the right second indicator 2, $7, and $0 combination that could easily map to URIs. E.g. https://newcatalog.library.cornell.edu/catalog/1710524/librarian_view.

Or is this outside of the scope of LC's marc2bibframe2 spec?

sfolsom avatar Apr 10 '19 19:04 sfolsom

Some things to try: If you convert the $0 to a uri it should work.

Otherwise you have this structure which you want to lookup.

       <bf:subject>
          <bf:Topic rdf:about="http://bibframe.example.org/622168#Topic650-18">
            <bf:identifiedBy>
              <bf:Identifier>
                <rdf:value>fst00978933</rdf:value>
                <bf:source>
                  <bf:Source>
                    <rdfs:label>OCoLC</rdfs:label>
                  </bf:Source>
                </bf:source>
              </bf:Identifier>
            </bf:identifiedBy>
            <rdfs:label>Irish Americans.</rdfs:label>
            <madsrdf:authoritativeLabel>Irish Americans.</madsrdf:authoritativeLabel>
            <bf:source>
              <bf:Source>
                <bf:code>fast</bf:code>
              </bf:Source>
            </bf:source>
          </bf:Topic>
        </bf:subject>

In your yaz config, you would want something that takes the identifier and adds it to http://id.worldcat.org/fast/.

    <rdf-lookup timeout="3" debug="1" >
        <namespace prefix="bf" href="http://id.loc.gov/ontologies/bibframe/"/>
        <namespace prefix="bflc" href="http://id.loc.gov/ontologies/bflc/"/>
        <namespace prefix="rdf" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
        <namespace prefix="madsrdf" href="http://www.loc.gov/mads/rdf/v1#"/>
        <namespace prefix="rdfs" href="http://www.w3.org/2000/01/rdf-schema#"/>
        <lookup xpath="//bf:Work/bf:subject/*[string(bf:source/bf:Source/bf:code)='fast']/bf:identifiedBy/bf:Identifier">
            <key field="rdf:value"/>
            <server url="http://id.worldcat.org/fast/%s" method="HEAD"/>
        </lookup>
    </rdf-lookup>

Even though that url returns a location (Location: http://id.worldcat.org/fast/984188/) it doesn't work in my test. Wayne what do you think?

kirkhess avatar Apr 26 '19 13:04 kirkhess

Hi, @sfolsom. I'm guessing what you're proposing is an enhancement to the 6XX spec such that, if ind2 = 7 and $2 = "fast", the IRI for the generated bf:Topic RDF subject is http://id.worldcat.org/fast/{id extracted from $0}? This extra processing would eliminate the need to do the extract lookup step that @kirkhess refers to above.

My instinct is that this would be out of scope, more aligned with local cataloging practice and conventions than with the MARC or BIBFRAME standards (though that line is of course not very hard and fast). I also wonder what should happen if there is more than one $0 in the 6XX data field (the $0 is repeatable). @jodiw01 -- any comments?

I will do more testing on the possibility of using YAZ for post-processing -- that does seem like it should work with the right configuration.

wafschneider avatar May 10 '19 02:05 wafschneider

I believe this should be the correct configuration:

  <rdf-lookup timeout="3" debug="1">
    <namespace prefix="bf" href="http://id.loc.gov/ontologies/bibframe/"/>
    <namespace prefix="rdf" href="http://www.w3.org/1999/02/22-rdf-syntax-ns#"/>
    <lookup xpath="//bf:Work/bf:subject/*[contains(@rdf:about,'example.org') and bf:source/bf:Source/bf:code='fast']">
      <key field="bf:identifiedBy/bf:Identifier/rdf:value"/>
      <server url="http://id.worldcat.org/fast/%s" method="HEAD"/>
    </lookup>
  </rdf-lookup>

However, id.worldcat.org/fast returns a 303 status code with a Location: header. The YAZ retrieval rdf-lookup conversion does not know what to do with a 303 (see https://software.indexdata.com/yaz/doc/tools.retrieval.html for documentation). The rdf-lookup conversion is tuned specifically to LC's label service, which returns a 302 for a string match with an X-URI header. Changing that behavior would require a change to YAZ.

wafschneider avatar May 10 '19 16:05 wafschneider

The reason for the 303 is you are supposed to include a format or a content-type. Generic Document http://id.worldcat.org/fast/12345/ MARC-21 (UTF-8 raw data) http://id.worldcat.org/fast/12345.mrc MARC-21 xml raw data http://id.worldcat.org/fast/12345.mrc.xml RDF/XML raw data http://id.worldcat.org/fast/12345.rdf.xml

Either way, since it has nothing in the response headers you could use it isn't going to work.

I suppose we would have to wrap this api with something that worked like our id.loc.gov searches. We also could use QuestioningAuthority - it does not support HEAD requests like this either, but I'm pretty sure Loretta could just add them to the term searches. https://lookup.ld4l.org/authorities/show/linked_data/oclcfast_direct/12345

kirkhess avatar May 10 '19 17:05 kirkhess

Getting back to this....

@sfolsom does this capture what you were hoping for?

Hi, @sfolsom. I'm guessing what you're proposing is an enhancement to the 6XX spec such that, if ind2 = 7 and $2 = "fast", the IRI for the generated bf:Topic RDF subject is http://id.worldcat.org/fast/{id extracted from $0}?

kefo avatar Jun 10 '19 15:06 kefo

FAST URIs are created now: https://id.loc.gov/tools/bibframe/compare-lccn/full-rdf?find=2021285925

bf:subject <bf:Topic rdf:about="http://id.worldcat.org/fast/00899294"> <rdf:type rdf:resource="http://www.loc.gov/mads/rdf/v1#Topic"/> rdfs:labelDucks</rdfs:label> madsrdf:authoritativeLabelDucks</madsrdf:authoritativeLabel> <bf:source rdf:resource="http://id.loc.gov/vocabulary/subjectSchemes/fast"/> </bf:Topic> </bf:subject>

jodiw01 avatar Jan 10 '24 16:01 jodiw01