TravelGraph-AI/docs/NEO4J_SCHEMA_REFERENCE.md at main · Hotragn/TravelGraph-AI · GitHub
Skip to content

Latest commit

 

History

History
581 lines (537 loc) · 16.8 KB

NEO4J_SCHEMA_REFERENCE.md

File metadata and controls

581 lines (537 loc) · 16.8 KB

Neo4j Knowledge Graph Schema Reference

Purpose: Comprehensive schema documentation for generating Cypher queries Last Updated: 2025-12-10 22:56:50 Database: myworld


Quick Visual Schema

graph LR
    POI[POI:Entity] --> LOCATED_IN[LOCATED_IN] --> City[City:City]
    City --> IN_STATE[IN_STATE] --> State[State]
    State --> IN_COUNTRY[IN_COUNTRY] --> Country[Country]
    POI --> KNOWN_FOR[KNOWN_FOR] --> Feature[Feature]
Loading

Table of Contents

  1. Node Labels
  2. Node Properties
  3. Relationship Types
  4. Relationship Directions
  5. Relationship Properties
  6. Common Query Patterns
  7. Example Queries

🧭 CORE RULE: POI → City (not reverse): (poi)-[:LOCATED_IN]->(city:City)


Node Labels

Overview

The graph uses a hierarchical labeling system:

  • Base Label: All nodes have Entity label
  • Type Labels: Additional labels indicate node type (e.g., City, Restaurant, Museum)
  • POI Labels: Points of Interest have Attraction + specific type labels

Base

  • Entity - 57,877 nodes
  • Attraction - 19,883 nodes

Geographic

  • City - 352 nodes
  • State - 5 nodes
  • Country - 1 nodes

Business

  • Restaurant - 4,813 nodes
  • FastFood - 2,395 nodes
  • Cafe - 1,202 nodes
  • Operator - 656 nodes
  • Bar - 415 nodes
  • Brand - 304 nodes
  • Pub - 71 nodes

Tourism

  • Park - 3,802 nodes
  • Beach - 2,053 nodes
  • Museum - 444 nodes
  • Theatre - 220 nodes
  • Historic - 136 nodes

Natural

  • NaturalWater - 13,765 nodes
  • Pond - 4,167 nodes
  • WaterwayRiver - 2,345 nodes
  • Beach - 2,053 nodes
  • WaterRiver - 859 nodes
  • WaterBasin - 540 nodes
  • NaturalBay - 361 nodes
  • Lake - 140 nodes

