Re: Translating Property Graphs with Multiple Labels to RDF-sta

Hi Dominik and Enrico,

Yes, for the nodes those appear to be multiple types. And yes to
Dominik, I take that as two relationship labels. If so, this is
another example of reifiers of multiple relationships:

    :e1 :amount 1000 ;
        :currency "gbp" ;
        :date "2002-09-24Z" ;
        rdf:reifies <<( :a1 :TRANSACTION :a2 )>> ,
                    <<( :a1 :FinancialOperation :a2 )>> .

    :e2 :amount 500 ;
        :currency "eur" ;
        :date "2003-10-24Z" ;
        rdf:reifies <<( :a1 :TRANSACTION :a2 )>> ,
                <<( :a1 :FinancialOperation :a2 )>> .

    :e3 :amount  900 ;
        :currency "gbp" ;
        :date "2002-10-03Z" ;
        rdf:reifies <<( :a2 :TRANSACTION :a3 )>> ,
                <<( :a2 :FinancialOperation :a3 )>> .

We're seeking a solid annotation shorthand for that (see [1]). One of
the options:

    :a1 :TRANSACTION :a2 {| ~ :e1 |} ;
        :FinancialOperation :a2 {| ~ :e1 |} .

    :e1 :amount 1000 ; :currency "gbp" ; :date "2002-09-24Z" .

   :a1 :TRANSACTION :a2 {| ~ :e2 |} ;
        :FinancialOperation :a2 {| ~ :e2 |} .

    :e2 :amount 500 ; :currency "eur" ; :date "2003-10-24Z" .

   :a2 :TRANSACTION :a3 {| ~ :e3 |} ;
        :FinancialOperation :a3 {| ~ :e3 |} .

    :e3 :amount  900 ; :currency "gbp" ; :date "2002-10-03Z" .

(All of this is of course without relying on the more expressive power
of subproperties (RDFS) or entailed simple relationships from
relationship classes (OWL).)

Best regards,
Niklas

[1]: <https://github.com/w3c/rdf-star-wg/issues/116>



On Tue, Jul 23, 2024 at 1:09 PM ddooss@wp.pl <ddooss@wp.pl> wrote:
>
> Hi Enrico,
>
> Dnia 23 lipca 2024 12:54 Franconi Enrico <franconi@inf.unibz.it> napisał(a):
>
> Hi Dominik,
>
> As you know, many definitions of Property Graphs, including those utilized in GQL, permit nodes and edges to possess multiple labels. This is somewhat different from the examples commonly cited, such as those on the wiki, which typically feature nodes and edges with single labels for simplicity and clarity.
>
> To illustrate my point, consider the following Property Graph example where both nodes and edges have dual labels:
>
> CREATE (a1:Account:FinancialEntity {accountNumber: 1})
> CREATE (a2:Account:FinancialEntity {accountNumber: 2})
> CREATE (a3:Account:FinancialEntity {accountNumber: 3})
>
> CREATE (a1)-[:TRANSACTION:FinancialOperation {amount: 1000, currency: "gbp", date: "2002-09-24Z"}]->(a2)
> CREATE (a1)-[:TRANSACTION:FinancialOperation {amount: 500, currency: "eur", date: "2003-10-24Z"}]->(a2)
> CREATE (a2)-[:TRANSACTION:FinancialOperation {amount: 900, currency: "gbp", date: "2002-10-03Z"}]->(a3)
>
> In this scenario, nodes are labeled both as `Account` and `FinancialEntity`, and edges are labeled as `TRANSACTION` and `FinancialOperation`. This dual labeling adds a layer of complexity when attempting to translate such Property Graphs to RDF-star.
>
> Multiple labels on nodes: the following triples should be added to the example in the wiki:
>
> :a1 a :Account , :FinancialEntity .
>
> :a2 a :Account , :FinancialEntity .
> :a3 a :Account , :FinancialEntity .
>
>
> Yes, that was expected.
>
> Multiple labels on relationships:
> Cypher does not allow for multiple labels (type) on relationships, while you could easily have them using the reified relationship with the proposed mappings in RDF-star:
>
> :e1 a :transaction , :FinancialOperation .
>
> :e2 a :transaction , :FinancialOperation .
>
> :e3 a :transaction , :FinancialOperation .
>
>
> Yes, Neo4j does not support multiple labels. But I used that syntax to simplicity.
> So how the full example will look like? How this part will be write in the new syntax:
> << :e1 | :a1 :TRANSACTION :a2 >>
>   :amount 1000 ;
>   :currency "gbp" ;
>   :date "2002-09-24Z"^^xsd:date .
>
> Best,
> Dominik
>

Received on Tuesday, 23 July 2024 11:17:29 UTC