다음을 통해 공유


Microsoft Fabric의 Cosmos DB에 있는 샘플 데이터 집합

Microsoft Fabric의 Cosmos DB 데이터베이스 워크로드는 NoSQL 데이터베이스 패턴을 탐색, 학습 및 실험하는 데 도움이 되는 기본 제공 샘플 데이터 집합을 제공합니다. 이 데이터 세트는 제품 및 고객 검토가 포함된 전자 상거래 시나리오를 나타내며, 서로 다른 엔터티 형식이 동일한 컨테이너에서 어떻게 공존하는지를 보여 줍니다.

다음 두 가지 샘플 데이터 집합을 사용할 수 있습니다.

  • 표준 샘플 데이터: 제품 및 리뷰가 포함된 핵심 전자 상거래 데이터
  • 벡터 샘플 데이터: 의미 체계 검색 시나리오에 대해 OpenAI의 text-embedding-ada-002 모델을 사용하여 생성된 1536차원 벡터 포함을 포함하는 향상된 버전입니다.

데이터 세트 개요

두 샘플 데이터 집합 모두 두 문서 형식의 동일한 전자 상거래 데이터를 포함합니다.

  • 제품 문서 (docType: "product") - 이름, 설명, 재고, 현재 가격 및 해당 제품에 대한 가격 기록의 포함된 배열이 포함된 개별 제품입니다.
  • 문서 검토 (docType: "review") - 고객 리뷰 및 등급이 productId을 통해 제품에 연결됨

벡터 샘플 데이터 집합은 표준 샘플 데이터 집합을 기반으로 합니다. 벡터 데이터 세트의 제품 문서에는 의미 검색 기능을 위한 1536차원의 임베딩을 포함하는 추가 속성이 vectors 포함됩니다.

비고

당신은 데이터 세트와 OpenAI text-embedding-3-large 모델을 사용하여 512차원의 벡터로 생성된 추가 데이터 세트를 Fabric의 Cosmos DB 샘플 데이터 세트 폴더 - 샘플 리포지토리에서 찾을 수 있습니다.

문서 스키마

제품 문서 스키마

제품 문서에는 전자 상거래 카탈로그의 개별 항목에 대한 자세한 정보가 포함되어 있습니다.

재산 유형 설명
id string GUID 형식의 제품에 대한 고유 식별자
docType string 문서 형식 식별자, 항상 "product"
productId string 제품 문서와 id 동일한 제품 식별자
name string 제품 표시 이름
description string 자세한 제품 설명
categoryName string 제품 범주(예: "컴퓨터, 노트북", "미디어", "액세서리")
inventory number 현재 재고가 있는 항목 수
firstAvailable string 제품을 사용할 수 있게 된 날짜(ISO 8601 형식)
currentPrice number 현재 판매 가격
priceHistory array 가격 변경 개체와 dateprice 필드의 배열
priceHistory[].date string ISO 8601 형식의 가격 변경 날짜 및 시간
priceHistory[].price number 지정된 날짜의 가격
vectors array 벡터 샘플 데이터 전용 - 1536차원 벡터 포함

문서 스키마 검토

검토 문서에는 제품에 대한 고객 피드백 및 등급이 포함되어 있습니다.

재산 유형 설명
id string GUID 형식의 검토에 대한 고유 식별자
docType string 문서 형식 식별자, 항상 "review"
productId string 검토 중인 제품의 id 참조사항
categoryName string 제품 범주(검토된 제품에서 상속됨)
customerName string 검토를 작성한 고객의 이름
reviewDate string 검토가 제출된 날짜(ISO 8601 형식)
stars number 고객이 지정한 등급(1-5 척도)
reviewText string 고객의 서면 검토 콘텐츠

비고

Cosmos DB는 모든 문서에 대한 시스템 속성(_rid, _self, _etag, _attachments) _ts을 자동으로 생성합니다.

비고

ISO 8601 형식에 대한 자세한 내용은 국제 날짜 및 시간 표준을 참조하세요. GUID 형식에 대한 자세한 내용은 범용 고유 식별자를 참조하세요.

문서 예

다음 예제에서는 두 샘플 데이터 집합의 문서 구조를 보여 줍니다.

표준 제품 문서 예제

{
  "id": "ae449848-3f15-4147-8eee-fe76cfcc6bb4",
  "docType": "product",
  "productId": "ae449848-3f15-4147-8eee-fe76cfcc6bb4",
  "name": "EchoSphere Pro ANC-X900 Premium Headphones",
  "description": "EchoSphere Pro ANC-X900 Premium Headphones deliver immersive sound with advanced 40mm drivers and Adaptive Hybrid Active Noise Cancellation. Bluetooth 5.3 ensures seamless connectivity.",
  "categoryName": "Accessories, Premium Headphones",
  "inventory": 772,
  "firstAvailable": "2024-01-01T00:00:00",
  "currentPrice": 454.87,
  "priceHistory": [
    {
      "date": "2024-01-01T00:00:00",
      "price": 349.0
    },
    {
      "date": "2024-08-01T00:00:00",
      "price": 363.0
    },
    {
      "date": "2025-04-01T00:00:00",
      "price": 408.14
    },
    {
      "date": "2025-08-01T00:00:00",
      "price": 454.87
    }
  ]
}

벡터화된 제품 문서 예제

