spacer spacer spacer
spacer spacer spacer
spacer
NASA Jet Propulsion Laboratory, California Institute of Technology + View the NASA Portal

+ NASA en Español

+ Contact NASA
Search the API    

Querying Profile Elements

As desribed in Information Captured in a Profile , profile elements describe the composition of a resource using metadata descriptions taken from the ISO/IEC 11179 standards . The profile elements catalog lists of valid values, minimum and maximum values, data types, and so forth.

As you develop a profile handler to perform queries and generate profiles, you'll encounter three cases when querying profile elements or the data sources they describe:

  • Querying ranges of values
  • Querying enumerated values
  • Querying unspecified profile lements

Queries Against Ranges

Ranged profile elements are those that describe an attribute of a resource's composition in terms of a continuous space of valid values. In the Java implementation, there's a subclass of ProfileElement to represent such ranges: RangedProfileElement . In the XML representation, the < elemEnumFlag > is F and there are values listed for < elemMinValue > and < elemMaxValue > .

An example of a ranged profile element might be:

Name: temperature
Description: Temperatures measured using oral, medical-use, alcohol-based thermometer.
Type: real
Unit: kelvin
Enumeration flag: false
Min value: 282.31
Max value: 301.45

When you're gene rating a profile (or querying a similar metadata model) with a ranged element, queries should match if the sought value occurs within the given, inclusive range. If it's a negative query, then it should match if the sought value doesn't occur within the range.

Here's an example. Suppose you have a ranged profile element called lumens and its minimum value is 10 and its maximum value is 20. Here's a table that shows queries and whether they match:

Query Match?
lumens = 12 Yes, since 12 is between 10 and 20
lumens = 45 No, since 45 is above 20
lumens != 12 Yes, since there are other values in the range 10..20 that match, such as 13, 14, 12.1, etc.
lumens != 45 Yes, since are an infinite number of values in the range 10..22 that are not 45
lumens != 10 Yes
lumens < 45 Yes
lumens > 15 Yes
lumens > 35 No; the highest lumen value is 20
lumens LIKE 12 Maybe

The "LIKE" relational operator defined by the XMLQuery query langauge was meant for string comparisons, yet there's nothing in the software that prevents it from being presented for ranged queries. The choice of whether to match it is up to you.

Queries Against Enumerated Values

Enumerated profile elements are those that describe an attribute of a resource's composition in terms of a discrete list of valid values. In the Java implementation, there's a subclass of ProfileElement to represent such ranges: EnumeratedProfileElement . In the XML representation, the < elemEnumFlag > is T and there are one or m ore < elemValue > elements.

An example of an enumerated profile element might be:

Name: zone
Description: City Planning Commission zoning code for permitted land use.
Type: string
Unit: code
Enumeration flag: true
Value: A
Value: B1
Value: B2
Value: B4
Value: C
Value: H
Value: PDD
Value: R2
Value: R3
Value: R4
Value: R5

When you're generating a profile (or querying a similar metadata model) with an enumerated element, queries should match if the sought value appears as one of the listed elements.

Here's an example. Suppose you have an profile element called planet that has as valid values Mercury , Venus , Earth , and Mars . Here's a table that shows queries and whether they match:

Query Match?
planet = Mercury Yes
planet = Jupiter No
planet != Mercury Yes since Earth, Venus, and Mars are all not Mercury
planet != Jupiter Yes since there are 4 planets which are all not Jupiter
planet < Earth Maybe
planet LIKE %E% Yes, since all four planets have an E in them (without regard to case)
planet NOTLIKE %E% No, since all four planets have an E in them

Relati onal ordering is not specified by the profile model, so whether a query like planet < Earth matches is up to you.

Querying Against Unspecified Values

An unspecific profile element indicates only the presence of an attribute in the composition of a resource, and nothing else. In the Java implementation, there's a subclass of ProfileElement to represent this, UnspecifiedProfileElement . In the XML representation, the < elemEnumFlag > is T and there are zero < elemValue > elements.

Unspecified profile elements can be useful where you have profiles not describing single resources, but entire collections of resources. For example, you may have ranged profile elements called temperature for each temperature resource. But if there are a billion resources, then determining the minimum and maximum temperature for the profile of the entire collection might be painful, in which case you can say that the collection has a temperature attribute by using an unspecified profile for the element for the collection.

Queries against unspecified elements always match, regardless what the query is.

FirstGov - Your First Click to the US Governmnet

+ Freedom of Information Act

+ NASA Privacy Statement, Disclaimer,

and Accessibility Certification


+ Freedom to Manage
NASA

Editor: Sean Kelly

NASA Official: Dan Crichton

Last Published: 07 July 2006

+ Contact NASA
spacer
spacer spacer spacer
spacer spacer spacer