Other

  • Information - 2,105 nodes
  • WaterReservoir - 1,070 nodes
  • Coastline - 1,066 nodes
  • Memorial - 1,029 nodes
  • Artwork - 791 nodes
  • TourismHotel - 644 nodes
  • Island - 626 nodes
  • Reef - 563 nodes
  • Islet - 467 nodes
  • Viewpoint - 429 nodes
  • Wastewater - 367 nodes
  • CampPitch - 350 nodes
  • ProtectedArea - 317 nodes
  • WaterwayCanal - 291 nodes
  • AmenityIceCream - 257 nodes
  • Cape - 254 nodes
  • BuildingRetail - 239 nodes
  • Monument - 230 nodes
  • Playground - 208 nodes
  • HistoricRuins - 192 nodes
  • Wood - 168 nodes
  • Chalet - 152 nodes
  • PicnicSite - 143 nodes
  • Motel - 142 nodes
  • CampSite - 139 nodes
  • Marina - 131 nodes
  • Gallery - 127 nodes
  • Gym - 106 nodes
  • Cinema - 103 nodes
  • ArtsCentre - 103 nodes
  • SportsCenter - 103 nodes
  • GuestHouse - 98 nodes
  • BuildingHotel - 93 nodes
  • RecreationGround - 81 nodes
  • ArchaeologicalSite - 79 nodes
  • GolfCourse - 77 nodes
  • BuildingCommercial - 70 nodes
  • Dock - 60 nodes
  • Tomb - 57 nodes
  • LeisureStadium - 51 nodes
  • WaterDitch - 49 nodes
  • Billiards - 47 nodes
  • Waterfall - 38 nodes
  • Stone - 37 nodes
  • Apartment - 37 nodes
  • WaterCanal - 37 nodes
  • FoodCourt - 35 nodes
  • Wetland - 34 nodes
  • Bench - 33 nodes
  • NatureReserve - 30 nodes
  • Nightclub - 29 nodes
  • Fort - 22 nodes
  • Grass - 21 nodes
  • Administrative - 20 nodes
  • Oxbow - 18 nodes
  • CaravanSite - 17 nodes
  • Spring - 15 nodes
  • Brewery - 15 nodes
  • Locality - 14 nodes
  • Zoo - 14 nodes
  • ThemePark - 13 nodes
  • Wall - 13 nodes
  • Roof - 13 nodes
  • Fountain - 12 nodes
  • AmusementArcade - 12 nodes
  • Rock - 12 nodes
  • StreetLamp - 12 nodes
  • House - 12 nodes
  • LeisureSwimmingPool - 12 nodes
  • Cuisine - 10 nodes
  • ShopBakery - 10 nodes
  • Square - 10 nodes
  • ManMadeTower - 10 nodes
  • WaterPark - 10 nodes
  • StreetCabinet - 10 nodes
  • PlaceOfWorship - 10 nodes
  • Farmland - 10 nodes
  • Coffee - 9 nodes
  • BuildingUniversity - 9 nodes
  • Ship - 9 nodes
  • Biergarten - 9 nodes
  • Hostel - 8 nodes
  • BuildingSchool - 8 nodes
  • LanduseCommercial - 8 nodes
  • Network - 7 nodes
  • Shelter - 7 nodes
  • Baseball - 7 nodes
  • VillageGreen - 7 nodes
  • WaysideShrine - 6 nodes
  • Swimming - 6 nodes
  • Guide - 6 nodes
  • AmericanFootball - 6 nodes
  • Pedestrian - 6 nodes
  • Archipelago - 6 nodes
  • BoundaryStone - 5 nodes
  • BuildingRuins - 5 nodes
  • WildernessHut - 5 nodes
  • Breakwater - 5 nodes
  • Peak - 4 nodes
  • ShopConfectionery - 4 nodes
  • BoatRental - 4 nodes
  • AmenityDrinkingWater - 4 nodes
  • Tree - 4 nodes
  • BareRock - 4 nodes
  • Aircraft - 4 nodes
  • Convenience - 4 nodes
  • BuildingService - 4 nodes
  • BuildingChurch - 4 nodes
  • Aquarium - 4 nodes
  • Cemetery - 4 nodes
  • Multi - 4 nodes
  • Lagoon - 4 nodes
  • Civic - 4 nodes
  • Castle - 4 nodes
  • LanduseBasin - 4 nodes
  • LanduseResidential - 4 nodes
  • Planetarium - 3 nodes
  • Deli - 3 nodes
  • Pastry - 3 nodes
  • Winery - 3 nodes
  • Flagpole - 3 nodes
  • Forest - 3 nodes
  • SummerCamp - 3 nodes
  • IceHockey - 3 nodes
  • ReflectingPool - 3 nodes
  • BuildingCollege - 3 nodes
  • ShopIceCream - 3 nodes
  • Fence - 3 nodes
  • ManMadeBridge - 3 nodes
  • Scrub - 3 nodes
  • BuildingResidential - 3 nodes
  • StorageTank - 3 nodes
  • Athletics - 3 nodes
  • Marker - 2 nodes
  • Caterer - 2 nodes
  • Quarry - 2 nodes
  • RailwayCar - 2 nodes
  • PublicTransportStation - 2 nodes
  • SurveyPoint - 2 nodes
  • RangerStation - 2 nodes
  • LanduseRetail - 2 nodes
  • WasteDisposal - 2 nodes
  • Books - 2 nodes
  • HighwayMilestone - 2 nodes
  • Clock - 2 nodes
  • WasteBasket - 2 nodes
  • AmenityParking - 2 nodes
  • Parking - 2 nodes
  • BeachResort - 2 nodes
  • Art - 2 nodes
  • AerialwayStation - 2 nodes
  • BuildingOffice - 2 nodes
  • GraveYard - 2 nodes
  • Battlefield - 2 nodes
  • BuildingKiosk - 2 nodes
  • SwimmingArea - 2 nodes
  • ReservoirCovered - 2 nodes
  • Barn - 2 nodes
  • Detached - 2 nodes
  • Ticket - 2 nodes
  • Library - 2 nodes
  • LanduseReservoir - 2 nodes
  • FishPass - 2 nodes
  • MilitaryBunker - 2 nodes
  • Weir - 2 nodes
  • EventsVenue - 2 nodes
  • Slipway - 2 nodes
  • RouteRunning - 2 nodes
  • Pier - 1 nodes
  • Trailhead - 1 nodes
  • HuntingStand - 1 nodes
  • StopPosition - 1 nodes
  • BusStop - 1 nodes
  • PublicTransportPlatform - 1 nodes
  • PassingPlace - 1 nodes
  • RailwayStation - 1 nodes
  • Bbq - 1 nodes
  • PicnicTable - 1 nodes
  • HistoricMilestone - 1 nodes
  • Seafood - 1 nodes
  • AlpineHut - 1 nodes
  • Association - 1 nodes
  • Cliff - 1 nodes
  • FitnessStation - 1 nodes
  • BicycleParking - 1 nodes
  • Generator - 1 nodes
  • Rowing - 1 nodes
  • Vacant - 1 nodes
  • Soccer - 1 nodes
  • Climbing - 1 nodes
  • ATM - 1 nodes
  • HealthFood - 1 nodes
  • BuildingStadium - 1 nodes
  • Marketplace - 1 nodes
  • Temple - 1 nodes
  • Bandstand - 1 nodes
  • Warehouse - 1 nodes
  • HistoricFarm - 1 nodes
  • TrainStation - 1 nodes
  • Farmyard - 1 nodes
  • WaterWell - 1 nodes
  • LeisureFishing - 1 nodes
  • BuildingIndustrial - 1 nodes
  • Lighthouse - 1 nodes
  • AmenityToilets - 1 nodes
  • LeisureMiniatureGolf - 1 nodes
  • BuildingConstruction - 1 nodes
  • Dam - 1 nodes
  • Motor - 1 nodes
  • Tennis - 1 nodes
  • Windmill - 1 nodes
  • Grassland - 1 nodes
  • Path - 1 nodes
  • BuildingGovernment - 1 nodes
  • HistoricTower - 1 nodes
  • CityWall - 1 nodes
  • Kerb - 1 nodes
  • BirdHide - 1 nodes
  • Lock - 1 nodes
  • Pipeline - 1 nodes
  • Steps - 1 nodes
  • Sidewalk - 1 nodes
  • TollBooth - 1 nodes
  • LeisureTrack - 1 nodes
  • RetainingWall - 1 nodes
  • StreamPool - 1 nodes
  • Mud - 1 nodes
  • Stream - 1 nodes
  • LanduseConstruction - 1 nodes
  • Cabin - 1 nodes
  • Foot - 1 nodes
  • RouteRoad - 1 nodes
  • Moat - 1 nodes
  • ConferenceCentre - 1 nodes
  • Garden - 1 nodes
  • Stadium - 1 nodes
  • PublicBuilding - 1 nodes
  • Townhall - 1 nodes
  • Bank - 1 nodes
  • IceCream - 1 nodes

