LSIDs and RDF by t12GWHOt


									LSIDs and RDF
   Kevin Richards
    TDWG 2006
• Kevin Richards (Landcare Research NZ)
  – Landcare Informatics group
  – GUID Subgroup
  – LSID .NET code port
• Disclaimer / intended audience
• Overview of tutorial
• Files on network
  – Username: garfile Password: garden2003
• Internet connection
• Text editor (or xml editor)
• What is RDF
  – Resource Description Framework
  – w3C
  – Describes resources on the web
  – Putting data on the web
  – Intended for machine processing
  – Has a defined xml syntax
  – Semantic relationships of data objects
  – Aimed at distributed data with varying types
                       RDF Triples
• English language equivalent –
  “ has a creator whose value is
  John Smith”
• Uses GUIDs (Web based GUIDs – URIs, etc)
   – Eg GUID1 has creator GUID2
• Subject : Predicate : Object format
   – Subject (the object being described)
       • GUID or blank (infinite set)
   – Predicate (the relationship/property type)
       • GUID to a property type, eg the ID of the property “creator”
   – Object (the value assigned to the subject object)
       • GUID of another object, blank, or literal
• Build up map/graph of object relationships
                              RDF Graphs
•     The basis of RDF
•     Useful analysis and equivalence calculation tool
•     Eg
       – page created by staffid 85740
       – page language is english (en)

    • Equivalent Triples
       –   <> <>
           <> .
           <> <>
           "August 16, 1999" . <>
           <> "en"
                       RDF formats
• Statement -
  “ has a
  creator whose value is John Smith”
• N3 notation –
  : dc:creator “John Smith”.
• Xml –
 <rdf:Description rdf:about="">
       <dc:creator>John Smith</dc:creator>

                         Basic RDF
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=""

   <rdf:Description rdf:about="">


• rdf:Description – basic description xml node
• Every xml node must be namespaced and the namespace must be
• DublinCore – handy set of basic descriptive elements, such as title,
  creator, language, etc

<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=""

     <rdf:Description rdf:about="">
           <dc:creator rdf:resource="
     matic/JohnSmith" />

                         RDF Types
• Define data types
• Improves control of input data ranges
• Eg birthDate of a person

   <person:birthDate rdf:dataType=

• Eg employee Jane Smith is of type Person
   (n3 notation)

   _:jane exterms:mailbox <> .
   _:jane rdf:type exterms:Person .
   _:jane exterms:name "Jane Smith" .
   _:jane exterms:empID "23748"
      RDF Example FOAF

• Go to FOAF-a-matic web site
• Create Profile, Generate RDF
• Copy RDF
• Go to W3C RDF Validator
  – Validate RDF – displays triples
                                   FOAF Person A
  Rdf triple – A knows B

FOAF Person B
                                       Inferred triple - A is
                                       one degree
Rdf triple – B knows C                 separated from C

                   FOAF Person C
                      RDF Exercise 1
•   Create some RDF instance xml for a specimen
     – Make up an namespace for the elements
     – Make up elements for:
        • Specimen Catalog Number (eg SP1)
        • Specimen Collected By
        • Specimen Locality
     – Validate using RDF validator on the web

•   Eg RDF
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=""

    <rdf:Description rdf:about="">

               Example Solution
<?xml version="1.0"?>
<rdf:RDF xmlns:rdf=""

  <rdf:Description rdf:about=“SP1">
       <spec:collectedBy>Fred Smith</spec:collectedBy>
       <spec:locality>George St</spec:locality>



            RDF Schema
• Similar to xml schema
• Define RDF classes, types and properties
• Namespace -
                          RDF Schema
• Example Schema – TCS-RDF
<rdf:RDF xmlns:rdf=""

   <rdfs:Class rdf:about="">
         <rdfs:label xml:lang="en">Taxon Name</rdfs:label>
         <rdfs:subClassOf rdf:resource="

    <rdf:Property rdf:about="">
           <rdfs:label xml:lang="en">Name Complete</rdfs:label>
           <rdfs:range rdf:resource=""/>
           RDF Exercise 2
• Collection RDF Schema
  – Write an RDF schema to describe our example LSIDs
  – Write an instance of this schema using
    rdf:Description tag or typed tag
  – Validate using RDF validator on the web
• RDF Triple Stores
  – What are they
  – Problems
    • size
    • speed of lookup
    • distribution/duplication
• Defined using RDFS or OWL (Web
  Ontology Language) & others
• Dublin Core
  – eg
  – Eg has a creator whose
    value is John Smith =
     • Subject =
     • Predicate =
     • Object = (John’s Id)

• FOAF (Friend Of A Friend)
• TDWG ontologies?
              RDF Tools
• RDF Tools/Software
  – Protégé
  – Altova SemanticWorks
  – Oracle triple stores
  – W3c Validator
           RDF References
• RDF Primer –
• RDF Syntax -
• RDF Schema -
• Another Primer -
• w3c RDF Tutorial -
• Dublin Core RDF -
• Overview
• Requirements:
  – Files on network
    • Username: garfile Password: garden2003
  – Web server (IIS)
  – Text editor
• Background on GUIDs
  – What is a GUID?
    •   Globally Unique IDentifier
    •   Persistent
    •   Opaque & transparent
    •   Resolvable?
    •   Examples: UUID, DOI, Handle, LSID, PURL
