Re: N-ary relation and rdf star

> On 5. Jan 2021, at 17:25, Andy Seaborne <andy@apache.org> wrote:
> 
> 
> 
> On 05/01/2021 14:24, thomas lörtsch wrote:
>>> On 5. Jan 2021, at 11:31, Pierre-Antoine Champin <pierre-antoine.champin@ercim.eu> wrote:
>>> 
>>> On 05/01/2021 09:36, Patrick J Hayes wrote:
>>> 
>>>>> On Jan 4, 2021, at 8:55 PM, Jeen Broekstra <jb@metaphacts.com> wrote:
>>>>> 
>>>>> On Tue, 5 Jan 2021, at 01:21, Joy lix wrote:
>>>>>> Dear All:
>>>>>> I'm learning RDF star, what is the  difference between N-ary relation and RDF star?
>>>>>> N-ary relation : https://www.w3.org/TR/swbp-n-aryRelations/
>>>>> 
>>>>> RDF* is an extension of RDF that aims to make modeling certain kinds of n-ary relations easier.
>>>> 
>>>> Really?? That is not what I have been reading up until now. RDF* replaces RDF reification: what it encodes is assertions /about/ a triple. Such as provenance information. That is quite different from extending a triple to an n-tuple in order to encode n-ary relations.
>> We discussed the matter in some detail in December. The outcome was that an RDF* embedded triple doesn’t represent a specific triple occurrence but a triple type. So it is best understood not as an alternative to RDF reification but as a way to encode n-ary relations and in that respect an alternative to rdf:value.
>> If RDF* was to record provenance it would need a mechanism to refer to a specific occurrence e.g. in some document or named graph.
> 
> Indeed, RDF* does not directly solve this use case.
> RDF* does provide a building block whereby an application can capture that.
> 
> <<:s :p :o >> :usedIn <someDocument> .

Right, and that might be regarded as progress compared to RDF Standard Reification, but how much? It looks short and compact but when you actually want to attach assertions to that occurrence: how would you do that?

A slightly verbose way to go about it would be the following:

_:x rdf:type rdfx:Occurrence ;
    rdfx:ofTriple <<:s :p :o >> ;
    rdfx:inGraph <someDocument> .

Now you can start asserting stuff like date, source etc to the subject. 

_:x :as :example ;
    :onDate "05.01.2021" .

It saves 2 triples compared to RDF Standard Reification. The relation is slighty better in practice as the type statement can be omitted, but still only 2 triples difference. The cost is introducing a new (and very long) node type.

You might also nest the embedded triple in another embedded triple:

<< <<:s :p :o >> :usedIn <someDocument> >>  
  :as :example ;
  :onDate "05.01.2021" .

How would you translate that to ordinary triples? Would you use reification or an n-ary relation? Can that even be standardized? I fear it can’t be :-(


>> But RDF* doesn’t provide such a mechanism and proposals to that effect have been met with a certain reluctance.  Rather to the opposite it was said that the provenance examples in teh numerous RDF* papers have always been a mistake and that RDF* embedded triples where always intended to refer to triple types. So RDF* as of December 2020 doesn’t and can’t and doesn’t want to record provenance, quite explicitly, although it was presented and understood from the start as doing that and although it will no doubt be used for that no matter what a spec says. In a way this has a certain Groundhog Day feel to it.
>>> More generally, the goal is to mimic Property Graph's ability to annotate arcs, which is used for many use-cases. Provenance is one of them,
>> And now we will have the whole discussion again?
>>> N-ary relations is another one. For example, a common example in Property Graphs is "Tom Hanks stars in 'Saving Private Ryan' as Captain Miller", which could be represented in RDF* (using the annotation syntax):
>>> 
>>>   :tom_hanks :stars_in :movie123 {| :as "Captain Miller" |}.
>>>> Keeping things like this clear is why it is important to have a crisp semantics for RDF*.
>>> We are working on it ;) I expect to submit a new Pull Request soon...
>> Looking forward to it ;-)
>> Thomas
>>>   best
>>> 
>>>> 
>>>> Pat Hayes
>>>> 
>>>>> As the working group note you mention shows, there are other ways to represent such relations in RDF without needing an extension, but they all have certain drawbacks. RDF* hopes to overcome some of those drawbacks.
>>>>> 
>>>>>> This W3C Working Group Note  hasn't been updated since 2006. Can it still be used?
>>>>> 
>>>>> Yes. The approaches for modeling n-ary relations shown in that note are still as valid today as they were in 2006. It's just that RDF* gives you another option, that (hopefully, in some cases) will make things easier.
>>>>> 
>>>>> Kind regards,
>>>>> 
>>>>> Jeen
>>>>> --
>>>>> Dr Jeen Broekstra (he, him)
>>>>> principal software engineer
>>>>> 
>>>>> jb@metaphacts.com
>>>>> www.metaphacts.com

Received on Tuesday, 5 January 2021 18:05:21 UTC