Main -> Documentation -> Database Builder – Pears -> The Pears Tags File

 

 

 

 

 

 

 

 

The Pears Tags (.tags) File

The information below identifies and defines the basic constructs that you can create in a Pears tags file.

Contents

Introduction
Parameters in a Tags File
Example


Introduction

A tags file works in concert with certain record handlers to map fields in an SGML, XML, or delimited text record to their corresponding BER tag paths. Within the SiteSearch environment, all records must eventually be stored in BER format in order for them to be manipulated through the WebZ Interface or Record Builder Cataloger Interface.

Two Pears record handlers expect a tags file:

During an import or export, HandleSGML or HandleDelimited first looks in the current database description configuration file for a reference to a specific tags file. If it does not find one, it automatically creates its own tags file. Regardless, whether the record handler creates it or you define it, a tags file must be present in order to import and export SGML, XML, or delimited records into and out of a Pears database.

There are a couple advantages to defining a tags file, rather than letting the record handler create its own.

When you define and point to a specific tags file during import, you can standardize where data is placed in the resulting BER record. Maintaining the predictable locations of data within your BER records makes it easier for you to reuse existing formats when displaying records in the WebZ Interface. Without this standardization, you would likely have to create new formats each time you created a new database.

Additionally, the tags file works in conjunction with a template (.xml) file to enable you to view or update Pears records through the Record Builder cataloger interface. Certain tag paths are predefined and expected by template.xml files within the Record Builder environment. Defining tags files rather than letting record handlers create them by default allows you to take advantage of and preserve any existing mappings to fields thus enabling your access to the Pears database through the Record Builder Cataloger Interface.

Example:

The following example shows the process involved in converting an SGML-formatted record into a BER-formatted record using a defined tags file.


Notes:

A record's content (PCDATA) tag must equal "1001" if you want to use Record Builder to view or modify the record. If you do not specify a content tag in the tags file as seen in the above example, the record handler assumes the default is 1. Likewise, if you don't define a tags file at all, the record handler automatically creates one for itself and assumes the content tag is "1." Accepting a default value of "1" for the content tag prevents the record from being accessed through the Record Builder cataloger interface because of conflicts it subsequently encounters with tag paths in the corresponding template.xml file.

Also, the HandleSGML class validates the tags file to verify that you have defined an attribute tag. If you do not define this tag, the record handler assumes both the tag and its default value of "2." Although you may assign any value to the attribute tag that you wish, it is customary to use subfield "2."


Return to Contents

Parameters in a Tags File

The table below provides definitions and examples for the various structures that you can create in a Tags file for a Pears database. If you have worked with Newton databases, you may notice many similarities between the contents of a .dtd file and the contents of a .tags file.

Parameter
Description
RecordTag

Optional

RecordTag tells the record handler how it can identify a new record. Its Name is your choice; however, its attribute must be "RecordTag."

content

Optional

The value for the content definition identifies into which subfield the record handler is to map the data for a field. You can set this globally for the entire record at the top of the tags file. While its name does not matter to the record handler, its attribute value must be "content" when you declare it in a tags file.

Note: If you do not define content or do not define a tags file at all, the record handler assumes that each field's content is in subfield "1."

attribute

Optional

The attribute defines which subfield in a BER record contains an SGML element attribute node.

Example:

If you declared "2" as the subfield that is to contain attribute information:

 


ID

Optional
The record ID field identifies the tag that holds the unique ID for each record. A record must have a unique ID in order to be modified.
tag_definition

Optional
An individual tag definition maps a field in an SGML, XML, or delimited text record to its corresponding location in a BER record. While you may choose any Name Space, Name, and Tag Number that you want for each definition, the best practice is to maintain consistency across your databases. Additionally, if you are planning to view and modify records from the current database using the Record Builder cataloger interface, you do not want to reuse tag numbers associated with already existing RB, Scorpion, or MANTIS tags in other tags files.

Tag definitions follow the syntax Name, TagPath, Attribute and they fall into one of two types:

  • Data File Processing Tag Definition
  • Field Tag Definition

A data file processing tag definition declares how the data is going to be processed. It sets a global attribute value that will affect every tag in a record.



Return to Contents


Example

The following is an example tags file:

rec 0 RecordTag
PCDATA 1001 content
Attribute 2 attribute
ID 1099

DC:Type 101
DC:Format 102
DC:Description 103
DC:Language 104
DC:Rights 105
DC:Identifier 106
DC:Date 107
DC:Title 108
DC:Publisher 109
DC:Creator 110
DC:Subject 111
DC:Source 112
DC:Relation 113
DC:Contributor 114
DC:Coverage 115
DC:Author 116
DC:Audience 117
DC:RelationURL 118
DC:Level 119
DC:Cost 120

RB:auth 1005
RB:state 1006
RB:term 1007

RDF:Value 1011
RDF:Type 1012
RDF:HREF 1023

Scorpion:Subject 1200
Scorpion:DeweyNumber 1201
Scorpion:SubjectPhrase 1202
Scorpion:Dewey 1203
Scorpion:Phrase 1204

MANTIS:label 1301
MANTIS:image 1302
MANTIS:color 1303
MANTIS:br 1304
MANTIS:display 1305
MANTIS:replicable 1306
MANTIS:width 1307
MANTIS:Group 1308
MANTIS:hr 1309
MANTIS:height 1310
MANTIS:level 1311
MANTIS:help 1312
MANTIS:default 1313
MANTIS:section 1314
MANTIS:index 1315
MANTIS:searchable 1316
MANTIS:hook 1317
MANTIS:href 1318
MANTIS:header 1319
MANTIS:button 1323
MANTIS:parm 1324
MANTIS:name 1325
MANTIS:value 1326
MANTIS:last 1327
MANTIS:id 1328
MANTIS:wildcard 1329
MANTIS:pattern 1330
MANTIS:accept 1335
MANTIS:recurse 1336
MANTIS:token 1333
MANTIS:dataOrder 1334
MANTIS:mutable 1335
MANTIS:prepend 1336
MANTIS:maxHeight 1337
MANTIS:indent 1338
MANTIS:search 1339

TOKEN 1332
DublinCore 1334

RB:Info 1341
RB:Status 1342
RB:LocalData 1343
RB:Institution 1344
RB:LocalDataDate 1345
RB:StatusValue 1346
RB:CompositeStatusValue 1347
RB:Version 1348
RB:CreateDate 1349
RB:ReplacedDate 1350
RB:UsedDate 1351
RB:CreatedBy 1352
RB:LastModifiedBy 1353
RB:LastModifiedByID 1354
RB:LastReplacedBy 1355
RB:LastSubmitTemplate 1356
RB:HarvestInfo 1357
RB:HarvestStatus 1358
RB:HarvestDate 1359
RB:HarvestSuccessDate 1360
RB:HarvestFailures 1361
RB:RedirectChain 1362
RB:Redirect 1363
RB:RedirectURL 1364
RB:RedirectOrder 1365
RB:Scheme 1371

YesDC: 1372
RB:modifier 1373
DC:Scheme 1374
DC:Qualifier 1375
DC:Qualifier 1375


Return to Contents

See Also

Pears Record Handlers
Pears Database Description Configuration File
Creating a New Pears Database
SSDOT for Pears
Pears Database Build Process


[Main][Documentation][Support][Technical Reference][Community][Glossary][Search]

Last Modified: