Cdm Rdf Web Services¶
This page describes how to extend the CDM Remote RESTful web services to provide responses in RDF format
- Table of contents
- Cdm Rdf Web Services
Note: Currently this is a pilot implementation done within the i4Life project targeting the name information web service which is part of the CDM Name Catalogue service set.
Mapping Data Objects to RDF counterparts¶
The chosen data object (e.g. source:cdmlib|cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/namecatalogue/NameInformation.java) needs to be mapped to a corresponding RDF representation object (e.g. source:cdmlib|cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/cdm/NameInformationRdf.java), which contains the namespace for each declared, non-transient member. The mappings are declared in specific mapping files (e.g. the
NameInformationRdf is present in the tdwg source:cdmli|cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote/dto/tdwg/mappings.xml). The root element of the RDF representation object should be added to the list of elements in the source:cdmlib|cdmlib-remote/src/main/java/eu/etaxonomy/remote/dto/rdf/Rdf.java class which itself is the root element of the RDF response.
RDF Mapping / Marshalling¶
remote.xml (source:cdmlib|cdmlib-remote/src/main/resources/eu/etaxonomy/cdm/remote.xml) contains the configuration for the marshallers. Currently there are two,
- marshaller : used for the OAI-PMH process
- rdfMarshaller : used for more basic rdf marshalling.
The marshallers also link to a namespacePrefixMapper (e.g. TDWGNamespacePrefixMapper (source:cdmlib|cdmlib-model/src/main/java/eu/etaxonomy/cdm/jaxb/TDWGNamespacePrefixMapper.java)) which contain the prefixes for the namespaces used in the rdf representation.
remote.xml also contains the data object to rdf representation object mapping files as a property of the dozer mapper.
RDF Remote View Configuration¶
The view configuration consists of the rdf-views.xml included in the list of views in the cdmlib-remote-servlet.xml configuration file. rdf-views.xml contains RdfView as the class responsible for rendering the RDF view as well as the pattern for the web service url (currently, this is only allows the name catalogue services).
This sections mentions the issues / questions that have come up in the course of the pilot implementation.
- TDWGNamespacePrefixMapper contains prefixes mapped to namespaces.
- RdfView maps data objects to their rdf representation objects.
- Rdf contains a list of possible rdf representation elements.
Mapping CDM DAO / DTO objects to known classes / terms¶
Are we attempting to match exactly CDM entities to TDWG classes (which can be seen in the eu.etaxonomy.cdm.remote.dto.tdwg and source:cdmlib/cdmlib-remote/src/main/java/eu/etaxonomy/cdm/remote/dto/tdwg/voceu.etaxonomy.cdm.remote.dto.tdwg.voc packages) or can we create our own classes by combining different classes / terms from various vocabularies (TDWG, DC, DwC, CDM, etc) ?
What is the policy on creating a CDM vocabulary ?
- do we need two marshallers or can we merge them into one ?