Spaces:
Running
Running
Update sample_data.py
Browse files- sample_data.py +273 -86
sample_data.py
CHANGED
@@ -1340,108 +1340,260 @@ ENTITY_RELATIONSHIP_JSON = """
|
|
1340 |
{
|
1341 |
"entities": [
|
1342 |
{
|
1343 |
-
"name": "
|
1344 |
"type": "strong",
|
1345 |
"attributes": [
|
1346 |
-
{
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
{
|
1351 |
-
|
1352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1353 |
]
|
1354 |
},
|
1355 |
{
|
1356 |
-
"name": "
|
1357 |
"type": "strong",
|
1358 |
"attributes": [
|
1359 |
-
{
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
{
|
1364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1365 |
]
|
1366 |
},
|
1367 |
{
|
1368 |
-
"name": "
|
1369 |
"type": "strong",
|
1370 |
"attributes": [
|
1371 |
-
{
|
1372 |
-
|
1373 |
-
|
1374 |
-
|
1375 |
-
{
|
1376 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
1377 |
]
|
1378 |
},
|
1379 |
{
|
1380 |
-
"name": "
|
1381 |
"type": "strong",
|
1382 |
"attributes": [
|
1383 |
-
{
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1387 |
]
|
1388 |
},
|
1389 |
{
|
1390 |
"name": "OrderItem",
|
1391 |
"type": "weak",
|
1392 |
"attributes": [
|
1393 |
-
{
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1398 |
]
|
1399 |
},
|
1400 |
{
|
1401 |
"name": "Payment",
|
1402 |
"type": "strong",
|
1403 |
"attributes": [
|
1404 |
-
{
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
{
|
1409 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1410 |
]
|
1411 |
},
|
1412 |
{
|
1413 |
-
"name": "
|
1414 |
"type": "strong",
|
1415 |
"attributes": [
|
1416 |
-
{
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
{
|
1421 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1422 |
]
|
1423 |
},
|
1424 |
{
|
1425 |
-
"name": "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1426 |
"type": "weak",
|
1427 |
"attributes": [
|
1428 |
-
{
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1433 |
]
|
1434 |
}
|
1435 |
],
|
1436 |
"relationships": [
|
1437 |
{
|
1438 |
-
"name": "
|
1439 |
"type": "regular",
|
1440 |
-
"entities": ["
|
1441 |
"cardinalities": {
|
1442 |
-
"
|
1443 |
-
"Order": "
|
1444 |
-
}
|
|
|
1445 |
},
|
1446 |
{
|
1447 |
"name": "Contains",
|
@@ -1449,71 +1601,106 @@ ENTITY_RELATIONSHIP_JSON = """
|
|
1449 |
"entities": ["Order", "OrderItem"],
|
1450 |
"cardinalities": {
|
1451 |
"Order": "1",
|
1452 |
-
"OrderItem": "
|
1453 |
-
}
|
|
|
1454 |
},
|
1455 |
{
|
1456 |
-
"name": "
|
1457 |
"type": "regular",
|
1458 |
"entities": ["OrderItem", "Product"],
|
1459 |
"cardinalities": {
|
1460 |
-
"OrderItem": "
|
1461 |
"Product": "1"
|
1462 |
-
}
|
|
|
1463 |
},
|
1464 |
{
|
1465 |
"name": "BelongsTo",
|
1466 |
"type": "regular",
|
1467 |
"entities": ["Product", "Category"],
|
1468 |
"cardinalities": {
|
1469 |
-
"Product": "
|
1470 |
"Category": "1"
|
1471 |
-
}
|
|
|
1472 |
},
|
1473 |
{
|
1474 |
-
"name": "
|
1475 |
"type": "regular",
|
1476 |
"entities": ["Order", "Payment"],
|
1477 |
"cardinalities": {
|
1478 |
"Order": "1",
|
1479 |
-
"Payment": "
|
1480 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1481 |
},
|
1482 |
{
|
1483 |
"name": "Supplies",
|
1484 |
"type": "regular",
|
1485 |
-
"entities": ["
|
1486 |
"cardinalities": {
|
1487 |
-
"
|
1488 |
"Product": "M"
|
1489 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1490 |
},
|
1491 |
{
|
1492 |
-
"name": "
|
1493 |
-
"type": "
|
1494 |
-
"entities": ["
|
1495 |
"cardinalities": {
|
1496 |
-
"
|
1497 |
-
"
|
1498 |
-
}
|
|
|
1499 |
},
|
1500 |
{
|
1501 |
-
"name": "
|
1502 |
-
"type": "
|
1503 |
-
"entities": ["
|
1504 |
"cardinalities": {
|
1505 |
-
"
|
1506 |
-
"
|
1507 |
-
}
|
|
|
1508 |
},
|
1509 |
{
|
1510 |
-
"name": "
|
1511 |
"type": "regular",
|
1512 |
-
"entities": ["
|
1513 |
"cardinalities": {
|
1514 |
-
"
|
1515 |
-
"
|
1516 |
-
}
|
|
|
1517 |
}
|
1518 |
]
|
1519 |
}
|
|
|
1340 |
{
|
1341 |
"entities": [
|
1342 |
{
|
1343 |
+
"name": "User",
|
1344 |
"type": "strong",
|
1345 |
"attributes": [
|
1346 |
+
{
|
1347 |
+
"name": "user_id",
|
1348 |
+
"type": "primary_key"
|
1349 |
+
},
|
1350 |
+
{
|
1351 |
+
"name": "username",
|
1352 |
+
"type": "regular"
|
1353 |
+
},
|
1354 |
+
{
|
1355 |
+
"name": "email",
|
1356 |
+
"type": "regular"
|
1357 |
+
},
|
1358 |
+
{
|
1359 |
+
"name": "password_hash",
|
1360 |
+
"type": "regular"
|
1361 |
+
},
|
1362 |
+
{
|
1363 |
+
"name": "full_name",
|
1364 |
+
"type": "composite"
|
1365 |
+
},
|
1366 |
+
{
|
1367 |
+
"name": "phone_numbers",
|
1368 |
+
"type": "multivalued"
|
1369 |
+
},
|
1370 |
+
{
|
1371 |
+
"name": "age",
|
1372 |
+
"type": "derived"
|
1373 |
+
}
|
1374 |
]
|
1375 |
},
|
1376 |
{
|
1377 |
+
"name": "Product",
|
1378 |
"type": "strong",
|
1379 |
"attributes": [
|
1380 |
+
{
|
1381 |
+
"name": "product_id",
|
1382 |
+
"type": "primary_key"
|
1383 |
+
},
|
1384 |
+
{
|
1385 |
+
"name": "name",
|
1386 |
+
"type": "regular"
|
1387 |
+
},
|
1388 |
+
{
|
1389 |
+
"name": "description",
|
1390 |
+
"type": "regular"
|
1391 |
+
},
|
1392 |
+
{
|
1393 |
+
"name": "price",
|
1394 |
+
"type": "regular"
|
1395 |
+
},
|
1396 |
+
{
|
1397 |
+
"name": "stock_quantity",
|
1398 |
+
"type": "regular"
|
1399 |
+
},
|
1400 |
+
{
|
1401 |
+
"name": "tags",
|
1402 |
+
"type": "multivalued"
|
1403 |
+
}
|
1404 |
]
|
1405 |
},
|
1406 |
{
|
1407 |
+
"name": "Category",
|
1408 |
"type": "strong",
|
1409 |
"attributes": [
|
1410 |
+
{
|
1411 |
+
"name": "category_id",
|
1412 |
+
"type": "primary_key"
|
1413 |
+
},
|
1414 |
+
{
|
1415 |
+
"name": "name",
|
1416 |
+
"type": "regular"
|
1417 |
+
},
|
1418 |
+
{
|
1419 |
+
"name": "description",
|
1420 |
+
"type": "regular"
|
1421 |
+
}
|
1422 |
]
|
1423 |
},
|
1424 |
{
|
1425 |
+
"name": "Order",
|
1426 |
"type": "strong",
|
1427 |
"attributes": [
|
1428 |
+
{
|
1429 |
+
"name": "order_id",
|
1430 |
+
"type": "primary_key"
|
1431 |
+
},
|
1432 |
+
{
|
1433 |
+
"name": "order_date",
|
1434 |
+
"type": "regular"
|
1435 |
+
},
|
1436 |
+
{
|
1437 |
+
"name": "status",
|
1438 |
+
"type": "regular"
|
1439 |
+
},
|
1440 |
+
{
|
1441 |
+
"name": "total_amount",
|
1442 |
+
"type": "derived"
|
1443 |
+
},
|
1444 |
+
{
|
1445 |
+
"name": "shipping_address",
|
1446 |
+
"type": "composite"
|
1447 |
+
}
|
1448 |
]
|
1449 |
},
|
1450 |
{
|
1451 |
"name": "OrderItem",
|
1452 |
"type": "weak",
|
1453 |
"attributes": [
|
1454 |
+
{
|
1455 |
+
"name": "line_number",
|
1456 |
+
"type": "partial_key"
|
1457 |
+
},
|
1458 |
+
{
|
1459 |
+
"name": "quantity",
|
1460 |
+
"type": "regular"
|
1461 |
+
},
|
1462 |
+
{
|
1463 |
+
"name": "unit_price",
|
1464 |
+
"type": "regular"
|
1465 |
+
},
|
1466 |
+
{
|
1467 |
+
"name": "subtotal",
|
1468 |
+
"type": "derived"
|
1469 |
+
}
|
1470 |
]
|
1471 |
},
|
1472 |
{
|
1473 |
"name": "Payment",
|
1474 |
"type": "strong",
|
1475 |
"attributes": [
|
1476 |
+
{
|
1477 |
+
"name": "payment_id",
|
1478 |
+
"type": "primary_key"
|
1479 |
+
},
|
1480 |
+
{
|
1481 |
+
"name": "amount",
|
1482 |
+
"type": "regular"
|
1483 |
+
},
|
1484 |
+
{
|
1485 |
+
"name": "payment_method",
|
1486 |
+
"type": "regular"
|
1487 |
+
},
|
1488 |
+
{
|
1489 |
+
"name": "payment_date",
|
1490 |
+
"type": "regular"
|
1491 |
+
},
|
1492 |
+
{
|
1493 |
+
"name": "status",
|
1494 |
+
"type": "regular"
|
1495 |
+
}
|
1496 |
]
|
1497 |
},
|
1498 |
{
|
1499 |
+
"name": "Review",
|
1500 |
"type": "strong",
|
1501 |
"attributes": [
|
1502 |
+
{
|
1503 |
+
"name": "review_id",
|
1504 |
+
"type": "primary_key"
|
1505 |
+
},
|
1506 |
+
{
|
1507 |
+
"name": "rating",
|
1508 |
+
"type": "regular"
|
1509 |
+
},
|
1510 |
+
{
|
1511 |
+
"name": "comment",
|
1512 |
+
"type": "regular"
|
1513 |
+
},
|
1514 |
+
{
|
1515 |
+
"name": "review_date",
|
1516 |
+
"type": "regular"
|
1517 |
+
}
|
1518 |
]
|
1519 |
},
|
1520 |
{
|
1521 |
+
"name": "Vendor",
|
1522 |
+
"type": "strong",
|
1523 |
+
"attributes": [
|
1524 |
+
{
|
1525 |
+
"name": "vendor_id",
|
1526 |
+
"type": "primary_key"
|
1527 |
+
},
|
1528 |
+
{
|
1529 |
+
"name": "company_name",
|
1530 |
+
"type": "regular"
|
1531 |
+
},
|
1532 |
+
{
|
1533 |
+
"name": "contact_person",
|
1534 |
+
"type": "regular"
|
1535 |
+
},
|
1536 |
+
{
|
1537 |
+
"name": "contact_emails",
|
1538 |
+
"type": "multivalued"
|
1539 |
+
},
|
1540 |
+
{
|
1541 |
+
"name": "business_address",
|
1542 |
+
"type": "composite"
|
1543 |
+
}
|
1544 |
+
]
|
1545 |
+
},
|
1546 |
+
{
|
1547 |
+
"name": "ShoppingCart",
|
1548 |
+
"type": "strong",
|
1549 |
+
"attributes": [
|
1550 |
+
{
|
1551 |
+
"name": "cart_id",
|
1552 |
+
"type": "primary_key"
|
1553 |
+
},
|
1554 |
+
{
|
1555 |
+
"name": "created_date",
|
1556 |
+
"type": "regular"
|
1557 |
+
},
|
1558 |
+
{
|
1559 |
+
"name": "last_updated",
|
1560 |
+
"type": "regular"
|
1561 |
+
},
|
1562 |
+
{
|
1563 |
+
"name": "total_items",
|
1564 |
+
"type": "derived"
|
1565 |
+
}
|
1566 |
+
]
|
1567 |
+
},
|
1568 |
+
{
|
1569 |
+
"name": "CartItem",
|
1570 |
"type": "weak",
|
1571 |
"attributes": [
|
1572 |
+
{
|
1573 |
+
"name": "item_position",
|
1574 |
+
"type": "partial_key"
|
1575 |
+
},
|
1576 |
+
{
|
1577 |
+
"name": "quantity",
|
1578 |
+
"type": "regular"
|
1579 |
+
},
|
1580 |
+
{
|
1581 |
+
"name": "added_date",
|
1582 |
+
"type": "regular"
|
1583 |
+
}
|
1584 |
]
|
1585 |
}
|
1586 |
],
|
1587 |
"relationships": [
|
1588 |
{
|
1589 |
+
"name": "PlacesOrder",
|
1590 |
"type": "regular",
|
1591 |
+
"entities": ["User", "Order"],
|
1592 |
"cardinalities": {
|
1593 |
+
"User": "1",
|
1594 |
+
"Order": "M"
|
1595 |
+
},
|
1596 |
+
"attributes": []
|
1597 |
},
|
1598 |
{
|
1599 |
"name": "Contains",
|
|
|
1601 |
"entities": ["Order", "OrderItem"],
|
1602 |
"cardinalities": {
|
1603 |
"Order": "1",
|
1604 |
+
"OrderItem": "M"
|
1605 |
+
},
|
1606 |
+
"attributes": []
|
1607 |
},
|
1608 |
{
|
1609 |
+
"name": "OrdersProduct",
|
1610 |
"type": "regular",
|
1611 |
"entities": ["OrderItem", "Product"],
|
1612 |
"cardinalities": {
|
1613 |
+
"OrderItem": "M",
|
1614 |
"Product": "1"
|
1615 |
+
},
|
1616 |
+
"attributes": []
|
1617 |
},
|
1618 |
{
|
1619 |
"name": "BelongsTo",
|
1620 |
"type": "regular",
|
1621 |
"entities": ["Product", "Category"],
|
1622 |
"cardinalities": {
|
1623 |
+
"Product": "M",
|
1624 |
"Category": "1"
|
1625 |
+
},
|
1626 |
+
"attributes": []
|
1627 |
},
|
1628 |
{
|
1629 |
+
"name": "ProcessesPayment",
|
1630 |
"type": "regular",
|
1631 |
"entities": ["Order", "Payment"],
|
1632 |
"cardinalities": {
|
1633 |
"Order": "1",
|
1634 |
+
"Payment": "M"
|
1635 |
+
},
|
1636 |
+
"attributes": []
|
1637 |
+
},
|
1638 |
+
{
|
1639 |
+
"name": "WritesReview",
|
1640 |
+
"type": "regular",
|
1641 |
+
"entities": ["User", "Review"],
|
1642 |
+
"cardinalities": {
|
1643 |
+
"User": "1",
|
1644 |
+
"Review": "M"
|
1645 |
+
},
|
1646 |
+
"attributes": []
|
1647 |
+
},
|
1648 |
+
{
|
1649 |
+
"name": "ReviewsProduct",
|
1650 |
+
"type": "regular",
|
1651 |
+
"entities": ["Review", "Product"],
|
1652 |
+
"cardinalities": {
|
1653 |
+
"Review": "M",
|
1654 |
+
"Product": "1"
|
1655 |
+
},
|
1656 |
+
"attributes": []
|
1657 |
},
|
1658 |
{
|
1659 |
"name": "Supplies",
|
1660 |
"type": "regular",
|
1661 |
+
"entities": ["Vendor", "Product"],
|
1662 |
"cardinalities": {
|
1663 |
+
"Vendor": "M",
|
1664 |
"Product": "M"
|
1665 |
+
},
|
1666 |
+
"attributes": [
|
1667 |
+
{
|
1668 |
+
"name": "supply_price"
|
1669 |
+
},
|
1670 |
+
{
|
1671 |
+
"name": "lead_time"
|
1672 |
+
}
|
1673 |
+
]
|
1674 |
},
|
1675 |
{
|
1676 |
+
"name": "HasCart",
|
1677 |
+
"type": "regular",
|
1678 |
+
"entities": ["User", "ShoppingCart"],
|
1679 |
"cardinalities": {
|
1680 |
+
"User": "1",
|
1681 |
+
"ShoppingCart": "1"
|
1682 |
+
},
|
1683 |
+
"attributes": []
|
1684 |
},
|
1685 |
{
|
1686 |
+
"name": "CartContains",
|
1687 |
+
"type": "identifying",
|
1688 |
+
"entities": ["ShoppingCart", "CartItem"],
|
1689 |
"cardinalities": {
|
1690 |
+
"ShoppingCart": "1",
|
1691 |
+
"CartItem": "M"
|
1692 |
+
},
|
1693 |
+
"attributes": []
|
1694 |
},
|
1695 |
{
|
1696 |
+
"name": "CartHasProduct",
|
1697 |
"type": "regular",
|
1698 |
+
"entities": ["CartItem", "Product"],
|
1699 |
"cardinalities": {
|
1700 |
+
"CartItem": "M",
|
1701 |
+
"Product": "1"
|
1702 |
+
},
|
1703 |
+
"attributes": []
|
1704 |
}
|
1705 |
]
|
1706 |
}
|