Node Properties

Common Properties (All Nodes)

Property Type Description
id String Unique identifier
name String Node name
latitude Float Geographic latitude
longitude Float Geographic longitude

Top Properties by Usage

Property Nodes Description
id 57,877 -
color 57,856 -
osmType 44,009 -
osmId 44,009 -
osmLink 42,643 -
latitude 42,371 -
longitude 42,371 -
name 40,708 -
wkt 40,642 -
natural 18,532 -
country 11,498 -
state 11,482 -
water 11,149 -
city 10,871 -
amenity 9,674 -
addrStreet 8,411 -
addrHousenumber 8,351 -
website 6,435 -
addrState 6,312 -
addrPostcode 6,269 -
addrCity 6,076 -
tourism 6,074 -
phone 4,949 -
leisure 4,631 -
building 3,914 -
openingHours 3,877 -
brand 3,147 -
waterway 2,739 -
historic 2,034 -
wikidataLink 1,895 -

Properties by Label

Restaurant

Property Count
id 4,813
latitude 4,807
longitude 4,807
city 4,807
amenity 4,802
osmType 4,802
osmId 4,802
color 4,802
osmLink 4,801
country 4,796
state 4,796
wkt 4,795
name 4,757
addrHousenumber 3,258
addrStreet 3,250
addrPostcode 2,278
addrCity 2,183
website 2,153
addrState 1,977
phone 1,827

