Redirect script for parsing different IDs to OL records

Bug #409568 reported by George
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Open Library
Confirmed
High
Anand Chitipothu

Bug Description

Anand,

Hank, Brewster and I have been talking about adding a link to a (Texts) item page from the Internet Archive into Open Library.

It might look something like this:
http://home.us.archive.org/twiki/pub/Main/GeorgeOates/ol-link-on-ia.png

Hank had a great idea about this. Instead of pinging for each item using the API, or needing to know an Open Library ID, what if he could send us another sort of ID via a URL that we can try to lookup in Open Library, then redirect to the right page.

So, Internet Archive needs to be able to send us a URL like one of these:
- www.openlibrary.org/id/book01foo
- www.openlibrary.org/id/343434343434
- www.openlibrary.org/id/676767676

Where the ID after the /id/ can be an ISBN, OCLC, LCCN, IA, OL (and presumably any number of IDs in the future - LibraryThing, GoodReads, Flickr, Wikipedia etc etc).

We do a look up for that ID in Open Library, then based on what it refers to, we construct a URL to send someone to the right page.

This could be really, really useful for other sites to throw links at Open Library. Imagine if there was a way to shoot ISBNs at us and have us find the right Open Library page? Very flexible, very light.

We should also design specifically for the exception when we can't find a record on Open Library. We should show a specific page that explains that we can't find a match, and perhaps "create a new record" or... "go back" or something.

We should also do this for production now, but also for Upstream (or at least, I'll make a note that this particular case might be a variable that we can through into a page like a 404.)

George (george-archive)
Changed in openlibrary:
assignee: nobody → Anand Chitipothu (anandology)
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Hank Bromley (hank-archive) wrote :

Just one small correction: these redirecting urls were Brewster's idea, not mine.

Revision history for this message
solrize (solrize) wrote :

I'd like to hope that the id url would say what kind of identifier it was (ISBN, LCCN, OCA, etc). There could be an "identifiers" field which is a list of pairs (id_type, id_string), e.g. ("isbn", "1234567890"). They could be indexed by either solr or infobase/postgres (or both).

Revision history for this message
George (george-archive) wrote :

Brewster's advice was to keep this *particular* URL structure as generic as possible. I agree.

But, I'd like to make a way for people to add new, different IDs for books into Open Library, where the kind of breakdown you talk about will be required.

Revision history for this message
Hank Bromley (hank-archive) wrote :

He had in mind a keyword search across the entire record, so it would record a hit if the given string were found in any field - and if there were collisions (more than one record matching a given string), he though perhaps some kind of disambiguation page could be offered.

Revision history for this message
solrize (solrize) wrote :

I see. Yeah, that lookup is probably most straightforwardly done with a solr query. But, these are opaque identifiers (isbn's and so forth). Why shouldn't they be disambiguated in the url's? I understand there is a need for human generated queries (requiring disambiguation) in certain places, but this doesn't sound like one of those places.

Revision history for this message
solrize (solrize) wrote :

One very simple idea is to modify the search function so that if there is just one search hit, the user is taken immediately to that page instead of to a list of search results (containing just one result). Then this redirect url could just be a normal search query.

Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 409568] [NEW] Redirect script for parsing different IDs to OL records

> Hank had a great idea about this. Instead of pinging for each item using
> the API, or needing to know an Open Library ID, what if he could send us
> another sort of ID via a URL that we can try to lookup in Open Library,
> then redirect to the right page.
>
> So, Internet Archive needs to be able to send us a URL like one of these:
> - www.openlibrary.org/id/book01foo
> - www.openlibrary.org/id/343434343434
> - www.openlibrary.org/id/676767676
>
> Where the ID after the /id/ can be an ISBN, OCLC, LCCN, IA, OL (and
> presumably any number of IDs in the future - LibraryThing, GoodReads,
> Flickr, Wikipedia etc etc).
>
> We do a look up for that ID in Open Library, then based on what it
> refers to, we construct a URL to send someone to the right page.

We already have this feature. Try these:

http://openlibrary.org/isbn/0071152253
http://openlibrary.org/oclc/31249133

Currently we have support for isbn, oclc, lccn. I can add support for ia.

Revision history for this message
Hank Bromley (hank-archive) wrote : Re: [Bug 409568] [NEW] Redirect script for parsing different IDs to OL records

On Thu, 6 Aug 2009, Anand Chitipothu wrote:

> We already have this feature. Try these:
>
> http://openlibrary.org/isbn/0071152253
> http://openlibrary.org/oclc/31249133
>
> Currently we have support for isbn, oclc, lccn. I can add support for
> ia.

I think what Brewster would ultimately like to see is a url that doesn't
require specifying the type of the identifier, but for the immediate need
of adding links to OL on the IA details pages, something specific to the
IA item identifier would work fine.

-- Hank

Revision history for this message
George (george-archive) wrote :

Yep. So, Anand, please add /ia/ for now, with a view to this being extensible - as more types of identifiers (library thing, goodreads, amazon etc etc) are added, they should all be addressable via both the /id/1234 and /goodreads/3456 URL structures.

Revision history for this message
George (george-archive) wrote :

Bump.

Perhaps we could use whatever's in the "name" line of http://openlibrary.org/config/edition.yml ?

Revision history for this message
George (george-archive) wrote :

Bump. Let's make it so you can hit openlibrary.org/id/123 where 123 is any type of ID per edition. So cool!

Revision history for this message
Anand Chitipothu (anandology) wrote :

Here is my proposal for supporting other identifiers:

Query for goodreads ID:

http://openlibrary.org/books/goodreads:1235

query for librarything ID:

http://openlibrary.org/books/librarything:1235

I liked keeping the id after /books/ because we can support similar identifiers for works/authors later.

Comments?

Revision history for this message
George (george-archive) wrote :

Why diverge from the http://openlibrary.org/isbn/9780385533225 pattern?

Why introduce ID:123?

If you go to this direction, will that mean that /openlibrary.org/ia/123 will have to be changed as well?

(My preference would just be to extend the existing model.)

Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 409568] Re: Redirect script for parsing different IDs to OL records

On 06-Oct-2010, at 10:28 PM, George wrote:

> Why diverge from the http://openlibrary.org/isbn/9780385533225 pattern?
>
> Why introduce ID:123?
>
> If you go to this direction, will that mean that /openlibrary.org/ia/123
> will have to be changed as well?
>
> (My preference would just be to extend the existing model.)

There is a problem with the existing model. We can't continue adding new top level namespaces when someone adds a new ID type. What if someone adds an ID with name people or works?

Here is what I'm proposing:

http://openlibrary.org/books/OLID

or http://openlibrary.org/books/ID_TYPE:ID_VALUE

This model is extendable to any type of new IDs without spoiling the top-level namespaces.

We can even extend that to support arbitrary IDs.

http://openlibrary.org/books/id:12345

If we need, we can even extend this model to support different IDs for authors or works. How about this?

http://openlibrary.org/authors/librarything:12345

Anand

Revision history for this message
George (george-archive) wrote :

Thanks for that extra detail. Sounds great to me. Any comments from the floor before we go ahead with this?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.