230 likes | 461 Views
MELT workshop: Open Archives Iniative – Protocol for Metadata Harvesting. Stefaan Ternier, KUL Bram Vandenputte, KUL Joris Klerkx, KUL. Infrastructure. Automatic Metadata generation. <results> </results>. <results> <lom>..</lom> <lom>..</lom> <lom>..</lom> … </results>. SQI.
E N D
MELT workshop:Open Archives Iniative – Protocol for Metadata Harvesting Stefaan Ternier, KUL Bram Vandenputte, KUL Joris Klerkx, KUL
Infrastructure Automatic Metadata generation <results> </results> <results> <lom>..</lom> <lom>..</lom> <lom>..</lom> … </results> SQI MD MD MD MD Tag MD MD MD MD Query Query Query Query Query OAI-PMH Content enrichment <lom>…</..> MD MD MD MD MD MD MD MD MD <lom>…</..> <lom>…</..>
OAI “VERBS” Identify ListMetadataFormats GetRecord ListIdentifiers ListRecords ListSets How OAI works Service Provider Metadata Provider H A R VESTER REPOSITORY OAI HTTP Request OAI (OAI Verb) HTTP Response (Valid XML)
Practically… • Set environment vars • set JAVA_HOME=C:\j2sdk1.4.2_13 • set ANT_HOME=C:\apache-ant-1.6.5 • set PATH=%JAVA_HOME%\bin;%ANT_HOME%\bin;%PATH% • Download and build • Cd <your build-dir> • ant • Install apache-tomcat • Deploy code
Practically… • Building |--oaicat-ant |-- WEB-INF |-- lib ‘-- src |-- build |-- dist |-- build ‘-- oaicat.war ‘-- build.xml • Deploying |--jakarta-tomcat-5.0.28 |-- bin |-- startup.sh ‘-- shutdown.bat |-- conf |-- server.xml ‘-- tomcat-users.xml ‘-- webapps |-- oaicat.war ‘-- oaicat ‘-- WEB-INF |-- oaicat.properties ‘-- web.xml
Practically… • Test your environmenthttp://localhost:8080/oaicat/OAIHandler?verb=Identify
Practically… • Test your environment http://localhost:8080/oaicat/OAIHandler?verb=Identify • OAI “VERBS” • Identify • ListMetadataFormats • GetRecord • ListRecords • ListIdentifiers • ListSets
Practically… • Test your environmenthttp://localhost:8080/oaicat/OAIHandler?verb=ListMetadataFormats • OAI “VERBS” • Identify • ListMetadataFormats • GetRecord • ListRecords • ListIdentifiers • ListSets
GetRecord • Purpose • Returns the metadata for a single item in the form of an OAI record • Parameters • identifier – unique id for item (R) • metadataPrefix – metadata format for the record (R)
GetRecord – sequence Diagram HashMap nativeItem = new HashMap(); nativeItem.put("learning_object.identifier", identifier); nativeItem.put("learning_object.title", "a title"); nativeItem.put("learning_object.last_mod_date", new java.sql.Date(100239)); LOMImpl lom = new LOMImpl(); LOMImpl.General.Identifier id = lom.newGeneral().newIdentifier(-1); id.newEntry().setString((String)nativeItem.get("learning_object.identifier"));
GetRecord - test • Test your environmenthttp://localhost:8080/oaicat/OAIHandler?verb=GetRecord&identifier=oai:oaicat.ariadne.org:azerty&metadataPrefix=oai_lom • OAI “VERBS” • Identify • ListMetadataFormats • GetRecord • ListIdentifiers • ListRecords • ListSets
ListRecords • Purpose • Retrieves metadata records for multiple items • Parameters • from – start date (O) • greater than or equal to • until – end date (O) • less than or equal to • set – set to harvest from (O) • resumptionToken – flow control mechanism (X) • metadataPrefix – metadata format (R)
ListRecords – from until http://localhost:8080/oaicat/OAIHandler?verb=ListRecords&from=1999-01-15&until=2005-12-31&metadataPrefix=oai_lom… UTCdatetime Dates and times are uniformly encoded using ISO8601 and are expressed in UTC throughout the protocol. When time is included, the special UTC designator ("Z") must be used. UTC is implied for dates although no timezone designator is specified. For example, 1957-03-20T20:30:00Z is UTC 8:30:00 PM on March 20th 1957. UTCdatetime is used in both protocol requests and protocol replies, in the way described in the following sections.
ListRecords - test • Test your environmenthttp://localhost:8080/oaicat/OAIHandler?verb=ListRecords&metadataPrefix=oai_lom • OAI “VERBS” • Identify • ListMetadataFormats • GetRecord • ListRecords • ListIdentifiers • ListSets
ListIdentifiers • Purpose • List headers for all items corresponding to the specified parameters • Parameters • from – start date (O) • until – end date (O) • set – set to harvest from (O) • metadataPrefix – metadata format to list identifiers for (R) • resumptionToken – flow control mechanism (X)
ListIdentifiers - code public Map listIdentifiers(String from, String until, String set, String metadataPrefix) { Map listIdentifiersMap = new HashMap(); ArrayList headers = new ArrayList(); ArrayList identifiers = new ArrayList(); HashMap nativeItem = //create native item; String[] header = getRecordFactory().createHeader(nativeItem); headers.add(header[0]); Identifiers.add(header[1]); listIdentifiersMap.put("headers", headers.iterator()); listIdentifiersMap.put("identifiers", identifiers.iterator()); return listIdentifiersMap; }
ListIdentifiers - test • Test your environmenthttp://localhost:8080/oaicat/OAIHandler?verb=ListIdentifiers&metadataPrefix=oai_lom • OAI “VERBS” • Identify • ListMetadataFormats • GetRecord • ListRecords • ListIdentifiers • ListSets
ListSets • Purpose • Provide a listing of sets in which records may be organized (may be hierarchical, overlapping, or flat) • Parameters • None
ListSets - code public Map listSets() throws NoSetHierarchyException, OAIInternalServerError { throw new NoSetHierarchyException(); }
ListSets - test • Test your environmenthttp://localhost:8080/oaicat/OAIHandler?verb=ListSets • OAI “VERBS” • Identify • ListMetadataFormats • GetRecord • ListRecords • ListIdentifiers • ListSets
References • http://oai.grainger.uiuc.edu/FinalReport/JCDL_2003_OAI_Intro.ppt • http://www.cs.kuleuven.ac.be/~hmdb/SqiOaiMelt • http://www.oclc.org/research/software/oai/cat.htm