Syntax to query for optional relationships in Microsoft SQL Server 2017 Graph Database?

Viewed 925

I want to select optional relationships in . Similar to optional in e.g.:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?mbox
WHERE  { ?x foaf:name  ?name .
     OPTIONAL { ?x  foaf:mbox  ?mbox }
   }

from https://www.w3.org/2001/sw/DataAccess/rq23/#OptionalMatching.

And similar to LEFT JOIN in normal ; e.g.:

SELECT name, mbox
FROM Persons
LEFT JOIN PersonMailBoxLink ON Persons.$node_id = PersonMailBoxLink.$from_id
LEFT JOIN MailBoxes ON PersonMailBoxLink.$to_id = MailBoxes.$node_id

Is there an easier way via MATCH?

The documentation of MATCH describes no 'optional' construct and the remarks state:

OR and NOT operators are not supported in the MATCH pattern. MATCH can be combined with other expressions using AND in the WHERE clause. However, combining it with other expressions using OR or NOT is not supported.

1 Answers
Related