next up previous contents
Next: Query 3. Up: OPM Query Examples Previous: Query 1.

Query 2.

Retrieve attributes of all Maps containing MapElements associated with GenomicSegments CFTR and DMD.

SELECT M(displayName, accessionID, units, objectClass, minCoord, maxCoord)
FROM M IN Map, 
     GS1 IN  M.!map[MapElement]segment[GenomicSegment]!dBObject[ObjectName]searchName,
     GS2 IN  M.!map[MapElement]segment[GenomicSegment]!dBObject[ObjectName]searchName
WHERE GS1 ="cftr" AND GS2 ="dmd"
ORDER BY M.displayName;

Note that this query retrieves Maps with possibly distinct MapElements associated with the GenomicSegments CFTR and DMD. The original statement of the query asked for ``Maps containing a MapElement associated with GenomicSegments CFTR and DMD''. Such a query could be expressed as

SELECT M(displayName, accessionID, units, objectClass, minCoord, maxCoord)
FROM M IN Map, 
     ME IN  M.!map[MapElement],
     GS1 IN  ME.segment[GenomicSegment]!dBObject[ObjectName]searchName,
     GS2 IN  ME.segment[GenomicSegment]!dBObject[ObjectName]searchName
WHERE GS1 ="cftr" AND GS2 ="dmd"
ORDER BY M.displayName;

However the segment attribute of MapElement is single-valued: that is, a MapElement can be associated with at most one GenomicSegment. In addition, one would not expect the same GenomicSegment to be associated with both of the ObjectNames ``cftr'' and ``dmd''. Consequently this second OPM query will always have an empty result.