Skip to content

Commit

Permalink
updated based on #2, #3, #4, #5, #7, #8, #9, #10, fixes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
bjdmeest committed Mar 26, 2021
1 parent c44ff3a commit 0bf4ec0
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 12 deletions.
11 changes: 10 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@
<script class="remove">
var respecConfig = {
// check https://respec.org/docs/ for the meaning of these keys
// authors: [],
authors: [
{
name: "Pano Maria"
},
{
name: "David Chavez"
},
],
edDraftURI: "https://kg-construct.github.io/rml-fno-spec/",
editors: [
{
Expand Down Expand Up @@ -83,6 +90,8 @@

<section data-include="section/ontology.md" data-include-format="markdown"></section>

<section data-include="section/implementation.md" data-include-format="markdown"></section>

</body>

</html>
18 changes: 18 additions & 0 deletions section/implementation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Implementation Considerations

There are several considerations that can be made when implementing RML+FnO.
Some of these might need to be specified in their own section,
others might be too specific too certain implementations,
but might still be interesting to mention.

<p class="issue" data-number="8" data-format="markdown">
TODO
</p>

<p class="issue" data-number="9" data-format="markdown">
TODO
</p>

<p class="issue" data-number="10" data-format="markdown">
TODO
</p>
59 changes: 48 additions & 11 deletions section/ontology.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,30 @@ graph LR
Specifically, this means that, when a FunctionMap is used within a <a>RML mapping</a>,
this term map has two classes: `fnml:FunctionMap`, and the term map within the context of the RML Mapping,
namely, subject map, predicate map, object map, or graph map.
As a consequence, all default [[R2RML]] processing hold, e.g.,
the [default term type depends on whether the term map is an object map or not](https://www.w3.org/TR/r2rml/#termtype).
As a consequence, all default [[RML]] processing hold, e.g.,
the [default term type depends on whether the term map is an object map or not](https://rml.io/specs/rml/#termtype),
**with following extension**:

If the term map does not have a `rr:termType` property, then its [term type](https://rml.io/specs/rml/#term-type) is:
* `rr:Literal`, if it is an [object map](https://www.w3.org/TR/r2rml/#dfn-object-map) and at least one of the following conditions is true:
* It is a [reference-based term map](https://rml.io/specs/rml/#reference-valued-term-map), **or also a fnml:FunctionMap**
* It has a `rml:languageMap` and/or `rr:language` property (and thus a [language map](https://rml.io/specs/rml/#language-map) and/or a [specified language tag](https://rml.io/specs/rml/#specified-language-tag)).
* It has a `rr:datatype` property (and thus a [specified datatype](https://rml.io/specs/rml/#specified-datatype)).
* `rr:IRI`, otherwise.

<p class="issue" data-number="5" data-format="markdown">
It is still undecided whether this extension should stay (so `rr:Literal` by default),
or go (so `rr:IRI` by default).
</p>

<div class="note">
Question of BDM: how is this unifiable with the fact that a function always returns an RDF term [[rdf-concepts]],
thus already has things such as termtype, datatype, etc. defined?
Will we allow to override these datatypes within an RML mapping or not?
If so, do we need to specify how to override these datatypes?
(I assume just taking the value from the RDF term is enough, but I'm not sure)
</div>
<p class="issue" data-number="7" data-format="markdown">
It is currently unspecified how to override the termtype of a fnml:FunctionMap result.
</p>

<p class="note" data-format="markdown">
It is currently assumed that an `fnml:FunctionMap` always returns an RDF term [[rdf-concepts]] or list thereof.
How a list of RDF terms is handled, is out of scope of this spec, but currently discussed at https://github.com/kg-construct/mapping-challenges/pull/26 and https://github.com/kg-construct/mapping-challenges/pull/27
</p>

### fnml:functionValue

Expand All @@ -57,10 +71,17 @@ It has range <a>fnml:FunctionMap</a> and domain rr:TriplesMap.
The triples map to which <a>fnml:functionValue</a> refers to should be an [[RML]] conforming triples map
that generates an <a>execution</a> description.

When this triples map does not specify a logical source, the logical source of the 'parent' triples map is used.
#### Logical source

When this triples map **does not specify a logical source**, the logical source of the 'parent' triples map is used.
When the triples map _does_ define a logical source (different from the logical source of the knowledge graph generating triples map),
then each result of each iteration of the function execution triples map should be used by the knowledge graph generating triples map
(i.e., a full join).
For an example on joining values across data sources, without join conditions, see test case [RMLFNOTC009](https://github.com/RMLio/rml-fno-test-cases/tree/master/RMLFNOTC0009-CSV).

<p class="issue" data-number="2" data-format="markdown">
It is still an open issue to joining values across data sources _with_ join conditions
</p>

<div class="practice">

Expand All @@ -71,9 +92,25 @@ see, e.g. test case [RMLFNOTC0019](https://github.com/RMLio/rml-fno-test-cases/t
</p>
</div>

When this triples map does not specify a subject map, a blank node should be generated for the subject.
<p class="issue" data-number="4" data-format="markdown">
The mapping challenge [Join on literals](https://github.com/kg-construct/mapping-challenges/pull/29) also influences this spec.
</p>

#### Subject map

When this triples map **does not specify a subject map**, a blank node should be generated for the subject.

<div class="note">
We should probably define a new resource that is a subclass of rr:TriplesMap,
as the description above is disjoint with rr:TriplesMap, as logical source and subjectMap are not optional in [[R2RML]]
</div>

### Nested functions

As the range of `fnml:functionValue` is `rr:TriplesMap`,
it is possible to nest functions: you generate a term in a first function, and that term is used as an parameter value in a second function.
For an example, see [RMLFNOTC0018](https://github.com/RMLio/rml-fno-test-cases/tree/master/RMLFNOTC0018-CSV).

<p class="issue" data-number="3" data-format="markdown">
For now, it is unclear how to handle a nested function where that nested triplesmap contains a join condition.
</p>

0 comments on commit 0bf4ec0

Please sign in to comment.