As discussed in earlier sections, the RDA Registry is used to store, create and manage metadata records. These metadata records are then indexed in Solr and exposed to end users via the Discovery Portal. The RDA Registry has two main methods for exposing and exchanging metadata records with the Discovery Portal; the Registry Object API and the Syncing Process.
The Registry Object API is provided as one of the RDA Registry services and it allows the Discovery Portal to request information about registry objects which match a query or specific registry object ID. The portal utilises this API for the detailed display of records and to retrieve any additional metadata that the display logic requires.
This API is designed in much of a REST-ful interface where GET statement refers to a collection.
The Registry Object API is available via
The API has been developed in a way which allows the Portal to request specific metadata items to prevent the need to retrieve the whole metadata record each request. As of release 15, the Registry Object API offers the following handlers:
GET registry/services/registry_objects?q=fish&limit=10&offset=0 returns 10 registry objects that matches the search term of fish GET registry/services/registry_objects/16572 returns the JSON form of the API response for registry object 16572 GET registry/services/registry_objects.xml/16572 returns the XML from of the same request GET registry/services/registry_objects/16572/relationships returns just the relationships of the given registry object. By default, if there’s no handler passed in to the URL, the registry object API will return all available handler.
The portal will use all of the information available in the Registry Object API in order to display the registry object accordingly. For more information on how to write a new registry object handler, please refer to the guide.
The portal default display and search model is registry_object, this is defined in applications/portal/core/config/config.php. For more information on how to use a different display and search model (that is used to customise the Portal for different type of data), please refer to the guide.
The portal registry_object model has an internal registry object called _ro.php (applications/portal/registry_object/models/_ro.php) that is encapsulated by the registry_objects model (applications/portal/registry_object/models/registry_objects.php).
Everytime an object of _ro is initialised, portal requests the registry for all the information regarding this given registry object id and build an object of its own.
$ro = new_ro(12765); //this will instantiate a new object with all the available resource from the registry object API echo $ro->core[’title’]; //this will return the title for the registry object var_dump($ro->descriptions); //this will give us a list of all the descriptions and their type for this registry object
The process is simplified with the registry_objects model. We can simply instantiate a new object by
$this->load->model('registry_objects', 'ro'); $ro = $this->ro->getByID(12765); //returns the _ro object with ID 12765 $ro = $this->ro->getByKey(‘abc’); //returns the _ro object by key $ro = $this->ro->getBySlug(‘fish’); //returns the _ro object by the URL friendly slug
The portal make extensive use of the
solr.php library located at
engine/libraries/Solr.php for searching. The portal delivers a search page that is powered by AJAX and the AngularJS framework to interact with SOLR and deliver search results.
Example: a simple search
$this->load->library('solr'); # loading the SOLR library for use $this->solr->setOpt('q', 'fish'); # setting the parameter of q to fish $result = $this->solr->executeSearch(); # $result now contains the SOLR search result of fish
Example: a simple facet
$this->load->library('solr'); $this->solr->setOpt('q', 'fish'); $this->setFacetOpt('field', 'class'); # translates to facet.field=class in SOLR $this->setFacetOpt('field', 'type'); # translates to facet.field=type in SOLR $result = $this->solr->executeSearch(); # $result now contains the SOLR search result of fish $facets = $this->solr->getFacet(); # $facets now contains the facet_counts return value of the SOLR search, this will contain both class facet and type facet $class_facets = $this->solr->getFacetResult('class'); # $class_facets will only contain the facet counts for the class facet
Searching and Facetting functionality is made available via the SOLR indexed fields. The indexed fields are found at the our solr schema file, the latest is located at