City

Property Count
id 352
name 352
latitude 352
longitude 352
country 352
state 352
color 352
createdAt 348
attractionCount 335
updatedAt 325

Museum

Property Count
id 444
tourism 444
osmType 444
osmId 444
color 444
osmLink 443
country 436
state 436
city 435
name 431
latitude 430
longitude 430
wkt 429
addrStreet 312
addrHousenumber 303
website 264
addrState 257
building 242
addrCity 197
addrPostcode 178

Sample Nodes

Restaurant Sample

{
  "city": "Boston",
  "latitude": 42.3645,
  "name": "Dino's North End",
  "price_range_usd": "10-20",
  "description": "Generous Italian subs and pasta at fair prices in Little Italy.",
  "openingHours": "11AM-9PM",
  "id": "rest_66010cc608e8",
  "neighborhood": "North End",
  "type": "ItalianSubShop",
  "category": "italian_north_end",
  "longitude": -71.0535
}

City Sample

{
  "country": "Us",
  "createdAt": "2025-12-03T19:42:00.671000000+00:00",
  "color": "#68BDF6",
  "latitude": 42.2794378,
  "name": "Chester",
  "id": "city_4:7f741ed8-79a8-48ae-98d9-00838f6db129:23410",
  "state": "MA",
  "attractionCount": 66,
  "longitude": -72.9821435,
  "updatedAt": "2025-12-04T04:06:00.808000000+00:00"
}

Museum Sample

{
  "wkt": "Point(-72.9785729 42.2803788)",
  "country": "Us",
  "website": "https://www.chesterrailwaystation.net/",
  "addrState": "MA",
  "color": "#4ECDC4",
  "city": "Becket",
  "latitude": 42.2803788,
  "fee": "no",
  "tourism": "museum",
  "addrHousenumber": "10",
  "operator": "The Chester Foundation",
  "addrCity": "Chester",
  "wikidataLink": "https://www.wikidata.org/wiki/Q131980353",
  "addrPostcode": "01011",
  "addrStreet": "Prospect Street",
  "osmLink": "https://www.openstreetmap.org/node/247474896",
  "osmId": "247474896",
  "name": "Chester Railway Museum",
  "openingHours": "10:00-15:00",
  "osmType": "node",
  "id": "node_247474896",
  "state": "MA",
  "wikidata": "Q131980353",
  "longitude": -72.9785729
}

Relationship Types

Overview

