Eric,
I'll address only the xml design for your first link, and I'll ask
questions, not because I want to know the answer, but because the
answers determine whether your xml response is "good".
is this response supposed to work only for mylibrary?
does version refer to mylibrary or to the response format?
why is there an error element if there's not been an error?
why is there a message element if there's no message?
why is code PCDATA rather than a CDATA attribute?
are the facets always ordered?
is there a difference between a facet_name and a name?
is the name and note attached to the facet or contained by the facet?
why do facets have ids?
is id an ID?
I also find that it helps to try to read things like this aloud in English.
MyLibrary, could I get all the facets you have?
Hello, I'm MyLibrary version 0.001.
I would like to report an error with code zero and no message.
As for my facets, a facet, which I id as "2", is named as a facet
"Formats, and I should note as a facet it is "The physical
manifestation of information", and that's what I have to say about
this facet.
Another facet, which I id as "3", is named as a facet "People", and I
should note as a facet it is "Human beings both real and fictional",
and that's what I have to say about this facet.
etc...
And those are all the facets.
Goodbye!
At 2:15 PM -0400 6/29/07, Eric Lease Morgan wrote:
>What are the characteristics of a "good" Web Service API?
>
>We here at Notre Dame finished writing the MyLibrary Perl API a long
>time ago. It does what is was designed to do, and we believe others
>could be benefit from our experience. At the same time, the API is
>based on Perl and we realize not everybody likes (or knows) Perl.
>Some would say, "Why didn't you write in X?" where X is their
>favorite programming language. Well, that is just not practical.
>
>I believe the solution to the dilemma is a Web Service API against
>MyLibrary similar to the Web Services API provided by Fedora. Any
>scripts sends name/value pairs on a URL and gets back XML. This way
>any language can be used against MyLibrary (which we now calling a
>"digital library framework & toolbox").
>
>Here are the only two working examples I have:
>
> http://dewey.library.nd.edu/mylibrary/ws/?obj=facet&cmd=getAll
> http://dewey.library.nd.edu/mylibrary/ws/?obj=facet&cmd=getOne&id=2
>
>Try a few of errors:
>
> http://dewey.library.nd.edu/mylibrary/ws/?obj=facet&cmd=getNone
> http://dewey.library.nd.edu/mylibrary/ws/?obj=facet&cmd=getOne&id=45
> http://dewey.library.nd.edu/mylibrary/ws/?obj=facet&cmd=getOne&id=x
>
>I can create all sorts of "commands" like:
>
> * get all facets
> * get all terms
> * get all librarians
> * get all resources
> * get all resources classified with this term
> * create facet, term, librarian, or resource
> * edit facet, term, etc.
> * delete facet, term, etc.
>
>Given such an interface library (MyLibrary) content can be used in
>all sort of venues much more easily.
>
>While I don't expect anybody here to know "what" commands to support,
>I am more interested in the "how". What are the characteristics of
>good name/value pairs? Should they be terse or verbose? To what
>extent should the name/value pairs require a version number or a
>stylesheet parameter? Besides being encoded in XML, what should the
>output look like? What are characteristics of "good" XML in this
>regard? Heck, then there is authorization? How do I disable people
>from deleting resources and such.
>
>This might be just an academic exercise, but with the advent of more
>and more Web Services computing I thought I might give a MyLibrary
>Web Services API a whirl.
>
>--
>Eric Lease Morgan
>University Libraries of Notre Dame
>
>code4lib_fridays++
--
Eric Hellman, Director OCLC Openly
Informatics Division
[log in to unmask] [log in to unmask] 2 Broad St., Suite 208
tel 1-973-509-7800 fax 1-734-468-6216 Bloomfield, NJ 07003
http://openly.oclc.org/1cate/ 1 Click Access To Everything
|