Removed line 8 |
- !!! ToDo |
Removed lines 10-16 |
- # allow an entire ontology to be "labeled" without having to name any of the items (where labels are local names) |
- # describe a MoML embedded and EML embedded version (and mapping to the "canonical" version) |
- # extend the description of types / move to more XML-style syntax |
- # add "superimposed" data types |
- |
- |
- |
Lines 19-132 were replaced by lines 11-799 |
- This document describes an interchange syntax that can be used to express semantic types. We describe __three__ versions of the format: a canonical version, a version for embedding within MoML files, and a version for embedding within EML files. For the case of embeddings, we show how the embedding can be converted to the canonical version. |
- |
- |
- !!! KR/SMS Semantic Types |
- |
- A __semantic type__ classifies and constrains the semantic, as opposed to structural interpretation of a __resource__. Datasets, workflows, actors (and other workflow components), and actor input and output ports are examples of resources that may have semantic types within SEEK. |
- |
- A semantic type is an ontology expression that is "linked" to a resource using a __semantic annotation__. Generally, a semantically typed resource will have an annotation to a single concept. Plus, additional resource "sub-structure" (e.g., particular attributes of a dataset) annotations may exist that further link portions of the resource to parts of the resource's more general concept (examples are given below). |
- |
- The following XML representation shows the general form of the canonical semantic-type interchange syntx (see below [3] for the XML Schema). |
- |
- |
- {{{ |
- <sms:semtype id="id3" xmlns:sms="http://seek.ecoinformatics.org/sms"> |
- |
- <sms:resource name="R" id="id1"/> |
- |
- ... |
- |
- <sms:ontology name="C" id="id3"/> |
- |
- ... |
- |
- <sms:annotation object="R" meaning="C"/> |
- |
- ... |
- |
- |
- </sms:semtype> |
- }}} |
- |
- The element {{semtype}} starts a semantic type definition. A semantic type can have an optional unique identifier, which is given in the {{id}} attribute. Unique identifiers are (preferably) expressed as an LSID, allowing the semantic type to be managed as an LSID data object. Alternatively, if a semantic type is embedded within a document, the semantic-type id can also be expressed as a fragment identifier (for example, when used within EML). |
- |
- As shown above, a semantic type consists of a set of {{resource}} elements, {{ontology}} elements, and {{annotation}} elements. Every semantic type (expressed in the canonical form) is required to have at least one {{resource}}, one {{ontology}}, and one {{annotation}} element. We consider each of these elements, in turn, below. |
- |
- |
- |
- !!! Semantic-Type Resource References |
- |
- |
- Items that are semantically typed are called ''resources''. A {{resource}} element identifies a resource using the resource's unique identifier. A {{resource}} element also assigns a name to the resource, which is used as a surrogate for the referencing the resource in semantic annotations. |
- |
- |
- |
- |
- Resource tags within a semantic-type description provide a mechanism to identify and name those resources that are semantic |
- |
- Labels within a semantic-type description provide a mechanism to identify and name resources and ontology terms. Label names are used within annotations to refer to resources and ontology terms. In a {{Label}} element, the {{name}} attribute is assigned to the resource identified by the {{resource}} attribute. Each {{Label}} element is required to have exactly one {{name}} and {{resource}} attribute. A {{SemanticType}} element must contain at least two {{Label}} elements: one identifying the resource to be annotated and the other identifying an ontology concept. Further, no two {{Label}} elements within a semantic type may have the same {{name}} attribute. |
- |
- Two label definitions are shown below. The first label associates a data set to the name {{crops}} and the second label associates an ontology concept to the name {{Biomass}}. |
- |
- {{{ |
- <sms:Label name="crops" resource="KBS019-003"/> |
- |
- <sms:Label name="Biomass" resource="http://seek.ecoinformatics.org/seek/ontos/DefaultOnto#Biomass"/> |
- }}} |
- |
- |
- |
- |
- !!! Semantic Annotations |
- |
- An annotation asserts that an object of a resource has a particular meaning according to an ontology. The {{object}} and {{meaning}} attributes of an {{Annotation}} element relate the object and ontology expressions, respectively. We provide a uniform __annotation language__ for identifying resource objects and for creating corresponding ontology instances. |
- |
- Some resources, such as data sets and actors with input/output ports, can have complex data structures. For example, a data set typically is structured according to a schema, which specifies among other things a relation name (that is, the name of the table) and names for each attribute of the relation and their data types. Actor ports can also have complex structure, including arbitrarily nested relations. The annotation language facilitates the selection of the various (sub-) objects of structured resources. |
- |
- The annotation language has two forms: an abbreviated syntax, and a more complex, full syntax. |
- |
- !! The Abbreviated Annotation-Language Syntax |
- |
- For expressing annotation objects, the abbreviated syntax permits the following atoms given a resource label {{T}} and attributes {{A1}} to {{An}}. |
- |
- {{{ |
- T |
- |
- T.A1 |
- |
- T.A1.A2. ... .An |
- }}} |
- |
- |
- The first atom {{T}} selects corresponding objects of the resource. For example, if the resource is a data set, {{T}} selects the tuple objects of the resource. If the resource is an actor, {{T}} selects instances of the actor. The second atom {{T.A1}} selects {{A1}} objects contained within {{T}} objects. For {{T}} representing a data set, {{T.A1}} selects the values of attribute {{A1}} for tuples of {{T}}. The last atom selects nested attributes for complex structures, for example, used by actor input/output ports. For instance, if {{T}} represents an input port to some actor[1], {{T.A1.A2}} selects the {{A2}} objects nested within {{A1}} objects contained in {{T}} objects. |
- |
- Atoms can be combined to form expressions. In particular, an expression is either: (1) a single atom or (2) a comma-separated list of atoms of the form {{T.A1}} or {{T.A1.A2. ... An}}. |
- |
- In the abbreviated syntax, ontology expressions only consist of a single concept label {{C}}. |
- |
- To illustrate, consider the following semantic-type description for the {{crops}} data set. |
- |
- {{{ |
- <sms:SemanticType id="mySemType" xmlns:sms="http://seek.ecoinformatics.org/sms" |
- xmlns:ont="http://seek.ecoinformatics.org/seek/ontos/DefaultOnto#"> |
- |
- <sms:Label name="crops" resource="KBS019-003"/> |
- <sms:Label name="Measurement" resource="ont:Measurement"/> |
- <sms:Label name="Biomass" resource="ont:Biomass"/> |
- <sms:Label name="Species" resource="ont:Species"/> |
- <sms:Label name="Year" resource="ont:Year"/> |
- <sms:Label name="Location" resource="ont:Location"/> |
- |
- <sms:Annotation object="crops" meaning="Measurement"/> |
- <sms:Annotation object="crops.bm" meaning="Biomass"/> |
- <sms:Annotation object="crops.spp" meaning="Species"/> |
- <sms:Annotation object="crops.yr" meaning="Year"/> |
- <sms:Annotation object="crops.station" meaning="Location"/> |
- |
- </sms:SemanticType> |
- }}} |
- |
- |
- In this simple example, we (1) associate the label {{crops}} to the data-set resource identifed as {{KBS019-003}}, (2) associate the |
- remaining labels to corresponding ontology concepts (simplifying their identifiers using XML namespaces), (3) state with the first annotation that each {{crops}} tuple is a {{Measurement}} instance, (4) state with the second annotation that each {{bm}} attribute value is a {{Biomass}} instance, (5) state with the third annotation that each {{spp}} attribute value is a {{Species}} instance, and so on. |
- |
- |
+ <html> |
+ <head> |
+ <title>Introduction to Semantic Annotation Templates</title> |
+ <!-- Oldstyle, Modernist, Midnight, Ultramarine, Swiss, Chocolate, |
+ Traditional, Steely --> |
+ <link rel="stylesheet" href="http://www.w3.org/StyleSheets/Core/Swiss" |
+ type="text/css"> |
+ |
+ <STYLE TYPE="text/css"> |
+ <!-- |
+ p { |
+ font-family:Arial; |
+ font-size:12pt; |
+ } |
+ pre { |
+ color:darkblue; |
+ font-size:11pt; |
+ } |
+ code { |
+ color:darkblue; |
+ font-size:12pt; |
+ } |
+ em { |
+ font-style:italic; |
+ } |
+ --> |
+ </STYLE> |
+ |
+ </head> |
+ |
+ <body> |
+ |
+ <h2><em>Technical Note:</em> Introduction to Semantic Annotation |
+ Templates</h2> |
+ |
+ <i> Shawn Bowers, UC Davis </i> <br> |
+ <i> sbowers@ucdavis.edu</i> <br> |
+ <i> August, 2006 </i> <br> |
+ <i> Version 0.0.1 </i> |
+ |
+ <br><p> |
+ |
+ <h2>1. Introduction</h2> |
+ |
+ <p> <em><a href="#annotation">Semantic annotations</a></em> leverage |
+ <em><a href="#ontology">ontologies<a/></em> to describe the conceptual |
+ aspects of structured <em><a href="#resource">resources</a></em>, |
+ e.g., information sources such as data sets and services (workflows, |
+ actors, and web-services). Each resource is assumed to have a well |
+ defined schema that describes the structure of associated data (in the |
+ case of services, e.g., inputs and outputs). In addition to providing |
+ metadata for resources, ontology-based semantic annotations can enable |
+ improved discovery and integration of data. |
+ |
+ <p> Properly describing the semantics of a resource often requires |
+ "fine-grain" annotation, in which different parts of the resource are |
+ annotated with distinct semantic information, possibly including the |
+ assertion of semantic relations among the parts. The challenge is to |
+ provide an appropriate language for accessing, annotating, and |
+ relating portions of resources. This technical note describes basic |
+ aspects of <em><a href="#template">semantic annotation |
+ templates</a></em>, which are designed to support these fine-grain |
+ resource annotations. |
+ |
+ <p> We use an XML-based language for representing semantic |
+ annotations, in which annotations take the form: |
+ |
+ <pre> |
+ <annotation id="..."> |
+ <!-- header --> |
+ <resource label="R" uri="http://resources.org/resource"/> |
+ <ontology label="ont" uri="http://ontologies.org/ont"/> |
+ ... |
+ <!-- annotation assertions --> |
+ ontology instantiation templates |
+ ... |
+ </annotation> |
+ </pre> |
+ |
+ <p> The resources being annotated and the ontologies used for |
+ annotation are assigned labels in the annotation header. For the case |
+ of ontologies, we typically refer to these labels as <em><a |
+ href="#prefix">prefixes</a></em>. Ontologies are assumed to be |
+ expressed using the Web Ontology Language (OWL). Annotation headers |
+ may also include information concerning who the author of the |
+ annotation is, when the annotation was created, who manages the |
+ annotation, and so on. The template information, which is the focus of |
+ this technical note, specifes fine-grain semantic annotations as |
+ mappings from resources to instances of the ontologies listed in the |
+ header. |
+ |
+ <p> This technical note gives an introduction to semantic annotation |
+ templates. <a href="#section2">Section 2</a> provides a short |
+ overview of annotation templates, and <a href="#section3">Section |
+ 3</a> gives a more detailed explanation. A number of the terms |
+ introduced in this technical note are defined in the <a |
+ href="#glossary">glossary</a> at the end of the document. Following |
+ the glossary is a list of <a href="#footnotes">footnotes</a>. Some |
+ familiarity with <a |
+ href="http://www.w3.org/TR/REC-rdf-syntax/">RDF</a>, <a |
+ href="http://www.w3.org/TR/owl-guide/">OWL</a>, and basic <a |
+ href="http://en.wikipedia.org/wiki/First-order_logic">first-order |
+ logic</a> is assumed. |
+ |
+ |
+ <a name="section2"></a> |
+ <h2>2. Overview of Annotation Templates</h2> |
+ |
+ |
+ <p> An annotation template consists of one or more <em><a |
+ href="#pattern">instantiation patterns</a></em> for constructing OWL |
+ individuals from resources. Instantiation patterns are typically based |
+ on (or driven by) resource structure and content. |
+ |
+ <p> The simplest form of an instantiation pattern is: |
+ |
+ <pre> |
+ <individual type="ont:C"/> |
+ </pre> |
+ |
+ <p> This expression creates a single, unique instance of the |
+ <code>C</code> class in the ontology refered to by <code>ont</code> |
+ (assumed to be an ontology prefix defined in the annotation |
+ header). The OWL document that results from running (executing) the |
+ pattern is: |
+ |
+ <pre> |
+ <rdf:RDF xmlns="local-ns" ...> |
+ <owl:Ontology rdf:about=""> |
+ <owl:imports rdf:resource="http://ontologies.org/ont"/> |
+ </owl:Ontology> |
+ |
+ <ont:C rdf:ID="id1"/> |
+ |
+ </rdf:RDF> |
+ </pre> |
+ |
+ <p> In this example, the pattern maps the resources given in the |
+ annotation to a single OWL individual <a href="#1"/>[1]</a>. Note that |
+ the identifier for the instance above is generated automatically as a |
+ result of executing the pattern <a href="#2"/>[2]</a>. |
+ |
+ |
+ <p> A more common use of templates is to relate data values in a |
+ resource to class instances in the ontology. Assume we are annotating |
+ a relational table labeled <code>R</code> with attributes |
+ <code>x</code>, <code>y</code>, and <code>z</code> <a |
+ href="#3"/>[3]</a>. The following pattern, which uses a |
+ <code>foreach</code> attribute, creates an instance of class |
+ <code>C</code> for every unique value of <code>x</code> in the |
+ dataset. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"/> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x value of R create |
+ an instance of C." In this example, the term "R.x" is a <em><a |
+ href="#variable">resource variable</a></em>. Executing this pattern |
+ results in the following document, assuming there are <em>n</em> |
+ unique values of <code>x</code> in <code>R</code> <a |
+ href="#3">[4]</a>. As above, identifiers are generated as a result of |
+ executing the pattern over <code>R</code>. |
+ |
+ <pre> |
+ <rdf:RDF xmlns="local-ns" ...> |
+ <owl:Ontology rdf:about=""> |
+ <owl:imports rdf:resource="http://ontologies.org/ont"/> |
+ </owl:Ontology> |
+ |
+ <ont:C rdf:ID="id-val1"/> |
+ <ont:C rdf:ID="id-val2"/> |
+ ... |
+ <ont:C rdf:ID="id-valn"/> |
+ |
+ </rdf:RDF> |
+ </pre> |
+ |
+ <p> Note that this document has a different namespace than the |
+ corresponding ontology(ies), but imports the ontologies referenced in |
+ the annotation header. Thus, the individuals listed in this document |
+ are treated as distinct from the ontology itself, but OWL-based tools |
+ (such as Protege or a description-logic reasoner) can display and |
+ reason over the individuals as though they were part of the original |
+ ontology. |
+ |
+ <p> We use rules expressed in first-order logic to formalize how |
+ instantiation patterns should be interpreted <a href="#5">[5]</a>. For |
+ example, the first-order logic rule for the above pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p1(x) -> triple(u, rdfs:type, ont:C). |
+ </pre> |
+ |
+ <p> Here, the predicate <code>triple</code> asserts an RDF triple |
+ (with subject, property, value), and <code>id_p1</code> is a (Skolem) |
+ function mapping values into identifiers. The function |
+ <code>id_p1</code> is meant to apply only within this rule, where p1 |
+ stands for "pattern 1." We say in this case that each <code>x</code> |
+ value of <code>R</code> constitues a particular <code>C</code>. |
+ |
+ <p> There are a number of additional features of instantiation |
+ patterns for describing fine-grain semantic annotations. These |
+ features are discussed in more detail in the next section. |
+ |
+ |
+ <a name="section3"></a> |
+ <h2>3. Template Instantiation Patterns</h2> |
+ |
+ <h3>3.1 Individuals</h3> |
+ |
+ <p> <b>Iteration.</b> More than one variable can be given in a |
+ <code>foreach</code> expression. For example, the following pattern |
+ creates an instance of <code>C</code> for every unique pair of |
+ <code>x</code> and <code>y</code> values occurring together in tuples |
+ of <code>R</code>. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x, R.y"/> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x, y (tuple) value |
+ pair of R, create an instance of C." The corresponding first-order |
+ rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p2(x, y) -> triple(u, rdfs:type, ont:C). |
+ </pre> |
+ |
+ <p> In this example, we say that each <code>x,y</code> value |
+ constitutes a particular <code>C</code>. |
+ |
+ <p> Resource labels (such as <code>R</code>) in annotations are used |
+ in a similar way as tuple variables (i.e., "range variables") in |
+ SQL. In particular, a different label can be applied to the same |
+ resource in an annotation header. For example, if <code>R1</code> and |
+ <code>R2</code> are both labels for the <code>Employee</code> |
+ relation, the iteration expression "<code>R1.x, R2.x</code>" is |
+ equivalent to the SQL cross-product projection: |
+ |
+ <pre> |
+ SELECT R1.x, R2.x |
+ FROM Employee R1, Employee R2 |
+ </pre> |
+ |
+ <p> In a similar way, one can view <code>foreach</code> expressions as |
+ group constructors, similar to the <code>GROUP BY</code> clause in |
+ SQL. |
+ |
+ <p> <b>Conditions.</b> Conditions can be added to restrict the |
+ application of a pattern. For example, the following pattern restricts |
+ the creation of <code>C</code> instances based on positive values of |
+ <code>x</code>. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x, R.y" if="R.x>0"/> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x, y (tuple) value |
+ pair of R in which x is greater than 0, create an instance of C." The |
+ corresponding first-order rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), x>0, u=id_p3(x, y) -> triple(u, rdfs:type, ont:C). |
+ </pre> |
+ |
+ <p> In general, conditions are Boolean expressions of the form |
+ <code>term op term</code>, where a <code>term</code> is a constant or |
+ variable (such as <code>R.x</code> or the value <code>5</code>), and |
+ <code>op</code> is a Boolean operator such as <code><</code>, |
+ <code>></code>, <code><=</code>, <code>>=</code>, or |
+ <code>=</code>. |
+ |
+ <p> As with <code>foreach</code> expressions, <code>if</code> |
+ expressions can be given as a conjunction of comma-separated |
+ conditions. Further, condition expressions may contain resource |
+ variables that are outside the condition's <em><a |
+ href="#context">iteration context</a></em>, i.e., the set of variables |
+ (or particular bindings of the variables) used in the condition's |
+ corresponding <code>foreach</code> expression. Note that any given |
+ binding of <code>foreach</code> variables may have many associated |
+ values for an "out-of-context" variable. For these cases, the |
+ <code>if</code> expression is satisfied whenever the condition is true |
+ for any one of these values (i.e., similar to the <code>ANY</code> |
+ keyword in SQL). |
+ |
+ |
+ |
+ <h3>3.2 Object Properties</h3> |
+ |
+ <p> A <code>property</code> expression assigns OWL properties to |
+ corresponding individuals within an instantiation pattern. For |
+ example, the following pattern creates instances of <code>C</code> |
+ containing properties <code>P</code>: |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" valuetype="ont:D"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x value of R, create |
+ an instance of C that has a property P to an instance of D." Executing |
+ this pattern results in the following document, assuming there are |
+ <em>n</em> unique values of <code>x</code> in <code>R</code> <a |
+ href="#6">[6]</a>. |
+ |
+ <pre> |
+ <rdf:RDF xmlns="local-ns" ...> |
+ <owl:Ontology rdf:about=""> |
+ <owl:imports rdf:resource="htt://ontologies.org/ont"/> |
+ </owl:Ontology> |
+ |
+ <ont:C rdf:ID="id-val1"> |
+ <ont:P> |
+ <ont:D/> |
+ </ont:P> |
+ </ont:C> |
+ ... |
+ <ont:C rdf:ID="id-valn"> |
+ <ont:P> |
+ <ont:D/> |
+ </ont:P> |
+ </ont:C> |
+ |
+ </rdf:RDF> |
+ </pre> |
+ |
+ <p> The first-order rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p4(x) -> (Ev) triple(u, rdf:type, ont:C'), |
+ triple(u, ont:P, v), |
+ triple(v, rdf:type, ont:D'). |
+ </pre> |
+ |
+ <p> Note that in this rule, <code>v</code> is existentially |
+ quantified, which we assume is interpreted as an RDF anonymous |
+ identifier. Alternatively, we could have introduced a new Skolem |
+ function over <code>x</code> values (similar to <code>id_p4</code>) |
+ for generating the appropriate <code>D</code> identifiers. |
+ |
+ <p> <b>Nested Properties.</b> Property expressions corresponding to |
+ OWL object properties can be arbitrarily nested within instantiation |
+ patterns. For example, the following pattern further elaborates the |
+ <code>D</code> instances above with <code>Q</code> properties: |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" valuetype="ont:D"> |
+ <property type="ont:Q" valuetype="ont:E"/> |
+ </property> |
+ </individual> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x value of R, create |
+ an instance of C that has a property P to an instance of D such that |
+ the D instance has a property Q to an instance of E." The first-order |
+ rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p5(x) -> (Evw) triple(u, rdf:type, ont:C), |
+ triple(u, ont:P, v), |
+ triple(v, rdf:type, ont:D) |
+ triple(v, ont:Q, w), |
+ triple(w, rdf:type, ont:E). |
+ </pre> |
+ |
+ <p> <b>Multiple Properties.</b> Individuals can be assigned more than |
+ one property. The following pattern assigns two properties |
+ <code>P1</code> and <code>P2</code>. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P1" valuetype="ont:D1"/> |
+ <property type="ont:P2" valuetype="ont:D2"/> |
+ </individual> |
+ </pre> |
+ |
+ |
+ <p> This pattern can be read as "For each unique x value of R, create |
+ an instance of C that has two properties, P1 to an instance of D1, and |
+ P2 to an instance of D2." The first-order rule for this pattern is: |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p6(x) -> (Evw) triple(u, rdf:type, ont:C), |
+ triple(u, ont:P1, v), |
+ triple(v, rdf:type, ont:D1) |
+ triple(u, ont:P2, w), |
+ triple(w, rdf:type, ont:D2). |
+ </pre> |
+ |
+ |
+ <p> The general form of a pattern consists of an |
+ <code>individual</code> expression, followed by any number of |
+ (possibly nested) <code>property</code> expressions: |
+ |
+ <pre> |
+ <individual type="..." foreach="..." if="..." ...> |
+ <property type="..." ...> |
+ ... nested property expressions ... |
+ </property> |
+ ... additional property expressions ... |
+ </individual> |
+ </pre> |
+ |
+ <p> The additional attributes of <code>individual</code> and |
+ <code>property</code> statements are described further below (as well |
+ as in the footnotes). |
+ |
+ <h3>3.3 Datatype Properties</h3> |
+ |
+ <p> The examples so far assume the use of OWL object properties, whose |
+ ranges (i.e., what the properties "point" to) are individuals. Here we |
+ describe support for annotating to datatype properties, in which |
+ ranges are assumed to be atomic data values (e.g., strings, integers, |
+ or doubles). |
+ |
+ <p> Datatype <code>property</code> statements use the attribute |
+ <code>value</code> instead of <code>valuetype</code>. In general, a |
+ <code>value</code> attribute is used to assign a specific data value |
+ or individual identifier to a property, whereas a |
+ <code>valuetype</code> attribute is used to give the type of the |
+ individual linked to the property. Thus, <code>valuetype</code> |
+ attributes are used exclusively for object properties, and |
+ <code>value</code> attributes can be used for assigning both object |
+ and datatype properties. <code>Property</code> statements that use a |
+ <code>value</code> attribute (for either an object or datatype |
+ property) cannot be further nested. |
+ |
+ <p> <b>Constants.</b> One use of a datatype property annotation is for |
+ assigning constant values to each corresponding individual generated |
+ by a pattern. For example, the following pattern assigns a |
+ property <code>P</code> with the value <code>5</code> to each |
+ generated <code>C</code> instance. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" value="5"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x value of R, create |
+ an instance of C that has a property P with the value 5." The |
+ corresponding first-order rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p7(x) -> triple(u, rdf:type, ont:C), |
+ triple(u, ont:P, 5). |
+ </pre> |
+ |
+ <p> <b>Resource Values.</b> Another common use of datatype property |
+ annotations is for capturing associated resource values. For example, |
+ the following pattern assigns each instance a property <code>P</code> |
+ whose value is taken from the resource variable <code>x</code>. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" value="$R.x"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x value of R, create |
+ an instance of C that has a property P with the value x." Note that |
+ the symbol '$' is used to distinguish references to resource values |
+ from constants. The corresponding first-order rule for this pattern |
+ is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p8(x) -> triple(u, rdf:type, ont:C), |
+ triple(u, ont:P, x). |
+ </pre> |
+ |
+ <p> Resource variables can be used outside of the current iteration |
+ context (i.e., the enclosing <code>foreach</code> expression). In this |
+ case, the current iteration context is used to determine the |
+ particular resource values that are accessed. Note that it is possible |
+ for multiple properties to be created when the resource variables are |
+ outside of the iteration context. For example, the following pattern |
+ assigns to each instance associated with <code>x</code>, a property |
+ <code>P</code> for each of <code>x</code>'s corresponding |
+ <code>y</code> values. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" value="$R.y"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x value of R, create |
+ an instance of C that has a property P with value y, for each unique y |
+ value of x" <a href="#7">[7]</a>. The corresponding first-order rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p9(x) -> triple(u, rdf:type, ont:C), |
+ triple(u, ont:P, y). |
+ </pre> |
+ |
+ <p> In this case, if a particular <code>x</code> value has multiple |
+ <code>y</code> values, each such <code>y</code> value will result in a |
+ <code>P</code> property. Note that if <code>x</code> and |
+ <code>y</code> were not related, (e.g., if the expressions were |
+ <code>R1.x</code> and <code>R2.y</code>, respectively), the result |
+ would be a cross-product in which every <code>x</code> value would be |
+ <code>P</code>-related to every <code>y</code> value. For example, the |
+ following pattern: |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R1.x"> |
+ <property type="ont:P" value="$R2.y"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> corresponds to the following first-order rule, assuming |
+ <code>R1</code> and <code>R2</code> both represent relation |
+ <code>R</code>: |
+ |
+ <pre> |
+ (Axvzwyt) R(x, v, z), R(w, y, t), u=id_p10(x) -> triple(u, rdf:type, ont:C), |
+ triple(u, ont:P, y). |
+ </pre> |
+ |
+ |
+ <p> In an instantiation pattern, <code>value</code> expressions must |
+ evaluate to a single value. Although not considered here, it may be |
+ useful to define functions for use in <code>value</code> expressions, |
+ such as concatenation, addition, and so on. |
+ |
+ <p> <b>Conditional Properties.</b> A <code>property</code> statement |
+ can be conditionally applied using an <code>if</code> expression. In |
+ particular, the conditions of the <code>if</code> expression must hold |
+ for the <code>property</code> to be added to the corresponding |
+ individual. For example, the following pattern only adds |
+ <code>P</code> to the individual if <code>x</code> is a positive |
+ value. |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" value="$R.x" if="R.x>0"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> This patterns must be represented using two first-order rules: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z), u=id_p11(x) -> triple(u, rdf:type, ont:C). |
+ |
+ (Axyz) R(x, y, z), x>0, u=id_p11(x) -> triple(u, ont:P, x). |
+ </pre> |
+ |
+ <p> Thus, the condition on the property does not affect whether the |
+ individual is created, only whether the individual has a |
+ <code>P</code> property. Using property conditions, it is possible to |
+ define simple mappings from resource values to standard property |
+ values, e.g., for converting coded values in a dataset to their |
+ corresponding "full" names. |
+ |
+ <p> Like with conditions on <code>individual</code> statements, no |
+ restrictions are placed on the variables that can be used in |
+ <code>property</code> statement conditions. Variables used in |
+ property conditions that are outside the iteration context of the |
+ property, with the exception of variables within <code>value</code> |
+ expressions <a href="#8">[8]</a>, require only one associated value to |
+ satisfy the condition for the property to be applied (again, similar |
+ to the <code>ANY</code> keyword in SQL). |
+ |
+ |
+ <h3>3.3 Complex Instantiation Patterns</h3> |
+ |
+ <p> We have described two mechanisms to link individuals to object |
+ properties: through <code>valuetype</code> expressions that generate |
+ new, anonymous individuals "in place"; and through <code>value</code> |
+ expressions containing pre-defined individual identifiers. Here, we |
+ introduce the use of <em><a href="#label">pattern labels</a></em> and |
+ <em><a href="#reference">pattern references</a></em> to additionally |
+ allow object properties to link to individuals created in other |
+ instantiation patterns. |
+ |
+ <p> <b>Pattern Labels.</b> Each individual instantiation pattern can |
+ be assigned a unique label. For example, the following pattern is |
+ assigned the label 'o1'. |
+ |
+ <pre> |
+ <individual label="o1" type="ont:C" foreach="R.x"/> |
+ </pre> |
+ |
+ <p> The first-order rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z) u=o1(x) -> triple(u, rdf:type, ont:C). |
+ </pre> |
+ |
+ <p> The use of labels in this way does not change the interpretation |
+ of the pattern, thus, the first-order rule associated with this |
+ pattern is the same as above (p1). However, for convenience, we use |
+ the label name as the Skolem function here. |
+ |
+ <p> <b>Referencing Patterns.</b> Properties can reference patterns |
+ using pattern labels in <code>value</code> expressions <a |
+ href="#9">[9]</a>. To distinguish pattern references from constants |
+ and resource variables, pattern references are prefixed with an '@' |
+ sign. For example, the following pattern contains a reference to the |
+ pattern labeled 'o1' above. |
+ |
+ <pre> |
+ <individual label="o2" type="ont:D" foreach="R.x, R.y"> |
+ <property type="ont:P" value="@o1"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> This pattern can be read as "For each unique x, y (tuple) value |
+ pair in R, create an instance of D that has a property P to the |
+ corresponding instance of C." The first-order rule for this pattern |
+ is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z) u=o1(x), v=o2(x, y) -> triple(v, rdf:type, ont:D), |
+ triple(v, ont:P, u). |
+ </pre> |
+ |
+ <p> As with resource variables, pattern references are interpreted |
+ with respect to the current iteration context. In this example, |
+ because <code>P</code>'s iteration context is "R.x, R.y" and |
+ <code>o1</code>'s iteration context is "R.x" (i.e., <code>o1</code>'s |
+ <code>foreach</code> expression is contained in <code>P</code>'s |
+ enclosing <code>foreach</code> expression), the added <code>P</code> |
+ property is assigned the individual corresponding to the current |
+ <code>x</code> value of the iteration context. |
+ |
+ <p> The iteration context of a property is not required to be a |
+ superset of its referenced pattern. For example, in the following |
+ pattern: |
+ |
+ <pre> |
+ <individual label="o3" type="ont:D" foreach="R.y, R.z"> |
+ <property type="ont:P" value="@o1"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> each unique <code>y</code>, <code>z</code> pair for <code>R</code> |
+ will be assigned a property <code>P</code> for every corresponding |
+ <code>x</code> value of the pair. Note that in this example, any given |
+ <code>y</code>, <code>z</code> pair may have multiple associated |
+ <code>x</code> values. |
+ |
+ <p> Also, the iteration context of a property only applies to the |
+ referenced pattern, and does <em>not</em> apply to additionally nested |
+ pattern references. For example, consider the following two patterns. |
+ |
+ <pre> |
+ <individual label="o5" type="ont:E" foreach="R.x, R.z"> |
+ <property type="ont:Q" value="@o4"/> |
+ </individual> |
+ |
+ <individual label="o4" type="ont:D" foreach="R.y"> |
+ <property type="ont:P" value="@o1"/> |
+ </individual> |
+ |
+ </pre> |
+ |
+ <p> The corresponding first-order rules for these patterns are: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z) u=o1(x), v=o4(y) -> triple(v, rdf:type, ont:D), |
+ triple(v, ont:P, u). |
+ |
+ (Axyz) R(x, y, z) v=o4(y), w=o5(x, z) -> triple(w, rdf:type, ont:E), |
+ triple(w, ont:Q, v). |
+ </pre> |
+ |
+ <p> Thus, although property values containing pattern references are |
+ assigned values from within the context of the enclosing |
+ <code>foreach</code> expression, each distinct pattern is still |
+ executed within its own context. To illustrate, let <code>R</code> be |
+ defined as follows. |
+ |
+ <pre> |
+ x y z |
+ --- --- --- |
+ 1 4 8 |
+ 2 4 9 |
+ </pre> |
+ |
+ <p> The triples created from pattern <code>o1</code> are: |
+ |
+ <pre> |
+ triple(o1(1), rdf:type, ont:C) |
+ triple(o1(2), rdf:type, ont:C) |
+ </pre> |
+ |
+ <p> The triples created from pattern <code>o4</code> are: |
+ |
+ <pre> |
+ triple(o4(4), rdf:type, ont:D) |
+ triple(o4(4), ont:P, o1(1)) |
+ triple(o4(4), ont:P, o1(2)) |
+ </pre> |
+ |
+ <p> And the triples created from pattern <code>o5</code> are: |
+ |
+ <pre> |
+ triple(o5(1, 8), rdf:type, ont:E) |
+ triple(o5(1, 8), ont:Q, o4(4)) |
+ triple(o5(2, 9), rdf:type, ont:E) |
+ triple(o5(2, 9), ont:Q, o4(4)) |
+ </pre> |
+ |
+ <p> Notice that both individuals of pattern <code>o5</code> are |
+ <code>Q</code>-related to the same <code>o4</code> |
+ individual. Similarly, this <code>o4</code> individual is |
+ <code>P</code>-related to both individuals of <code>o1</code>, |
+ corresponding to <em>both</em> <code>x</code> values of |
+ <code>R</code>, and thus going "out of context" for pattern |
+ <code>o5</code>. |
+ |
+ <p> To use the iteration context of <code>o5</code> for |
+ <code>o1</code> while still generating intermediate instances of |
+ <code>D</code>, we can use the following pattern, combining |
+ <code>o5</code> and <code>o4</code>: |
+ |
+ <pre> |
+ <individual label="o6" type="ont:E" foreach="R.x, R.z"> |
+ <property type="ont:Q" valuetype="ont:D"> |
+ <property type="ont:P" value="@o1"/> |
+ </property> |
+ </individual> |
+ </pre> |
+ |
+ <p> The corresponding first-order rule for this pattern is: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z) u=o1(x), w=o6(x, z) -> (Ev) triple(w, rdf:type, ont:E), |
+ triple(w, ont:Q, v), |
+ triple(v, rdf:type, ont:D), |
+ triple(v, ont:P, u). |
+ </pre> |
+ |
+ <p> Note that in this case, however, we generate only one |
+ <code>D</code> instance per <code>x</code>, <code>z</code> |
+ pair,(instead of one for every value of <code>y</code>. Also, with |
+ pattern <code>o6</code>, we can no longer reference the <code>D</code> |
+ instances in other patterns. |
+ |
+ <p> <b>Property Iteration and Labels</b>. It is also possible to apply |
+ <code>foreach</code> expressions to <code>property</code> statements, |
+ e.g., allowing one to additionally specify how intermediate |
+ individuals, for cases like <code>o6</code> above, should be |
+ constructed. For example, the following pattern: |
+ |
+ <pre> |
+ <individual label="o7" type="ont:E" foreach="R.x, R.z"> |
+ <property type="ont:Q" valuetype="ont:D" foreach="R.y" label="o8"> |
+ <property type="ont:P" value="@o1"/> |
+ </property> |
+ </individual> |
+ </pre> |
+ |
+ <p> results in the first-order rule: |
+ |
+ <pre> |
+ (Axyz) R(x, y, z) u=o1(x), w=o7(x, z), v=o8(x, y, z) -> |
+ triple(w, rdf:type, ont:E), |
+ triple(w, ont:Q, v), |
+ triple(v, rdf:type, ont:D), |
+ triple(v, ont:P, u). |
+ </pre> |
+ |
+ <p> As shown, labels may also be applied to intermediate individuals |
+ (via their corresponding <code>property</code> statements), allowing |
+ these individuals to be referenced from within other patterns. In this |
+ case, the iteration context of the nested pattern is the union of its |
+ <code>foreach</code> expression with each of its ancestor's |
+ <code>foreach</code> expressions. |
+ |
+ |
+ |
+ <a name="glossary"></a> <h2>Glossary</h2> |
+ |
+ <p> <b><a name="annotation">Semantic Annotation<a/>:</b> A mapping |
+ from a resource to an instance(s) of an ontology(ies). Semantic |
+ annotations in our framework have identifiers as well as associated |
+ metadata (who created the annotation, and so on). |
+ |
+ <p> <b><a name="resource">Resource</a>:</b> A structured information |
+ source with a defined schema. Can be a dataset or a service, such as |
+ a workflow, actor, or web-service. |
+ |
+ <p> <b><a name="ontology">Ontology</a>:</b> Here, by ontology we mean |
+ an OWL-based representation of a set of concepts, properties, and |
+ constraints (axioms). |
Lines 134-196 were replaced by lines 801-802 |
- |
- !! Semantic-Type Ontology Definitions |
- |
- For convenience, we permit ontology concept definitions to be directly included within a semantic type using the {{OntologyDefinitions}} element. The purpose of this features is to allow specialized concept definitions to more accurately annotate objects, without having to go through the process of creating a new ontology, or editing an existing one. These concept definitions are expressed using OWL[2]. |
- |
- To illustrate, part of the previous semantic type is shown below with an embedded concept. (Note that to simplify the definition below we take liberty with the use of namespaces in OWL). This embedded concept definition states that {{MyMeasurement}} is both a {{Measurement}} and a {{SubjectiveObservation}}. |
- |
- |
- {{{ |
- <sms:SemanticType id="mySemType" xmlns:sms="http://seek.ecoinformatics.org/sms" |
- xmlns:ont="http://seek.ecoinformatics.org/seek/ontos/DefaultOnto#" |
- xmlns:owl="http://www.w3.org/2002/07/owl#" |
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
- xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"> |
- |
- <sms:Label name="crops" resource="KBS019-003"/> |
- |
- <sms:Label name="Measurement" resource="MyMeasurement"/> |
- |
- <sms:Annotation object="crops" meaning="MyMeasurement"/> |
- |
- <sms:OntologyDefinitions> |
- |
- <owl:Class rdf:ID="MyMeasurement"> |
- <owl:equivalentClass> |
- <owl:intersectionOf rdf:parseType="Collection"> |
- <owl:Class rdf:resource="ont:Measurement"/> |
- <owl:Class rdf:resource="ont:SubjectiveObservation"/> |
- </owl:intersectionOf> |
- </owl:equivalentClass> |
- </sms:Resource> |
- |
- </sms:OntologyDefinitions> |
- |
- </sms:SemanticType> |
- }}} |
- |
- |
- |
- !! The Full Annotation-Language Syntax |
- |
- The full annotation-language syntax provides more access to various parts of a complex structure and the ability to assign those parts to more complex ontology instances. To support a wide variety of structural models -- the primary ones including relational, XML, and the Ptolemy type system -- we consider a generic model consisting of nested-relational-style constructs. In addition, we permit multi-valued attributes in which an attribute can have an associated collection of values. |
- |
- The abbreviated annotation-language syntax is shorthand for a subset of the full syntax (we give more details of the relationship below). In the full syntax, resource expressions consist of lists of atoms (separated by commas) taking one of the following forms. |
- |
- {{{ |
- x:T |
- |
- x[A1=y] |
- }}} |
- |
- Here, symbols {{x}} and {{y}} denote either constants, variables, or skolem terms. Variables are prefixed with a '$' sign. Constants that contain spaces must be delimited using single quotes. A skolem term takes the form {{f(z1, ..., zn)}} for constants and/or variables {{z1}} to {{zn}} and {{n > 0}}. |
- |
- For {{x}} and {{y}} constants, the atom {{x:T}} is true if {{x}} is a {{T}} object, and the atom {{x[[A1=y]}} is true if {{x}} is an object that has {{y}} as one of its {{A1}} attribute values. |
- |
- Complex expressions are constructed as follows: each atom is an expression; expressions {{x:T}} and {{x[[A1=y]}} can be composed to |
- form the expression {{x:T[[A1=y]}}; expressions {{x[[A1=y]}} and {{x[[A2=z]}} can be composed to form the expression {{x[[A1=y, A2=z]}}; expressions {{y:T1[[A2=z]}} and {{x:T[[A1=y]}} can be composed to form the expression {{x:T[[A1=y:T1[[A2=z]]}}; and so on. |
- |
- This same syntax is used to describe ontology expressions, where {{T}} can be replaced with a concept label {{C}} and {{A1}} represents a property label. For {{x}} and {{y}} constants, the atom {{x:C}} is true if {{x}} is an instance of concept {{C}}, and the atom {{x[[A1=y]}} is true if {{x}} has {{y}} as one of its {{A1}} property values. |
- |
- The meaning of an annotation can be interpreted as follows. Assume we have an annotation {{A}} such that {{R}} is the expression selecting resource objects (the expression in the {{object}} attribute) and {{O}} is the expression creating ontology instances (the expression in the {{meaning}} attribute). The annotation is a constraint that says whenever {{R}} is true, {{O}} is true. Let {{Rvar}} be the set of variables in {{R}} and {{Ovar}} be the set of variables in {{O}} that are not in {{R}}. The annotation {{A}} asserts {{(forall Rvar) R -> (exists Ovar) O}}. That is, for each variable assignment making {{R}} true there are variable assignments for {{Ovar}} that make {{O}} true. In this way, an annotation can also be viewed as a mapping from {{R}} to {{O}}. |
- |
- Consider the {{crops}} data set again. The following semantic type provides a more detailed description of {{crops}} using the full annotation syntax. |
+ <p> <b><a name="template">Semantic Annotation Template</a>:</b> A set |
+ of instantiation patterns within a particular semantic annotation. |
Lines 198-305 were replaced by lines 804-885 |
- {{{ |
- <sms:SemanticType id="mySemType" xmlns:sms="http://seek.ecoinformatics.org/sms" |
- xmlns:ont="http://seek.ecoinformatics.org/seek/ontos/DefaultOnto#"> |
- |
- <sms:Label name="crops" resource="KBS019-003"/> |
- <sms:Label name="Measurement" resource="ont:Measurement"/> |
- <sms:Label name="Biomass" resource="ont:Biomass"/> |
- <sms:Label name="Species" resource="ont:Species"/> |
- <sms:Label name="Year" resource="ont:Year"/> |
- <sms:Label name="Location" resource="ont:Location"/> |
- <sms:Label name="measProp" resource="ont:measurementProperty"/> |
- <sms:Label name="measItem" resource="ont:measurementItem"/> |
- <sms:Label name="measContext" resource="ont:measurementContext"/> |
- |
- <sms:Annotation object="$x:crops" meaning="$x:Measurement"/> |
- <sms:Annotation object="$x:crops[bm=$y]" meaning="$x[measProp=$y:Biomass]"/> |
- <sms:Annotation object="$x:crops[spp=$y]" meaning="$x[measItem=$y:Species]"/> |
- <sms:Annotation object="$x:crops[yr=$y]" meaning="$x[measContext=$y:Year]"/> |
- <sms:Annotation object="$x:crops[station=$y]" meaning="$x[measContext=$y:Location]"/> |
- |
- </sms:SemanticType> |
- }}} |
- |
- The advantage of using the full syntax here is that we can properly relate attributes of a given tuple according to the ontology. For example, we are able to say that for a given tuple, the {{bm}} value represents the biomass of the species represented by the corresponding {{spp}} value. |
- |
- Another advantage of using the full syntax is that it allows annotations of resources that mix schema and data. Consider the following semantic-type description for a data set with attributes {{station}}, {{MEDSA}}, and {{GLYMX}}, where {{MEDSA}} and {{GLYMX}} are species codes containing biomass values. |
- |
- |
- {{{ |
- <sms:SemanticType id="mySemType" xmlns:sms="http://seek.ecoinformatics.org/sms" |
- xmlns:ont="http://seek.ecoinformatics.org/seek/ontos/DefaultOnto#"> |
- |
- <sms:Label name="ds" resource="..."/> |
- <sms:Label name="Measurement" resource="ont:Measurement"/> |
- <sms:Label name="Biomass" resource="ont:Biomass"/> |
- <sms:Label name="Species" resource="ont:Species"/> |
- <sms:Label name="Location" resource="ont:Location"/> |
- <sms:Label name="measProp" resource="ont:measurementProperty"/> |
- <sms:Label name="measItem" resource="ont:measurementItem"/> |
- <sms:Label name="measContext" resource="ont:measurementContext"/> |
- |
- <sms:Annotation object="$x:ds[site=$y, MEDSA=$z]" |
- meaning="f1($x):Measurement[measContext=$y:Location, measProp=$z:Biomass, measItem=MEDSA:Species]"/> |
- |
- <sms:Annotation object="$x:ds[site=$y, GLYMX=$z]" |
- meaning="f2($x):Measurement[measContext=$y:Location, measProp=$z:Biomass, measItem=GLYMX:Species]"/> |
- |
- |
- </sms:SemanticType> |
- }}} |
- |
- Here, each tuple of the dataset represents two distinct measurements of biomass: one for the MEDSA species and the other for the GLYMX species. The skolem terms {{f1($x)}} and {{f2($x)}} distinguish these two observations given a tuple {{$x}}, that is, the skolem terms can be seen as creating two objects from the original object {{$x}}. |
- |
- |
- The abbreviated syntax has a natural translation to the full syntax. For expressions {{T}} in the abbreviated syntax, the following two annotations are equivalent. |
- |
- {{{ |
- <sms:Annotation object="T" meaning="C"/> |
- |
- <sms:Annotation object="$x:T" meaning="$x:C"/> |
- }}} |
- |
- For expressions {{T.A1}} in the abbreviated syntax, the following two annotations are equivalent. |
- |
- {{{ |
- <sms:Annotation object="T.A1" meaning="C"/> |
- |
- <sms:Annotation object="$x:T[A1=$y]" meaning="$y:C"/> |
- }}} |
- |
- For expressions {{T.A1.A2. ... .An}} in the abbreviated syntax, the following two annotations are equivalent. |
- |
- {{{ |
- <sms:Annotation object="T.A1.A2. ... .An" meaning="C"/> |
- |
- <sms:Annotation object="$x:T[A1=$y1], $y1[A2=$y2] ... $yn-1[An=$yn]" meaning="$yn:C"/> |
- }}} |
- |
- And finally, for expressions {{T.A1, T.A2, ..., T.Am}} in the abbreviated syntax, the following two annotations are equivalent, where {{f}} is a unique skolem symbol. |
- |
- {{{ |
- <sms:Annotation object="T.A1, T.A2, ..., T.Am" meaning="C"/> |
- |
- <sms:Annotation object="$x:T, $x[A1=$y1], $x[A2=$y2], ..., $x[Am=$ym]" meaning="f($x, $y1, $y2, ..., $ym):C"/> |
- }}} |
- |
- |
- The original semantic type for the {{crops}} data set expressed in the abbreviated syntax is translated below into an equivalent semantic type in the full syntax. Compared with the {{crops}} semantic type given above in the full syntax (relating tuple values via the ontology), the semantic type below is "less precise." However, in many cases where the semantic type is fairly simple, the abbreviated annotation syntax will be sufficient to describe the desired semantics. |
- |
- {{{ |
- <sms:SemanticType id="mySemType" xmlns:sms="http://seek.ecoinformatics.org/sms" |
- xmlns:ont="http://seek.ecoinformatics.org/seek/ontos/DefaultOnto#"> |
- |
- <sms:Label name="crops" resource="KBS019-003"/> |
- <sms:Label name="Measurement" resource="ont:Measurement"/> |
- <sms:Label name="Biomass" resource="ont:Biomass"/> |
- <sms:Label name="Species" resource="ont:Species"/> |
- <sms:Label name="Year" resource="ont:Year"/> |
- <sms:Label name="Location" resource="ont:Location"/> |
- |
- <sms:Annotation object="$x:crops" meaning="$x:Measurement"/> |
- <sms:Annotation object="$x:crops[bm=$y]" meaning="$y:Biomass"/> |
- <sms:Annotation object="$x:crops[spp=$y]" meaning="$y:Species"/> |
- <sms:Annotation object="$x:crops[yr=$y]" meaning="$y:Year"/> |
- <sms:Annotation object="$x:crops[station=$y]" meaning="$y:Location"/> |
- |
- </sms:SemanticType> |
- }}} |
+ <p> <b><a name="pattern">Instantiation Pattern</a>:</b> An XML-based |
+ specification of a mapping from portions of a resource to instances |
+ of an ontology. |
+ |
+ <p> <b><a name="prefix">Prefix Label</a>:</b> A label used to |
+ represent an ontology location. |
+ |
+ <p> <b><a name="variable">Resource Variable</a>:</b> An attribute of a |
+ resource, which in an annotation template takes the form 'R.x' (or |
+ more generally a path expression 'R.x1.x2...xn' for nested |
+ relations). |
+ |
+ <p> <b><a name="context">Iteration Context</a>:</b> The set of |
+ resource variables, or current variable bindings (as the pattern is |
+ being executed), for a property or condition in an instantiation |
+ pattern. The iteration context is determined by the enclosing |
+ <code>foreach</code> expression of the item in question. |
+ |
+ <p> <b><a name="label">Pattern Label</a>:</b> A label assigned to a |
+ template instantiation pattern. |
+ |
+ <p> <b><a name="reference">Pattern Reference</a>:</b> A reference to a |
+ template instantiation pattern (using a pattern label) from within |
+ an object property in another (or possibly the same) pattern. |
+ |
+ |
+ |
+ <a name="footnotes"></a> <h2>Footnotes</h2> |
+ |
+ <p> <a name="1">[1]</a> In OWL, instances of classes are called |
+ 'individuals.' |
+ |
+ <p> <a name="2">[2]</a> Alternatively, we could use anonymous |
+ identifiers for generated OWL individuals. However, using explicit |
+ as opposed to anonymous identifiers has a number of advantages, |
+ e.g., identifiers can be used for "provenance" (that is, using |
+ conventions for identifier names one could go from the created OWL |
+ individuals back to the resource item used to generte the resource), |
+ and also make it easier to formalize the interpretation of patterns |
+ in first-order logic. |
+ |
+ <p> <a name="2">[3]</a> The examples of resources in this document are |
+ assumed to be relational data sets. However, the approach described |
+ here can be used with a variety of resource structures, including |
+ nested relational data (e.g., like in XML). |
+ |
+ <p> <a name="3">[4]</a> By default, variables in <code>foreach</code> |
+ expressions that are null in the resource do not generate |
+ corresponding ontology class instances. |
+ |
+ <p> <a name="5">[5]</a> We use the notation <code>(Axy)</code> for |
+ universal quantification over variables <code>x</code> and |
+ <code>y</code>; <code>(Exy)</code> for existential quantification |
+ over variables <code>x</code> and <code>y</code>; and |
+ <code>-></code> for implication. |
+ |
+ <p> <a name="6">[6]</a> Note that the use of <code>property</code> |
+ expressions in this way is useful for cases in which the property is |
+ either (i) not defined (or optional) in the ontology for the |
+ associated class, or (ii) is a required property, but the |
+ <code>valuetype</code> expression gives a subclass of the property's |
+ defined range. |
+ |
+ <p> <a name="7">[7]</a> Implicitly, this pattern is equivalent to the pattern: |
+ |
+ <pre> |
+ <individual type="ont:C" foreach="R.x"> |
+ <property type="ont:P" value="$R.y" foreach="R.y"/> |
+ </individual> |
+ </pre> |
+ |
+ <p> That is, for each unique <code>x</code>, <code>y</code> pair, |
+ assign a <code>P</code> property with value <code>y</code> to the |
+ corresponding <code>C</code> instance. Additional uses of |
+ <code>foreach</code> attributes on properties are discussed later. |
+ |
+ <p> <a name="8">[8]</a> Because the variable used within a |
+ <code>value</code> attribute is implicitly carried over to the |
+ <code>property</code> statement's <code>foreach</code> expression |
+ (see <a href="#7">[7]</a>), these resource variables are considered |
+ to be part of the <code>property</code> statement's iteration |
+ context. |
At line 306 added 2 lines. |
+ <p> <a name="9">[9]</a> Pattern references can be cyclic, i.e., a |
+ property within a pattern p can contain a property that refers to p. |
Line 309 was replaced by lines 891-892 |
- ---- |
+ </body> |
+ </html> |
Removed lines 311-317 |
- [#1] We note that actor ports may not always be represented as an |
- identifiable resource, and instead may be modeled as components of an |
- actor. For example, consider an actor ''A'' having two ports ''P1'' |
- and ''P2''. For the case where ''P1'' and ''P2'' are not separate |
- resources, we can define the structural type of ''A'' as having two |
- attributes {{P1}} and {{P2}} where {{A.P1}} denotes port ''P1'' and |
- {{A.P2}} denotes port ''P2''. |
Removed line 319 |
- [#2] Perhaps originally converted from a Sparrow expression. |
Removed lines 321-324 |
- [#3] The semantic-type interchange-syntax XML Schema is: |
- {{{ |
- ... |
- }}} |