Organisation and Repository Indentification [ORI] demonstrator

Other example uses of the ORI APIs are example_get.html and example_list.html

Main api queries

This is a very simple client/demonstrator of the ORI.

(The api is ori.edina.ac.uk/api. Documentation is on this server)

To play with it, add various parameters to the end of the url:

You can specify multiple things in the parameters:
If you specify multiple ips, orgs or geos, it will return a union of the items found (ie, all the orgs that are associated with any of the IP numbers given)
If you specify ips and/or orgs and/or geo, it will return the intersection of the items found (ie, all the items that are around the geo-location x,y and belong to something that owns that network range
content & type are there to restrict the respositories returned

The data is known to contain errors, and there will be a concerted effort to "tidy up" shortly.

Rendered return from the api

Data Library has 1 associated repository.

Repository name :
Edinburgh DataShare (live:2016-09-13)
Description :
This is an institutional data repository of cross-disciplinary research datasets produced at the University, designated to support the University's Research Data Management Policy. The interface is in English and contains RSS feeds to alert users to new content.
Additional Comment :
Organisatons: EDINA
This is an institutional data repository of cross-disciplinary research datasets produced at the University, designed to compliment the Edinburgh Research Archive.
Repository Type(s) :
Institutional (Institutional or departmental repositories)
Content Type(s) :
Datasets
Language(s) :
English
SWORD :
http://datashare.is.ed.ac.uk/sword/servicedocument

JISC Services Management Company Ltd has no known repositories registered.

National E-Science Centre has no known repositories registered.

OpenDepot has 1 associated repository.

Repository name :
OpenDEPOT.org (live:2016-07-26)
Description :
This site is a facility for researchers based at universities, colleges and research institutions to deposit their peer-reviewed papers, articles, and book chapters (e-prints) at those institutions that currently lack an institutional repository. Academics with institutional repositories will be directed to submit materials to their own sites. Users m,ay set up Atom and RSS feeds to be alerted to new content.
Additional Comment :
The purpose of OpenDepot.org is to ensure that all academics worldwide can share in the benefits of making their research output Open Access. For those whose universities and organisations have an online repository, OpenDepot.org makes them easy to find. For those without a local repository, including unaffilitiated researchers, the OpenDepot is a place of deposit, available for others to harvest. We have tried to make OpenDepot.org easy or researchers and authors to use. It technical terms, OpenDepot.org does the following: -- accepts deposit of e-prints from researchers at institutions that do not currently have an Institutional Repository (IR). -- The principal target is postprints, that is articles that have been peer-reviewed and accepted for publication. -- as Institutional Repositories (IRs) are established, OpenDepot.org will support the transfer of relevant content to help populate those new IRs. -- an OAI-compliant interface, so, like other open access repositories, its contents is available for harvesting. -- re-directs depositors to an appropriate Institutional Repository (IR). Like the Depot, which is an earlier version of OpenDepot.org, we use OpenDOAR and ROAR as the source for information about available repositories worldwide, and we use ROMEO as a source of information about publisher polices.
Partners: SHERPA, EDINA, JISC. Formerly The Depot.
Repository Type(s) :
Subject (Research Cross-Institutional), Other, Aggregating (Archives aggregating data from several subsidiary repositories)
Content Type(s) :
Research papers (pre- and postprints), Conference and workshop papers, Books & Chapters and Sections
Language(s) :
English
SWORD :
http://www.opendepot.org/sword-app/servicedocumenthttp://opendepot.org/sword-app/servicedocument

STFC Rutherford Appleton Laboratory has 1 associated repository.

Repository name :
CEDA Repository (live:2016-11-29)
Description :
This site provides access to the grey literature, primarily concerning Earth observation and the atmospheric sciences. Users may set up Atom and RSS feeds to be alerted to new content
Additional Comment :
Special Items include Grey Literature
Repository Type(s) :
Disciplinary (Cross-institutional subject repositories)
Content Type(s) :
Research papers (pre- and postprints), Conference and workshop papers, Books & Chapters and Sections, Datasets, Multimedia and audio-visual materials, Other special item types
Language(s) :
English
SWORD :
http://cedadocs.badc.rl.ac.uk/sword-app/servicedocument

School of Informatics has 1 associated repository.

Repository name :
Informatics@Edinburgh - Reports Series (live:2017-03-21)
Description :
This is a subject based institutional repository site with papers from members of the School of Informatics. The interface is restricted to a simple series of Web page lists of papers by title, author and speciality institute. Not all the papers are available, although full bibliographic references are given. Many reports are not available on the site, but are linked to external Open Access and some commercially published locations. As such the ability to access some of these later varieties of information will be restricted by the local subscription and access rights of the reader.
Additional Comment :
Special items: Links
Repository Type(s) :
Institutional (Institutional or departmental repositories)
Content Type(s) :
Bibliographic references, Unpublished reports and working papers, Other special item types
Language(s) :
English

Scottish Institute for Research in Economics (SIRE) has 1 associated repository.

Repository name :
SIRE (live:2016-02-02)
Description :
This site provides access to the research outputs of the SIRE Research Pool of Scottish Universities. Users may set up RSS feeds to be alerted to new content. The interface is available in English.
Repository Type(s) :
Aggregating (Archives aggregating data from several subsidiary repositories)
Content Type(s) :
Unpublished reports and working papers, Learning Objects
Language(s) :
English

The Research Output Service has no known repositories registered.

The University of Edinburgh has 4 associated repositories.

Repository name :
Edinburgh DataShare (live:2016-09-13)
Description :
This is an institutional data repository of cross-disciplinary research datasets produced at the University, designed to compliment the Edinburgh Research Archive.
Additional Comment :
Organisatons: EDINA
This is an institutional data repository of cross-disciplinary research datasets produced at the University, designated to support the University's Research Data Management Policy. The interface is in English and contains RSS feeds to alert users to new content.
Repository Type(s) :
Institutional (Institutional or departmental repositories)
Content Type(s) :
Datasets
Language(s) :
English
SWORD :
http://datashare.is.ed.ac.uk/sword/servicedocument
Repository name :
Edinburgh Research Archive (ERA) (live:2014-12-23)
Description :
University repository across all disciplines. Registered users can set up email alerts to notify them of newly added relevant content.
Additional Comment :
Partners: SHERPA
ERA is a digital repository of research produced at The University of Edinburgh. Here we present a selection of our best research including full-text digital Theses and Dissertations, book chapters, working papers, technical reports, journal pre-prints and peer-reviewed journal reprints.
Repository Type(s) :
Institutional (Institutional or departmental repositories)
Content Type(s) :
Research papers (pre- and postprints), Conference and workshop papers, Unpublished reports and working papers, Books & Chapters and Sections, Datasets
Language(s) :
English
Repository name :
Edinburgh Research Explorer (live:2017-03-21)
Description :
Edinburgh Research Explorer is the portal and discovery layer for PURE, which serves as its main Institutional Repository for publications. The interface is in English and contains an RSS feed.
Repository Type(s) :
Institutional (Institutional or departmental repositories)
Content Type(s) :
Research papers (pre- and postprints), Conference and workshop papers, Unpublished reports and working papers, Books & Chapters and Sections
Language(s) :
English
SWORD :
http://www.research.ed.ac.uk/portal//sword/servicedocument
Repository name :
Informatics@Edinburgh - Reports Series (live:2017-03-21)
Description :
This is a subject based institutional repository site with papers from members of the School of Informatics. The interface is restricted to a simple series of Web page lists of papers by title, author and speciality institute. Not all the papers are available, although full bibliographic references are given. Many reports are not available on the site, but are linked to external Open Access and some commercially published locations. As such the ability to access some of these later varieties of information will be restricted by the local subscription and access rights of the reader.
Additional Comment :
Special items: Links
Repository Type(s) :
Institutional (Institutional or departmental repositories)
Content Type(s) :
Bibliographic references, Unpublished reports and working papers, Other special item types
Language(s) :
English

The client-side script that is being run to create content inside the box above is:

#!/usr/bin/perl

use strict;
use Data::Dumper;
use CGI;
use LWP::Simple qw(get);
use JSON qw(from_json);
use URI::Escape;
use HTML::Entities;

##########################
#
# Render response
#
##########################
sub list_repos {
  my $data = shift;
  my %orgs = ();
  my $network;

  if ( $data->{'status'} == 'ok' ) {

    # NETWORK
    for my $net ( values %{ $data->{'message'}->{'net'} } ) {

      if ( !$net->{'orgs'} ) {
        print '<p><strong>No organisations were found.</strong></p>';
      } else {

        # ORGANISATION
        for my $org ( sort { $a->{'org_name'} cmp $b->{'org_name'} }
          @{ $net->{'orgs'} } )
        {
        print '<div class="org">';
        print '<div class="org_map">';
        print '<img src="http://maps.googleapis.com/maps/api/staticmap?center='
                 . $org->{'lat'} . ',' . $org->{'long'}
                 . '&size=500x500&sensor=false&zoom=14&maptype=hybrid&markers=color:blue%7Clabel:O%7C'
                 . $org->{'lat'} . ',' . $org->{'long'} . '" />';
        print '</div>';


          unless ( defined $org->{'repos'} ) {
            printf
                '<p class="org-summary"><strong>%s</strong> has no known repositories registered.</p>',
                encode_entities($org->{'org_name'});
          } else {

            # Organisation summary text
            printf
                '<p class="org-summary"><strong>%s</strong> has %d associated %s.</p>',
                encode_entities($org->{'org_name'}),
                scalar @{ $org->{'repos'} },
                ( scalar @{ $org->{'repos'} } == 1 )
                ? 'repository'
                : 'repositories';

            # REPOSITORIES
            if ( scalar @{ $org->{'repos'} } ) {

              print '<div class="repos">';

              for my $repo ( sort { $a->{'repo_name'} cmp $b->{'repo_name'} }
                @{ $org->{'repos'} } )
              {
                print '<div class="repo">';
                print '<div class="repo_map">';
                print '<img src="http://maps.googleapis.com/maps/api/staticmap?center=' . $repo->{'lat'}
                    . ',' . $repo->{'long'}
                    . '&size=300x300&sensor=false&zoom=16&maptype=hybrid&markers=color:blue%7Clabel:R%7C'
                    . $repo->{'lat'} . ',' . $repo->{'long'} . '" />';
                print '</div>';

                print '<dl class="oarj_repository">';

                # Name
                print '<dt class="oarj_name">Repository name :</dt>';
                print '<dd>';
                printf
                    '<a href="http://%s/cgi/RJ-Bounce?url=%s" rel="external">%s</a>',
                    $ENV{'HTTP_HOST'},
                    uri_escape( $repo->{'repo_url'} ),
                    $repo->{'repo_name'};
                print " ($repo->{'repo_acronym'})"
                    if ( $repo->{'repo_acronym'} );
                print ' <span style="font-size:smaller">(live:'
                    . $repo->{'repo_date_checked'} . ')</span>'
                    if $repo->{'repo_checked_good'};
                print '</dd>';

                # Description
                if ( $repo->{'description'} ) {
                  print
                      '<dt class="oarj_description_title">Description :</dt>';
                  print '<dd class="oarj_description_text">';
                  print encode_entities( $repo->{'description'} );
                  print '</dd>';
                } ## end if ( $repo->{'description'...})

                # Comment(s)
                if ( exists $repo->{'comment'} && scalar @{$repo->{'comment'}} ) {
                  print '<dt class="oarj_comment_title">Additional Comment :</dt>';
                  foreach my $c ( @{$repo->{'comment'}} ) { 
                    print '<dd class="oarj_comment_text">';
                    print encode_entities( $c );
                    print '</dd>';
                  }
                } ## end if ( $repo->{'comment'...})

                # Repository Type(s)
                if ( $repo->{'types'} ) {
                  print
                      '<dt class="oarj_types_title">Repository Type(s) : </dt>';
                  print '<dd class="oarj_types_text">';
                  print join ', ', @{ $repo->{'types'} };
                  print '</dd>';
                } ## end if ( $repo->{'types'} )

                # Content Type(s)
                if ( $repo->{'content'} ) {
                  print
                      '<dt class="oarj_content_title">Content Type(s) : </dt>';
                  print '<dd class="oarj_content_text">';
                  print join ', ', @{ $repo->{'content'} };
                  print '</dd>';
                } ## end if ( $repo->{'content'...})

                # Languages
                if ( $repo->{'language'} ) {
                  print '<dt class="oarj_lang_title">Language(s) : </dt>';
                  print '<dd class="oarj_language_text">';
                  print join ', ', @{ $repo->{'language'} };
                  print '</dd>';
                } ## end if ( $repo->{'language'...})

                print '</dl>';
                print '</div>';
              } ## end for my $repo ( sort { $a...})

              print '</div>';
            } ## end if ( scalar @{ $org->{...}})

          } ## end else
          print '</div>';
        } ## end for my $org ( sort { $a...})
      } ## end else [ if ( !$net->{'orgs'} )]
    } ## end for my $net ( @{ $data->...})
  } ## end if ( $data->{'status'}...)
} ## end sub list_repos
##########################
#
# Main
#
##########################
my $query = CGI->new;
print $query->header('text/plain');
#print $query->header();

# Setup query string for API call
my ( %params, @queryString, @ips, @orgs, @contents, @types, @geos );

@queryString = ();

@ips      = $query->param('ip');
@orgs     = $query->param('org');
@geos     = $query->param('geo');
@contents = $query->param('content');
@types    = $query->param('type');
unless ( scalar @ips || scalar @orgs || scalar @geos ) {
  ( $ips[0] ) = ( $ENV{'REMOTE_ADDR'} );
}
for my $ip (@ips) {
  push( @queryString, "ip=$ip" );
}
for my $org (@orgs) {
  push( @queryString, "org=$org" );
}
for my $geo (@geos) {
  push( @queryString, "geo=$geo" );
}
for my $content (@contents) {
  push( @queryString, "content=$content" );
}
for my $types (@types) {
  push( @queryString, "type=$types" );
}

# Get JSON object
my $url
    = "http://ori.edina.ac.uk/cgi-bin/api?" . join( '&', @queryString );

my $foo = from_json( get($url), { utf8 => 1 } );

print list_repos($foo);