-
Notifications
You must be signed in to change notification settings - Fork 11
Output dataset section #246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
a726f76
cbafd15
a514906
92ca9bd
146411a
75d1dfa
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -17,23 +17,22 @@ RDF syntaxes and RDF APIs generally represent [=blank nodes=] with [=blank node | |||||
|
|
||||||
| ## The Generated RDF Triples of a Triples Map | ||||||
|
|
||||||
| This subsection describes the process of <dfn data-lt="generated RDF triples">generating RDF triples</dfn> from a [=Triples Map=]. This process contributes [=RDF triples=] to the [=output dataset=]. Each generated triple MUST be placed into one or more graphs of the output dataset. | ||||||
|
|
||||||
| This subsection describes the normative process by which [=RDF triples=] are generated from a [=Triples Map=]. This process contributes [=RDF triples=] to the [=output dataset=]. Each generated triple MUST be placed into one or more graphs of the output dataset. | ||||||
|
|
||||||
| The generated RDF triples are determined by the following algorithm. [=RML Processors=] MAY employ alternative implementations to compute the generated [=RDF triples=], provided that the resulting output dataset is semantically equivalent to the one obtained by this algorithm. | ||||||
| The [=generated RDF triples=] are determined by the following algorithm. [=RML Processors=] MAY employ alternative implementations to compute the generated [=RDF triples=], provided that the resulting output dataset is semantically equivalent to the one obtained by this algorithm. | ||||||
|
|
||||||
|
|
||||||
| Let: | ||||||
|
|
||||||
| - **sm** be the [=subject map=] of the [=Triples Map=]. | ||||||
| - **records** be the set of logical records obtained by evaluating the [=logical source=] of the [=Triples Map=] using its declared [=reference formulation=]. | ||||||
| - **iterations** be the set of [=logical iterations=] obtained by evaluating the [=logical source=] of the [=Triples Map=] using its declared [=reference formulation=]. | ||||||
| - **classes** be the set of class [=IRIs=] defined in **sm** (via `rml:class`). | ||||||
| - **sgm** be the set of [=graph maps=] attached to **sm**. | ||||||
|
|
||||||
| For each logical record **record** in **records**, apply the following steps: | ||||||
| For each [=logical iteration=] **iteration** in **iterations**, apply the following steps: | ||||||
|
|
||||||
| 1. Let [=subject=] be the [=RDF term=] resulting from applying **sm** to **record**. | ||||||
| 2. Let **subject_graphs** be the set of [=RDF term=] resulting from applying each graph map in **sgm** to **record**. | ||||||
| 1. Let [=subject=] be the [=RDF term=] resulting from applying **sm** to **iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 2. Let **subject_graphs** be the set of [=RDF term=] resulting from applying each graph map in **sgm** to **iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 3. For each class [=IRI=] in **classes**, add a triple to the [=output dataset=] as follows: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| | Component | Value | | ||||||
|
|
@@ -45,10 +44,10 @@ For each logical record **record** in **records**, apply the following steps: | |||||
|
|
||||||
| 4. For each [=predicate-object map=] of the Triples Map, apply the following steps: | ||||||
|
|
||||||
| - Let **predicates** be the set of [=RDF terms=] resulting from applying each predicate map of the predicate-object map to **record**. | ||||||
| - Let **objects** be the set of [=RDF terms=] resulting from applying each object map (excluding [=referencing object maps=]) to **record**. | ||||||
| - Let **predicates** be the set of [=RDF terms=] resulting from applying each predicate map of the predicate-object map to **iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - Let **objects** be the set of [=RDF terms=] resulting from applying each object map (excluding [=referencing object maps=]) to **iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - Let **pogm** be the set of graph maps of the predicate-object map. | ||||||
| - Let **predicate_object_graphs** be the set of RDF terms resulting from applying each graph map in **pogm** to **record**. | ||||||
| - Let **predicate_object_graphs** be the set of RDF terms resulting from applying each graph map in **pogm** to **iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| For each possible combination `<predicate, object>`, where *predicate* ∈ **predicates** and *object* ∈ **objects**, add a triple to the output dataset as follows: | ||||||
|
|
||||||
|
|
@@ -64,15 +63,15 @@ For each [=referencing object map=] of a [=predicate-object map=] in the [=Tripl | |||||
|
|
||||||
| - Let **psm** be the [=subject map=] of the [=parent Triples Map=] referenced by [=referencing object map=]. | ||||||
| - Let **pogm** be the set of [=graph maps=] of the [=predicate-object map=]. | ||||||
| - Let **joined_records** be the result of evaluating the [=join conditions=] defined by the [=referencing object map=], combining records from both the child and parent logical sources. | ||||||
| - Let **joined_iterations** be the result of evaluating the [=join conditions=] defined by the [=referencing object map=], combining iterations from both the child and parent logical sources. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| For each pair `<child_record, parent_record>` in **joined_records**, apply the following steps: | ||||||
| For each pair `<child_iteration, parent_iteration>` in **joined_iterations**, apply the following steps: | ||||||
|
|
||||||
| 1. Let **subject** be the [=RDF terms=] resulting from applying **sm** to **child_record**. | ||||||
| 2. Let **predicates** be the set of [=RDF terms=] resulting from applying each [=predicate map=] of the [=predicate-object map=] to **child_record**. | ||||||
| 3. Let **object** be the [=RDF terms=] resulting from applying **psm** to **parent_record**. | ||||||
| 4. Let **subject_graphs** be the set of RDF terms resulting from applying each graph map in **sgm** to **child_record**. | ||||||
| 5. Let **predicate_object_graphs** be the set of RDF terms resulting from applying each graph map in **pogm** to **child_record**. | ||||||
| 1. Let **subject** be the [=RDF terms=] resulting from applying **sm** to **child_iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 2. Let **predicates** be the set of [=RDF terms=] resulting from applying each [=predicate map=] of the [=predicate-object map=] to **child_iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 3. Let **object** be the [=RDF terms=] resulting from applying **psm** to **parent_iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 4. Let **subject_graphs** be the set of RDF terms resulting from applying each graph map in **sgm** to **child_iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 5. Let **predicate_object_graphs** be the set of RDF terms resulting from applying each graph map in **pogm** to **child_iteration**. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| For each *predicate* in **predicates**, add a triple to the output dataset as follows: | ||||||
|
|
||||||
|
|
@@ -109,19 +108,19 @@ Execute the following steps: | |||||
|
|
||||||
|
|
||||||
| A [=term map=] defines how an [=RDF term=] is generated from the evaluation of a [=logical iteration=] over a [=logical source=]. | ||||||
| The result of evaluating a term map for a given logical record can be one of the following: | ||||||
| The result of evaluating a term map for a given [=logical iteration=] can be one of the following: | ||||||
|
|
||||||
| - **Empty**, if any referenced value of the [=term map=] evaluates to a null, empty or missing value (each data format defines it in [RML-IO-Registry](https://w3id.org/kg-construct/rml-io-registry/)); | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - **An [=RDF term=]**, when evaluation produces a valid [=RDF term=]according to the [=term generation rules=]; | ||||||
| - **An [=RDF term=]**, when evaluation produces a valid [=RDF term=] according to the [=term generation rules=]; | ||||||
| - **A data error**, when a valid RDF term cannot be produced. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The [=generated RDF term=] of a [=term map=] for a given logical record is determined as follows: | ||||||
| The [=generated RDF term=] of a [=term map=] for a given [=logical iteration=] is determined as follows: | ||||||
|
|
||||||
| 1. If the term map is a **constant-valued term map**, then the generated RDF term is the term map’s constant value. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 2. If the term map is a **reference-valued term map**, then the generated RDF term is determined by evaluating the [=reference value=] expression over the logical record and applying the *term generation rules* to the resulting value. | ||||||
| 3. If the term map is a **template-valued term map**, then the generated RDF term is determined by evaluating the [=template value=] against the logical record and applying the *term generation rules* to the resulting value. | ||||||
| 2. If the term map is a **reference-valued term map**, then the generated RDF term is determined by evaluating the [=reference value=] expression over the [=logical iteration=] and applying the [=term generation rules=] to the resulting value. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| 3. If the term map is a **template-valued term map**, then the generated RDF term is determined by evaluating the [=template value=] expression over the [=logical iteration=] and applying the [=term generation rules=] to the resulting value. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| The <dfn>term generation rules</dfn> define how a concrete RDF term is generated from a given value: | ||||||
| The <dfn>term generation rules</dfn> define how a concrete RDF term is generated from each value from the [=expression evaluation result=]: | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| 1. **If the value is null, empty or missing**, then no RDF term is generated. | ||||||
|
|
||||||
|
|
@@ -141,8 +140,8 @@ The <dfn>term generation rules</dfn> define how a concrete RDF term is generated | |||||
| - Return a blank node that is unique in the target graph. | ||||||
|
|
||||||
| 5. **If the term type is `rml:Literal`:** | ||||||
| - If the term map declares a [=language tag=], then return a literal with that language tag and the natural RDF lexical form corresponding to *value*. | ||||||
| - Otherwise, if the term map declares a non-empty [=datatype=] different from the natural RDF datatype corresponding to the value’s implicit datatype, then return an RDF literal with the specified datatype. | ||||||
| - If the term map declares a [=language map=], then evaluate the [=language map=] to obtain a [=language tag=] and return a literal with that [=language tag=] and the natural RDF lexical form corresponding to *value*. | ||||||
| - Otherwise, if the term map declares a [=datatype map=], then evaluate it to obtain a [=datatype IRI=] and return an RDF literal with that [=datatype=] and the natural RDF lexical form corresponding to *value*. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| - Otherwise, return the natural RDF literal corresponding to *value*. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May have to mark class IRIs as definition.