ESciDoc Services ValidationService

From MPDLMediaWiki
Jump to navigation Jump to search
eSciDoc SOA

SOAP and REST style interfaces
Service layers

Core services
Context Handler · Item Handler
Container Handler
Organizational Unit Handler
User Account Handler
Authentication
Content Model Handler
Semantic Store Handler

Intermediate services
Validation Service
Statistics Manager
Technical Metadata extraction
PIDManager
Basket Handler
Duplication detection
ImageHandler(Digilib)

Application services
Depositing
Searching
Search&Export
Control of Named Entities
Citation style Manager
RightsChecking
DataAcquisition
Transformation
Fledged Data
PID Cache
OAI-PMH

SOA Introduction

edit

Work in progress

ID (Label)[edit]

validation

Complete Name[edit]

Validation Service

Status[edit]

Implemented

Description[edit]

The validation service provides interfaces for validation of the item and container resources in accordance with defined set of rules. Validation rules are defined for a combination of a content model, validation schema, metadata schema version and a validation point. The validation rules are defined with Schematron

Operations Overview[edit]

Operation Status Input Output Description
validateItemXml implemented itemXml: String String Scope:Public
Validates an item (as XML string) based on the content-model of the item and the validation schema defined in the context the item belongs to. The default validation point is used.
validateItemXml implemented itemXml: String
validationPoint: String
String Scope:Public
Validates an item (as XML string) based on the content-model of the item and the validation schema defined in the context the item belongs to using the given validation point.
validateItemXmlBySchema implemented itemXml: String
validationPoint: String
validationSchema: String
String Scope:Public
Validates an item (as XML string) based on the content-model of the item and the given validation schema using the given validation point.
validateItemObject implemented itemXml: String String Scope:Public
Validates an item (as ValueObject) based on the content-model of the item and the validation schema defined in the context the item belongs to. The default validation point is used.
validateItemObject implemented itemXml: String
validationPoint: String
String Scope:Public
Validates an item (as ValueObject) based on the content-model of the item and the validation schema defined in the context the item belongs to using the given validation point.
validateItemObjectBySchema implemented itemXml: String
validationPoint: String
validationSchema: String
String Scope:Public
Validates an item (as ValueObject) based on the content-model of the item and the given validation schema using the given validation point.
refreshValidationSchemaCache not implemented Scope:Public
Synchronizes the service's validation schema cache with the underlying validation schema store, i.e. the eSciDoc repository.

Service interfaces[edit]

Validation service operations are offered via EJB, REST and SOAP interfaces.

For example, see Validation service in action

Download[edit]

How to describe which validation schema shall be used[edit]

The first and easiest way is to use "validateItem(Xml|Object)BySchema": Then, only the desired schema has to be named in the method call

   e.g. validateItemXmlBySchema("<escidocItem:item/>", "default", "simple")

where "simple" is the validation schema.

The second way currently used in PubMan is to define the validation schema in the Admin-Descriptor defined in the Context. "An AdminDescriptor keeps settings from application. A Context may have multiple Admin-Descriptors as well as no one. The Admin-Descriptors are stored as data streams with unique names. Specifications for XML structure of Admin-Descriptors will not be done" (from the eSciDoc-core documentation). Here is the structure of PubMan's Admin-Descriptor (see http://coreservice.mpdl.mpg.de/ir/context/escidoc:persistent3 ):

<context:admin-descriptor name="pubman"
    xlink:type="simple" xlink:title="pubman admin descriptor." xlink:href="/ir/context/escidoc:persistent3/admin-descriptors/admin-descriptor/pubman">
    <pubman-admin-descriptor>
        <allowed-genres>
            <allowed-genre>article</allowed-genre>
            <allowed-genre>book</allowed-genre>
            <allowed-genre>book-item</allowed-genre>
   
            <allowed-genre>proceedings</allowed-genre>
            <allowed-genre>conference-paper</allowed-genre>
            <allowed-genre>talk-at-event</allowed-genre>
            <allowed-genre>conference-report</allowed-genre>
            <allowed-genre>poster</allowed-genre>
            <allowed-genre>courseware-lecture</allowed-genre>
   
            <allowed-genre>thesis</allowed-genre>
            <allowed-genre>paper</allowed-genre>
            <allowed-genre>report</allowed-genre>
            <allowed-genre>journal</allowed-genre>
            <allowed-genre>issue</allowed-genre>
            <allowed-genre>series</allowed-genre>
   
            <allowed-genre>other</allowed-genre>
        </allowed-genres>
        <template-item>escidoc:123</template-item>
       
        <!-- Here it comes -->
        <validation-schema>publication</validation-schema>

        <workflow>standard</workflow>
    </pubman-admin-descriptor>
</context:admin-descriptor>

How to enter a new validation schema[edit]

There is no tool for entering new validation schemas yet, so a little bit of manual work is needed.

  1. Make a copy of one of the existing schemas that you can find here
  2. Edit the file and add new rules or remove existing rules. The syntax of the file is defined by Schematron and by your data structure (e.g. an eSciDoc application profile) expressed in XPath.
  3. Make sure your JBoss is running and the validation service has been initialized before
  4. Start the Hypersonic SQL Console of your JBoss:
    1. Open http://localhost:8080/jmx-console/HtmlAdaptor?action=inspectMBean&name=jboss%3Aservice%3DHypersonic%2Cdatabase%3DlocalDB in your browser
    2. Invoke startDatabaseManager()
    3. A swing client will open up showing the current database structure and an SQL window.
  5. Enter the new schema with SQL: INSERT INTO escidoc_validation_schema (id_content_type_ref, id_context_ref, schema_content) VALUES ('<escidoc:content-model-id>', '<escidoc:validation-schema-name>', '<validation-schema-content>'); --Note: Apostrophs in the schema content should be escaped with double apostrophs whereas line breaks do not need to be escaped
  6. Open http://localhost:8080/validation/rest/refreshValidationSchemaCache to precompile the schema
  7. Add the new schema to the admin descriptor of your context as described above

Future Development[edit]