{
    "id": "ae449848-3f15-4147-8eee-fe76cfcc6bb4",
    "docType": "product",
    "productId": "ae449848-3f15-4147-8eee-fe76cfcc6bb4",
    "name": "EchoSphere Pro ANC-X900 Premium Headphones",
    "description": "EchoSphere Pro ANC-X900 Premium Headphones deliver immersive sound with advanced 40mm drivers and Adaptive Hybrid Active Noise Cancellation. Bluetooth 5.3 ensures seamless connectivity.",
    "categoryName": "Accessories, Premium Headphones",
    "inventory": 772,
    "firstAvailable": "2024-01-01T00:00:00",
    "currentPrice": 454.87,
    "priceHistory": [
      {
        "date": "2024-01-01T00:00:00",
        "price": 349.0
      },
      {
        "date": "2025-08-01T00:00:00",
        "price": 454.87
      }
    ],
    "vectors": [
      -0.02783808670938015,
      0.011827611364424229,
      -0.04711977392435074,
      // ... (1536 dimensions total)
      0.04251981899142265
    ]
}

문서 검토 예제

검토 문서는 두 샘플 데이터 집합에서 동일합니다.

{
  "id": "fa799013-1746-4a7f-bd0f-2a95b2b76481",
  "docType": "review",
  "productId": "e847e069-d0f9-4fec-b42a-d37cd5b2f536",
  "categoryName": "Accessories, Premium Headphones",
  "customerName": "Emily Rodriguez",
  "reviewDate": "2025-03-02T00:00:00",
  "stars": 5,
  "reviewText": "Excellent sound quality! Premium build! This EchoSphere Pro ANC-X900 exceeded hopes."
}

샘플 데이터를 사용하는 방법

두 샘플 데이터 집합은 모두 Cosmos DB에서 데이터 쿼리, 필터링 및 집계를 연습하는 데 도움이 됩니다. 혼합 문서 형식은 다양한 사용 사례에 대한 현실적인 시나리오를 제공합니다.

표준 샘플 데이터 시나리오

  • 관련 데이터 연결: 리뷰를 제품과 연결 productId
  • 범주 분석: 제품 및 리뷰 조회 categoryName
  • 리뷰 분석: 고객 피드백 패턴 및 등급 분석

일반적인 쿼리 패턴

범주의 모든 제품을 가져옵니다.

SELECT *
FROM c
WHERE 
  c.docType = "product" AND 
  c.categoryName = "Computers, Laptops"

특정 제품에 대한 검토를 가져옵니다.

SELECT *
FROM c
WHERE 
  c.docType = "review" AND 
  c.productId = "77be013f-4036-4311-9b5a-dab0c3d022be"

벡터 샘플 데이터 시나리오

  • 의미 체계 유사성 검색: 벡터 포함을 사용하여 유사한 기능이 있는 제품 찾기
  • 콘텐츠 기반 권장 사항: 설명 유사성에 따라 제품 제안 생성
  • 하이브리드 쿼리: 향상된 결과를 위해 기존 필터를 벡터 유사성과 결합

JSON 스키마

다음 JSON 스키마는 두 샘플 데이터 집합의 문서 구조를 설명합니다. 이러한 스키마를 사용하여 고유한 Cosmos DB 워크로드에 대해 유사한 데이터의 유효성을 검사하거나 생성합니다.

표준 제품 문서 스키마

{
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "docType": { "type": "string" },
    "productId": { "type": "string" },
    "name": { "type": "string" },
    "description": { "type": "string" },
    "categoryName": { "type": "string" },
    "inventory": { "type": "number" },
    "firstAvailable": { "type": "string" },
    "currentPrice": { "type": "number" },
    "priceHistory": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": { "type": "string" },
          "price": { "type": "number" }
        },
        "required": ["date", "price"]
      }
    }
  },
  "required": [
    "id", "docType", "productId", "name", "description", "categoryName", "inventory", "firstAvailable", "currentPrice", "priceHistory"
  ]
}

벡터 사용 제품 문서 스키마

{
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "docType": { "type": "string" },
    "productId": { "type": "string" },
    "name": { "type": "string" },
    "description": { "type": "string" },
    "categoryName": { "type": "string" },
    "inventory": { "type": "number" },
    "firstAvailable": { "type": "string" },
    "currentPrice": { "type": "number" },
    "priceHistory": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "date": { "type": "string" },
          "price": { "type": "number" }
        },
        "required": ["date", "price"]
      }
    },
    "vectors": {
      "type": "array",
      "items": { "type": "number" },
      "minItems": 1536,
      "maxItems": 1536
    }
  },
  "required": [
    "id", "docType", "productId", "name", "description", "categoryName", "inventory", "firstAvailable", "currentPrice", "priceHistory", "vectors"
  ]
}

문서 스키마 검토

{
  "type": "object",
  "properties": {
    "id": { "type": "string" },
    "docType": { "type": "string", "const": "review" },
    "productId": { "type": "string" },
    "categoryName": { "type": "string" },
    "customerName": { "type": "string" },
    "reviewDate": { "type": "string" },
    "stars": { "type": "number" },
    "reviewText": { "type": "string" }
  },
  "required": [
    "id", "docType", "productId", "categoryName", "customerName", 
    "reviewDate", "stars"
  ]
}