1 / 14

Annotation Examples (12/18/2009)

Annotation Examples (12/18/2009). 0..*. 1..1. Context. Relationship. hasContextRelationship. 0..*. hasContext. 1..1. hasContextObservation. 0..*. 1..1. Observation. Entity. ofEntity. 1..1. 0..*. hasMeasurement. 1..1. 0..*. 0..*. 1..1. Value. Measurement. Characteristic.

vinny
Télécharger la présentation

Annotation Examples (12/18/2009)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Annotation Examples (12/18/2009) 0..* 1..1 Context Relationship hasContextRelationship 0..* hasContext 1..1 hasContextObservation 0..* 1..1 Observation Entity ofEntity 1..1 0..* hasMeasurement 1..1 0..* 0..* 1..1 Value Measurement Characteristic hasValue ofCharacteristic 0..* 1..1 usesStandard Standard OBOE Conceptual Model

  2. Annotation Examples (12/18/2009) <observation label="o1”> <entity id=”TemporalRange"/> <measurement label="m1”> <characteristic id=”Year"/> <standard id=”DateTime"/> </measurement> </observation> <observation label="o2"> <entity id=“Tree"/> <measurement label="m2" precision="0.1"> <characteristic id=”DBH"/> <standard id=”Centimeter"/> </measurement> <measurement label="m3"> <characteristic id=”TaxonomicTypeName"/> <standard id=”ITIS"/> </measurement> <measurement label="m4”> <characteristic id=”EntityName"/> <standard id=“LocalTreeNames"/> </measurement> <context observation="o1"> <relationship id=“Within"/> </context> </observation> <map attribute="yr" measurement="m1"/> <map attribute="diam" measurement="m2" if="diamge 0"/> <map attribute="spec" measurement="m3"/> <map attribute="spp" measurement="m4" value="Picearubens” if="sppeq 'piru'"/> <map attribute="spp" measurement="m4" value="Abiesbalsamea” if="sppeq 'abba'"/> observation "o1” entity ”TemporalRange” measurement "m1” characteristic ”Year” standard ”DateTime” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” characteristic “TaxonomicTypeName” standard “ITIS” measurement "m4” characteristic “EntityName” standard “LocalTreeNames” context observation “o1” relationship “Within” map “yr" to “m1” map “diam” to “m2" if diam > 0 map “spec" to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” Annotation Syntax * Code exists to read/write annotations using this XML format

  3. Annotation Examples (12/18/2009) Dataset Annotation OBOE Concepts Define uses terms from (view def.) Materialize instantiates observation-based representation of Query* OBOE Model (individuals/triples) * Conceptually, we want to query datasets via annotations

  4. Annotation Examples (12/18/2009) Annotation Dataset observation "o1” entity ”TemporalRange” measurement "m1” characteristic ”Year” standard ”DateTime” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” characteristic “TaxonomicTypeName” standard “ITIS” measurement "m4” characteristic “EntityName” standard “LocalTreeNames” context observation “o1” relationship “Within” map “yr" to “m1” map “dbh” to “m2" if dbh > 0 map “spec" to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” hasContext : Obs : Tempral Range : Obs : Tree : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 35.8 Picea. 1 : Year 2007 : DateTime : Centim. : ITIS : LocTN. hasContext : Obs : Tempral Range : Obs : Tree : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 36.2 Picea. 1 : Year 2008 : DateTime : Centim. : ITIS : LocTN. hasContext : Tempral Range : Obs : Tree : Obs * Basic idea: go row-by-row through dataset, generating individuals/triples : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 33.2 Abie. 2 : Year 2008 : DateTime : Centim. : ITIS : LocTN.

  5. Annotation Examples (12/18/2009) Annotation Dataset observation "o1” entity ”TemporalRange” measurement "m1” characteristic ”Year” standard ”DateTime” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” characteristic “TaxonomicTypeName” standard “ITIS” measurement "m4” characteristic “EntityName” standard “LocalTreeNames” context observation “o1” relationship “Within” map “yr" to “m1” map “dbh” to “m2" if dbh > 0 map “spec" to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” hasContext : Obs : Tempral Range : Obs : Tree : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 35.8 Picea. 1 : Year 2007 : DateTime : Centim. : ITIS : LocTN. hasContext : Obs : Tempral Range : Obs : Tree : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 36.2 Picea. 1 : Year 2008 : DateTime : Centim. : ITIS : LocTN. hasContext : Tempral Range : Obs : Tree : Obs • Same Trees!! (both have name = 1) • Same Year and year observation!! : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 33.2 Abie. 2 : Year 2008 : DateTime : Centim. : ITIS : LocTN.

  6. Annotation Examples (12/18/2009) Annotation Dataset observation "o1” distinct yes entity ”TemporalRange” measurement "m1” key yes characteristic ”Year” standard ”DateTime” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” characteristic “TaxonomicTypeName” standard “ITIS” measurement "m4” key yes characteristic “EntityName” standard “LocalTreeNames” context observation “o1” relationship “Within” map “yr" to “m1” map “dbh” to “m2" if dbh > 0 map “spec" to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” hasContext : Obs : Tempral Range : Obs : Tree : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 35.8 Picea. 1 : Year 2007 : DateTime : Centim. : ITIS : LocTN. hasContext : Obs : Meas : Meas : Meas : DBH : TaxN : EntN 36.2 Picea. 1 : Centim. : ITIS : LocTN. Every observation has an implicit “distinct” attribute (set to “no”) … and every measurement has an implicit “key” attribute (set to “no”) : Tempral Range : Obs : Tree : Obs : Meas : Meas : Meas : Meas : DBH : TaxN : EntN 33.2 Abie. 2 : Year 2008 : DateTime : Centim. : ITIS : LocTN.

  7. Annotation Examples (12/18/2009) • Observation measurement keys • Like a primary key constraint • States that observation instances with the same measurement key values are of the same entity instance • Does not imply the same observation instance, unless the observation is declared distinct • All key measurements of an observation together form the primary key • Distinct observations • Only applies if at least one key measurement is defined • States that observation instances with the same entity instance are the same observation instance

  8. Annotation Examples (12/18/2009) Annotation Dataset observation "o1” distinct yes entity ”Plot” measurement "m1” key yes characteristic ”EntityName” standard ”Nominal” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” key yes characteristic “TaxonomicTypeName” standard “ITIS” context observation “o2” relationship “Within” map “plt" to “m2” map “dbh” to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” hasContext : Obs : Plot : Obs : Tree : Meas : Meas : Meas : DBH : TaxN 35.8 Picea. : EntN A : Nominal : Centim. : ITIS hasContext : Obs : Meas : Meas : DBH : TaxN 36.2 Picea. Here we don’t have unique ids for trees But, assume each spp name within a plot uniquely identifies a tree … i.e., at most one tree of a particular type was measured (possibly multiple times) in each plot : Centim. : ITIS : Plot : Obs : Obs : Meas : Meas : Meas : DBH : TaxN 33.2 Picea. : EntN B : Nominal : Centim. : ITIS

  9. Annotation Examples (12/18/2009) Annotation Dataset observation "o1” distinct yes entity ”Plot” measurement "m1” key yes characteristic ”EntityName” standard ”Nominal” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” key yes characteristic “TaxonomicTypeName” standard “ITIS” context observation “o2” relationship “Within” map “plt" to “m2” map “dbh” to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” hasContext : Obs : Plot : Obs : Tree : Meas : Meas : Meas : DBH : TaxN 35.8 Picea. : EntN A : Nominal : Centim. : ITIS hasContext : Obs : Meas : Meas : DBH : TaxN 36.2 Picea. • The Tree entity instance should depend on the plot it is in!!! (context) : Centim. : ITIS : Plot : Obs : Obs : Meas : Meas : Meas : DBH : TaxN 33.2 Picea. : EntN B : Nominal : Centim. : ITIS

  10. Annotation Examples (12/18/2009) Annotation Dataset observation "o1” distinct yes entity ”Plot” measurement "m1” key yes characteristic ”EntityName” standard ”Nominal” observation "o2” entity “Tree” measurement "m2" precision: "0.1” characteristic “DBH” standard ”Centimeter” measurement "m3” key yes characteristic “TaxonomicTypeName” standard “ITIS” context identifying yes observation “o2” relationship “Within” map “plt" to “m2” map “dbh” to “m3” map “spp" to “m4" if spp == “piru” value=“Picearubens” map “spp" to “m4" ifspp == “abba” value=“Abiesbalsamea” hasContext : Obs : Plot : Obs : Tree : Meas : Meas : Meas : DBH : TaxN 35.8 Picea. : EntN A : Nominal : Centim. : ITIS hasContext : Obs : Meas : Meas : DBH : TaxN 36.2 Picea. : Centim. : ITIS Every context relationship has an “identifying” qualifier (set to “no”) Uniqueness within context observation Similar to a weak-entity constraint (ER) : Plot : Tree : Obs : Obs : Meas : Meas : Meas : DBH : TaxN 33.2 Picea. : EntN B : Nominal : Centim. : ITIS

  11. Annotation Examples (12/18/2009) Representing instances … • Annotation(AnnotId, Resource) • Observation(ObsId, AnnotId, EntId) • Measurement(MeasId, ObsId, MeasType, Value) • Context(ObsId1, ObsId2, Rel) • Relationship(RelId, RelType) • Entity(EntId, EntType) This could be queried itself and/or mapped to triples Note that ObsIds are unique across annotations Context.ObsId’s must be for the same annotation * Simple relational schema for OBOE models (individuals/triples)

  12. Annotation Examples (12/18/2009) Representing annotations … • Annotation(AnnotId, Res) • ObservationType(ObsTypeId, AnnotId, EntType, Unique) • MeasType(MeasTypeId, ObsTypeId, CharType, StdType, ProtType, Precision, Value, Key) • ContextType(ObsTypeId1, ObsTypeId2, RelType) • Map(ResAttribute, MeasType, Condition, Value)

  13. Annotation Examples (12/18/2009) Materialization Algorithm • Start with simple case of no key, unique, and identifying constraints • Add these incrementally • Define algorithm so that it works one row at a time • Can we also define the algorithm as a view, to enable querying through views (rewriting)? • This was what the prolog code did …

  14. Annotation Examples (12/18/2009) MapRow(Row : Dom(A1)×Dom(A2)⋯Dom(An), AnnotId : int) letD = [] /* D is a dictionary (ObsTypeId, Keys)→ ObsId */ foreach ⟨Ai, MeasTypedId, Cond, Val⟩ in Map wheresatisfies(Row, Ai, Cond) select ⟨MeasTypeId, ObsTypeId, Std, Key⟩ fromMeasTypeforMeasTypeId letMeasId = CreateNewId() letKeys = GetObsTypeKeys(ObsTypeId, Row, AnnotId) letObsId =CreateObsId(ObsTypeId,Keys, D,Row, AnnotId) D = D ∪ [(ObsTypeId, Keys) → ObsId] letAiVal = GetValue(Row[Ai], Cond, Val) insert ⟨MeasId, ObsId, Std, AiVal⟩ intoMeas endMapRow

More Related