简体   繁体   中英

Storing car part data in a database

I want to understand if it is possible to store car part data using the Neo4J database paradigm. I'm open to anything, so if something better suits, please suggest how.

For example: A car has a VIN, frame number, and a number of specific parts that fit it. Then there are different types of the same car: eg 2007 Honda Accord CM2, and 2007 Honda Accord CM2 Type-S, both of which share a lot of the same parts, but are considered the same car (04636SED310ZZ) is an outside panel that would fit for both.

The Honda part naming system is very different to the Toyota part naming system however - with toyota, they have a part number category, paired with some other numbers which define a part. Like 52119-XXXXX would be for a front bumper.

I'd assume other car manufacturers also have different systems for parts.

How would I go about creating a database to store part data for lots of different types of cars (complexity does not matter), and what type of database paradigm would best suit a scenario such as this?

The way I imagine this working would be similar to how Java Interfaces work - there's a basic "Car" interface but the actual implementation of a "getCarPart()" function would be different for each make.

I'm not really sure about how to go about designing or even thinking about this, so I'd appreciate your help.

Thanks

A good place to start here would be to draw a graph model of your domain. If you have a whiteboard handy that works best, but the Arrows tool is a great web-based graph diagramming tool.

I think of graph data modeling as an iterative process:

  1. Identify the "things" - the objects in your domain --> These become nodes
  2. How are those things related to each other? --> These become relationships
  3. What are the attributes? --> These becomes properties on nodes, or if they describe how two nodes are related possibly as properties on relationships.
  4. Think of your business requirements. What are they questions you want to ask of data. Can you see a traversal through the graph to answer your question? If not, adjust your model.

Going through this exercise with Arrows I came up with this property graph model:

在此处输入图像描述

The different car "sub-models" here use the node label "Trim" to represent different trims of each car model. Car parts might apply to every trim, in which case they are connected to the CarModel node or perhaps a part is only compatible with a subset of trims for a car model. In that case we can model the relationship of (:Part)<-[:HAS_PART]-(:Trim) .

The next steps would be to take the questions you want to ask of the data and try to identify a traversal through the graph to answer the question. If the question can't be answered, then iterate on the graph model - adding properties, nodes, relationships, or extracting properties out to nodes, etc.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM