public abstract class JulieXMLConstants extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
CONCAT_STRING
Constant for the name of a field attribute.
|
static String |
EXTRACT_FROM_FILENAME
Constant for the name of a field attribute.
|
static String |
FOR_EACH
Constant for the name of a definition attribute in the configuration file for the
DataBaseConnector. |
static Object |
GZIP |
static String |
NAME
Constant for the name of a field.
|
static String |
PRIMARY_KEY
Constant for the name of a field attribute.
|
static String |
REGEX
Constant for the name of a field attribute.
|
static String |
REPLACE_WITH
Constant for the name of a field attribute.
|
static String |
RESOLVE_ENTITIES
Constant for the name of a field attribute.
|
static String |
RETRIEVE
Constant for the name of a field attribute.
|
static String |
RETURN_ARRAY
Constant for the name of a field attribute.
|
static String |
RETURN_XML_FRAGMENT
Constant for the name of a field attribute.
|
static String |
TIMESTAMP
Constant for the name of a field attribute.
|
static String |
TYPE
Constant for the name of a field attribute.
|
static String |
XPATH
Constant for the name of a field attribute.
|
| Constructor and Description |
|---|
JulieXMLConstants() |
public static final String FOR_EACH
DataBaseConnector. The
value of the FOR_EACH attribute is the XPath expression which determines the XML elements for each
of which particular fields with values within these elements should be constructed.
Example:
Assume we have a file with the following structure:
We want to traverse each of the <MedlineCitation> elements and extract information from their inner
elements, e.g. their PMID. For this purpose we set the
<MedlineCitationSet>
<MedlineCitation>
<PMID>123456</PMID>
...more content...
</MedlineCitation>
...
<MedlineCitation>
...some content...
</MedlineCitation>
...
</MedlineCitationSet>
FOR_EACH attribute (or the corresponding
method parameters in the Java code) to the XPath "/MedlineCitationSet/MedlineCitation".
public static final String PRIMARY_KEY
If set to true, the database table column corresponding to the field definition with the PRIMARY_KEY
attribute will be part of the primary key.
public static final String RETRIEVE
If set to true, the value of the database table column corresponding to the field definition with the
RETRIEVE attribute will be retrieved by the DataBaseConnector's query methods.
public static final String XPATH
XPATH attribute is holding the XPath expression that
determines which XML element holds the desired information for the field.public static final String NAME
Map.public static final String RETURN_XML_FRAGMENT
The RETURN_XML_FRAGMENT attribute determines whether the complete XML code pointed to by the
XPATH attribute should be returned (RETURN_XML_FRAGMENT set to true).
Example:
A field with the following attribute-value-pairs
<field name="xml" xpath="/MedlineCitationSet/MedlineCitation" returnXMLFragment="true">
public static final String RETURN_ARRAY
If a field's XPath expression has several hits (e.g. an XPath pointing to an author in a Medline document will
most probably find multiple matches), RETURN_ARRAY determines whether the extracted values should be
returned as a String array. If set to false, multiple values will be concatenated using the String given by
CONCAT_STRING or, if missing, the default (',').
public static final Object GZIP
public static final String CONCAT_STRING
Determines the String to be used when concatenating multiple hits of an XPath. Multiple hits can also be returned
as an array. See the RETURN_ARRAY constant for more information.
public static final String EXTRACT_FROM_FILENAME
If set to true, the file name - if the XML document is read from file - is used to extract values. This is done
on a 'match with regular expression and replace with' fashion. Therefore, using this attribute requires to
deliver values for the attributes REGEX and REPLACE_WITH as well.
public static final String RESOLVE_ENTITIES
If set to true, extracted XML text passages will be XML entity resolved. That is, special characters will be substituted by their human readable counterpart.
Example:
The text
The population of butterflies \& bees represents < 30% of all insects
contains the XML entities '&' and '<' in an escaped fashion so not to collide with the XML parsing process. Switching RESOLVE_ENTITIES to true will
result in the string
The population of butterflies & bees represents < 30% of all insects
public static final String TIMESTAMP
TIMESTAMP attribute to "true"
will be given the time stamp of the last update for the corresponding record. This is required for delta-updates.public static final String REGEX
Used together with EXTRACT_FROM_FILENAME and REPLACE_WITH attributes. Determines the
regular expression whose matches on the XML document file name are substituted by the value given by
REPLACE_WITH.
public static final String REPLACE_WITH
Used together with EXTRACT_FROM_FILENAME and REGEX attributes. Determines the
substitute expression to replace characters of the XML document filename which match the regular expression given
by the REGEX attribute.
public static final String TYPE
Used to set the type of a parsed value, e.g. String
Copyright © 2017 JULIE Lab Jena, Germany. All rights reserved.