– What is an LSID?
  •   Life Science IDentifier
  •   Developed by OMG & W3C
  •   Implemented by the team at IBM
  •   Structure –
  • Used for – data objects, databases, images,
    files etc?
  • Versioning
  • Whos using them
                     GUID subgroup
• Subgroup decisions:
  – To use LSIDs for identifying biodiversity data, but not
    exclude use of other GUIDs
  – Reuse GUIDs where they already exist, eg some
    DOIs for literature (assuming no commercial restrictions)
  – Use RDF for metadata of objects identified by LSIDs
  – Implement as a minimum the HTTP GET metadata
    service for each LSID server/resolver
  – See GUID Report -
Pros and Cons of LSIDs
URL     Tied to physical addresses
        Inspection required to determine
         identical contents
        Brittle (broken links)

LSID    Same Id = same content
        Location independent
        Enables transparent caching
        Formalized, rich metadata

Cons    Requires specialised software to resolve
         an LSID (not built in to most software)
        LSID Tools and Services
•   IBM LSID Launchpad
•   Firefox LSID Browser
•   LSID Tester (Rod Page)
•   Web based resolver –

• Example LSID servers:
    – Bio Pathways – (doesn’t work with Launchpad)
    – Index Fungorum -
    – IPNI –
    – uBio -
               LSID Code
• Current Code Stacks
  – Open Source (
  – Java, C++, Perl (IBM)
  – Microsoft .NET (Myself)
     An LSID is resolved using a three-
              part resolution
           1 – Resolve
             Authority   DNS + HTTP

                         Query Authority
            2 – Get

           Meta Data       Data via
Data          Data       SOAP, HTTP,
              Store      FTP, NFS, AFS,
                   DNS Lookup
•   Example
•   Go to command prompt
•   > nslookup
•   > set type=srv
•   >
•   Results in : (
    -> used as authority location for resolving LSIDs
Questions before hands on
          Really Simple LSID
• A basic LSID setup
  – LSID server with only one service for returning
    metadata for LSIDs using HTTP GET
  – IIS + PHP

• Specimen collection example
  – Specimen text files to load metadata from
  – No data
         LSID Authority Setup


Default is to return wsdl
of php authority location

LSID Metadata Request       IIS
                                   PHP      Load metadata
                                  scripts   from file

Return metadata
         Step 1 IIS authority
• Add ‘authority’ folder to
• Copy authority files to authority directory
• Start IIS:
  – Configure authority as a web application
• Explain files
              Step 2 PHP
• Copy PHP files to c:\php
• Configure IIS to run PHP files (add
  php5isapi.dll to the mappings for authority)
• Add index.php to default docs
• Set security permissions on php files/dir?
Step 3 Configure LSID Launchpad

• Add local host authority for
• Add application for text editor
• Test, eg
         Step 4 Test authority
• Test authority
  – Browse to http://localhost/authority/
• Test metadata
  – Browse to http://localhost/authority/metadata.php
  – Browse to
• Test using LSID Launchpad
  – Cant read/display it as it is text, not rdf
       Use RDF for metadata
• Use the RDF collection schema (created
  in the RDF section) in our LSID authority
• Build an RDF instance for the schema
• Test the LSID metadata using LSID
  – Eg
            Linking to other data
• Add link for the person
• Eg
   – Change collectedBy property
        <rdf:Property rdf:about="&coll;collectedBy">
                <rdfs:label xml:lang="en">Collected By</rdfs:label>
                <rdfs:isDefinedBy rdf:resource="&coll;"/>
                <rdfs:domain rdf:resource="&coll;Specimen"/>
                <rdfs:range rdf:resource=""/>
      to the rdf schema
   – Add
      <coll:collectedBy rdf:resource=""/>
      To the instance
         Linking to other data
• See
            Java LSID Code
• Highlights of the LSID Java Stack
  – Simple APIs, synchronous and asynchronous
  – Support for HTTP, SOAP and FTP
  – WSDL, Data and Metadata Cache
  – Highly configurable
     • Cache location/policy, host-mappings, metadata
  – Leverages many Java technologies
     • Xerces, Xalan, Axis, wsdl4J, and Castor
              Java LSID Web Application

                                                        Load services
                                                                          Services Configuration File

                                                             Create registry

                                                                                  Service Registry
                       Server               LSID

           HTTP Req
                                                             Lookup Service for LSID authority
           HTTP Resp
                                                     Call appropriate          LSID Authority Classes
                                                     authority class
   LSID Resolution code (Client)
• Given an LSID in String format, we can easily open an InputStream
  to the data or metadata. (listing1)

LSID lsid = new LSID(“urn:lsid…”);
LSIDResolver resolver = new LSIDResolver(lsid);
InputStream data = resolver.getData();

• If we care about which protocol or location to use, we can choose
  from those available in the WSDL returned from

LSIDWSDLWrapper wsdl = resolver.getWSDLWrapper();
LSIDDataPort port = wsdl.getPortForProtocol(WSDLConstants.SOAP);
InputStream in = resolver.getData(port);
                   LSID References
• LSID Source Forge -
• LSID .NET Source Forge -
• LSID Tutorial - http://www-
• LSID Specification -
• LSID Tester -
• LSID Launchpad - http://www-
• GUID Subgroup -
• GUID Subgroup Reports
• Firefox LSID developer site -
Thanks to
• Ricardo Pereira
• Roger Hyam
• Rod Page
• Lee Belbin
• The team at Landcare Research:
     • Jerry Cooper
    • Nick Spencer
    • Aaron Wilton
    • Michael Cochrane

To top