Relation field

From EPrints Documentation
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects


Metadata Fields: Arclanguage - Base64 - Bigint - Boolean - Compound - Counter - Dataobjref - Date - Decimal - Email - Fields - Float - Id - Idci - Image - Int - Itemref - Keywords - Langid - Longtext - Longtext_counter - Multilang - Multipart - Name - Namedset - Pagerange - Recaptcha - Relation - Search - Secret - Set - Storable - Subject - Subobject - Text - Time - Timestamp - Url - Uuid


Description

This field is derived from a Compound field to store for relations. It contains to sub-fields: uri that store a URI for the object that is related and type for the type of relationship.

Inheritance

Additional Properties

As for Compound fields.

Required Phrases

In addition to Compound fields phrases, sub-field name phrases are needed for uri and type. In the forms:

dataset_id + "_fieldname_" + fieldname + "_uri"
dataset_id + "_fieldname_" + fieldname + "_type"

Database

Relation fields are stored in the database as:

fieldname_uri VARCHAR(255)
fieldname_type VARCHAR(255)

API

See API page.

Examples

Most basic example.

{
    name => 'relation',
    type => 'relation',
}

Storing multiple relations.

{
    name => 'relations',
    type => 'relation',
    multiple => 1,
}