Re: Blank nodes as subject maps in R2RML

Hi

Thank you Richard for answering. Your suggestion does not convice me.
With such a template consisting of all column names there would be a
problem with NULL column values. If any value was NULL, then the RDF
term generation process would return null subject and the whole row
would be ignored. I doubt this is the intended outcome. Or is it?

Regards,
Tomasz

On Wed, Jul 25, 2012 at 7:59 PM, Richard Cyganiak <richard@cyganiak.de> wrote:
> On 25 Jul 2012, at 18:24, Tomasz Pluskiewicz wrote:
>> It is what I have asked last month on
>> http://answers.semanticweb.com/questions/16823/blank-nodes-as-subject-maps-in-r2rml
>>
>> Indeed it is for direct mapping, which I implement using a default
>> mapping generator. Though I am still unsure how a subject map should
>> look like for a direct mapping such as in
>> http://www.w3.org/2001/sw/rdb2rdf/test-cases/#D005-1table3columns3rows2duplicates
>> test case. It does indeed seem that each tuple generates a fresh blank
>> node. If it were to only contain rr:termType and rr:class, then it is
>> invalid in the light of current specifications as Richard notes.
>>
>> Otherwise I would like to ask for guidance what should such default
>> mapping look like.
>
> The simplest rr:template could be something like: "IOUs:{fname}:{lname}:{amount}"
>
> This generates a fresh blank node for each distinct set of values. In other words, it re-uses the same blank node when there are duplicate rows. As noted in [1], this is legal for R2RML default mappings.
>
> You may be able to use database-specific SQL features to preserve duplicate rows. For example, in Oracle, "IOUs:{ROWID}" should work.
>
> Best,
> Richard
>
>
> [1] http://www.w3.org/TR/r2rml/#default-mappings
>
>
>>
>> Regard,
>> Tomasz Pluskiewicz
>>
>> On Wed, Jul 25, 2012 at 7:05 PM, Juan Sequeda <juanfederico@gmail.com> wrote:
>>> However, If this were to be valid, it would automatically generate a fresh
>>> bnode for each tuple. Which would lead us to the whole discussion that we
>>> had before about bnodes and the direct mapping.
>>>
>>> Tomasz, is this a feature or something that you need?
>>>
>>> Juan Sequeda
>>> +1-575-SEQ-UEDA
>>> www.juansequeda.com
>>>
>>>
>>>
>>> On Wed, Jul 25, 2012 at 11:59 AM, Richard Cyganiak <richard@cyganiak.de>
>>> wrote:
>>>>
>>>> On 25 Jul 2012, at 15:05, Tomasz Pluskiewicz wrote:
>>>>> Sorry to revive an old topic, but I have recenlty realized the root of
>>>>> my question.
>>>>>
>>>>> The R2RML specs at http://www.w3.org/TR/r2rml/#dfn-term-map state
>>>>> clearly that "A term map must be exactly one of the following: a
>>>>> constant-valued term map, a column-valued term map, a template-valued
>>>>> term map." Doesn't this mean that a term map
>>>>>
>>>>> <StudentsTriplesMap> rr:subjectMap
>>>>> [
>>>>>   rr:termType rr:BlankNode;
>>>>>   rr:class <http://example.com/Student>
>>>>> ];
>>>>>
>>>>> is in fact invalid, having no explicit rr:constant, rr:column or
>>>>> rr:template property?
>>>>
>>>> It is indeed invalid. You'd usually want an rr:template or rr:column that
>>>> creates the blank node identifier.
>>>>
>>>> Best,
>>>> Richard
>>>>
>>>>
>>>>>
>>>>> Regards,
>>>>> Tomasz
>>>>>
>>>>> On Fri, Jun 8, 2012 at 10:19 PM, Tomasz Pluskiewicz
>>>>> <tomasz.pluskiewicz@gmail.com> wrote:
>>>>>> Thank you for answering. Also, let me answer here again.
>>>>>>
>>>>>> I forgot to mention I intended the mapping as default mapping for
>>>>>> table without primary key.
>>>>>>
>>>>>> In my oppinion by default direct mapping should generate a blank node
>>>>>> for each row. And I do have mixed feelings about the behavior not
>>>>>> preserving duplicate rows.
>>>>>>
>>>>>> Regards,
>>>>>> Tomasz
>>>>>>
>>>>>> On Fri, Jun 8, 2012 at 6:26 PM, Juan Sequeda <juanfederico@gmail.com>
>>>>>> wrote:
>>>>>>> I asked on the forum, but let me ask here.
>>>>>>>
>>>>>>> are you expecting the R2RML engine to generate a blank node for each
>>>>>>> tuple,
>>>>>>> or do you have a column value that you would like to use in order to
>>>>>>> generate the blank node?
>>>>>>>
>>>>>>> Juan Sequeda
>>>>>>> +1-575-SEQ-UEDA
>>>>>>> www.juansequeda.com
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Jun 8, 2012 at 9:22 AM, David McNeil <dmcneil@revelytix.com>
>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> From the latest R2RML draft:
>>>>>>>>
>>>>>>>> * a subject map is a term map,
>>>>>>>> http://www.w3.org/2001/sw/rdb2rdf/r2rml/#dfn-term-map
>>>>>>>>
>>>>>>>> * the termType property can be used on term maps,
>>>>>>>> http://www.w3.org/2001/sw/rdb2rdf/r2rml/#termtype
>>>>>>>>
>>>>>>>> So "yes", you can use termType on subject maps and this is how you
>>>>>>>> would
>>>>>>>> produce subjects as blank nodes.
>>>>>>>>
>>>>>>>> -David
>>>>>>>
>>>>>>>
>>>>>
>>>>
>>>
>>
>

Received on Saturday, 28 July 2012 18:12:19 UTC