Relationship Type Count Direction
MEMBER_OF 55,131 (source)-[:MEMBER_OF]->(target)
BRAND 51,678 (source)-[:BRAND]->(target)
LOCATED_IN 13,519 (source)-[:LOCATED_IN]->(target)
ADDRESS 5,405 (source)-[:ADDRESS]->(target)
HAS_WEBSITE 4,125 (source)-[:HAS_WEBSITE]->(target)
RATED_AS 3,280 (source)-[:RATED_AS]->(target)
BRANDED_AS 3,013 (source)-[:BRANDED_AS]->(target)
OPENING_HOURS 2,993 (source)-[:OPENING_HOURS]->(target)
SUITABLE_FOR 2,536 (source)-[:SUITABLE_FOR]->(target)
OPERATED_BY 2,345 (source)-[:OPERATED_BY]->(target)
ACCESSIBLE_BY 2,318 (source)-[:ACCESSIBLE_BY]->(target)
BEST_TIME_TO_VISIT 1,911 (source)-[:BEST_TIME_TO_VISIT]->(target)
OFFERS_ACTIVITY 1,624 (source)-[:OFFERS_ACTIVITY]->(target)
TOURISM_TYPE 1,368 (source)-[:TOURISM_TYPE]->(target)
HAS_CONTACT 890 (source)-[:HAS_CONTACT]->(target)
PRICE_LEVEL 793 (source)-[:PRICE_LEVEL]->(target)
FAMILY_FRIENDLY 726 (source)-[:FAMILY_FRIENDLY]->(target)
SERVES_CUISINE 699 (source)-[:SERVES_CUISINE]->(target)
KNOWN_FOR 452 (source)-[:KNOWN_FOR]->(target)
HISTORIC_IMPORTANCE 446 (source)-[:HISTORIC_IMPORTANCE]->(target)
IN_STATE 348 (source)-[:IN_STATE]->(target)
ASSOCIATED_WITH_PERSON 278 (source)-[:ASSOCIATED_WITH_PERSON]->(target)
ESTABLISHED_IN 216 (source)-[:ESTABLISHED_IN]->(target)
RECOMMENDED_ACTIVITY 149 (source)-[:RECOMMENDED_ACTIVITY]->(target)
LOCATION 121 (source)-[:LOCATION]->(target)
BUILT_IN 88 (source)-[:BUILT_IN]->(target)
OPENED_IN 53 (source)-[:OPENED_IN]->(target)
HONORS 42 (source)-[:HONORS]->(target)
RENOVATED_IN 39 (source)-[:RENOVATED_IN]->(target)
CELEBRATED_FOR 32 (source)-[:CELEBRATED_FOR]->(target)
EVENT_OCCURRED_IN 31 (source)-[:EVENT_OCCURRED_IN]->(target)
CAPACITY 31 (source)-[:CAPACITY]->(target)
OFFICIAL_NAME 24 (source)-[:OFFICIAL_NAME]->(target)
HAS_EVENT 19 (source)-[:HAS_EVENT]->(target)
ARCHITECTURAL_STYLE 17 (source)-[:ARCHITECTURAL_STYLE]->(target)
DESIGNED_BY 17 (source)-[:DESIGNED_BY]->(target)
CLOSED_IN 15 (source)-[:CLOSED_IN]->(target)
HOSTS_ANNUAL_EVENT 15 (source)-[:HOSTS_ANNUAL_EVENT]->(target)
AWARDED 13 (source)-[:AWARDED]->(target)
CULTURAL_IMPORTANCE 13 (source)-[:CULTURAL_IMPORTANCE]->(target)
IN_NETWORK 12 (source)-[:IN_NETWORK]->(target)
REOPENED_IN 9 (source)-[:REOPENED_IN]->(target)
CONNECTED_TO 5 (source)-[:CONNECTED_TO]->(target)
ASSOCIATED_WITH 5 (source)-[:ASSOCIATED_WITH]->(target)
RECOMMENDED_DURATION 5 (source)-[:RECOMMENDED_DURATION]->(target)
IN_COUNTRY 4 (source)-[:IN_COUNTRY]->(target)
SEASONAL_ACTIVITY 4 (source)-[:SEASONAL_ACTIVITY]->(target)
CONSTRUCTED_USING 4 (source)-[:CONSTRUCTED_USING]->(target)
NEARBY 3 (source)-[:NEARBY]->(target)
RECOMMENDED_BY 2 (source)-[:RECOMMENDED_BY]->(target)
FEATURES 2 (source)-[:FEATURES]->(target)
HAS_FEATURE 2 (source)-[:HAS_FEATURE]->(target)
BEST_VISITED_IN 2 (source)-[:BEST_VISITED_IN]->(target)
FAMOUS_FOR 1 (source)-[:FAMOUS_FOR]->(target)
NEARBY_ATTRACTION 1 (source)-[:NEARBY_ATTRACTION]->(target)
VENUE_FOR 1 (source)-[:VENUE_FOR]->(target)
HISTORICAL_SIGNIFICANCE 1 (source)-[:HISTORICAL_SIGNIFICANCE]->(target)
INSPIRED_BY 1 (source)-[:INSPIRED_BY]->(target)

Most Common Relationships

  • MEMBER_OF: 55,131 relationships
  • BRAND: 51,678 relationships
  • LOCATED_IN: 13,519 relationships
  • ADDRESS: 5,405 relationships
  • HAS_WEBSITE: 4,125 relationships
  • RATED_AS: 3,280 relationships
  • BRANDED_AS: 3,013 relationships
  • OPENING_HOURS: 2,993 relationships
  • SUITABLE_FOR: 2,536 relationships
  • OPERATED_BY: 2,345 relationships