I'm very new to Graph database, so please ignore my mistakes. My scenario described in following picture:
I have different locations connected to each other with a route between them. Then I have many outlets linked to routes.
I created a RDBMS schema like this:
My data looks like this:
My goal is to give possible routes and outlets on them between two queried locations.
Recently I heard of Graph database support in SQL Server 2017 and read this article, but can't connect with my current problem.
Please help me to create Graph and node tables in SQL Server 2017.
Thanks!
Update
Now I create a data model:
and some Node and Edge tables as follows:
CREATE TABLE [dbo].[mRoute](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](500) NOT NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC
)ON [PRIMARY]
)
AS NODE ON [PRIMARY]
GO
CREATE TABLE [dbo].[mCity](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](500) NOT NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC
)ON [PRIMARY]
)
AS NODE ON [PRIMARY]
GO
CREATE TABLE [dbo].[mOutlet](
[ID] [int] IDENTITY(1,1) NOT NULL,
[Name] [nvarchar](500) NOT NULL,
[Latitude] [decimal](11, 9) NULL,
[Longitude] [decimal](11, 9) NULL,
PRIMARY KEY CLUSTERED
(
[ID] ASC
)ON [PRIMARY]
)
AS NODE ON [PRIMARY]
GO
CREATE TABLE [dbo].[On]
AS EDGE ON [PRIMARY]
GO
CREATE TABLE [dbo].[LinkedTo]
AS EDGE ON [PRIMARY]
GO
Now I am stuck on Between
Edge Table, which contains route between two cities.