적용 대상: ✅Microsoft Fabric✅Azure Data Explorer
비고
이 기능은 현재 공개 미리 보기로 제공됩니다. 기능 및 구문은 일반 공급 전에 변경될 수 있습니다.
함수는 graph , 및 함수와 cluster() 유사한 지속형 그래프 엔터티를 쿼리할 수 있도록 하는 database()external_table()table()내장 함수입니다. 그래프의 최신 스냅샷, 특정 스냅샷 또는 모델에서 임시 그래프 만들기를 지원합니다.
권한
이 함수를 실행하려면 사용자에게 데이터베이스 뷰어 권한이 필요합니다.
문법
graph(
GraphName)
graph(
GraphName,SnapshotName)
graph(
GraphName,snapshot=SnapshotName)
graph(
GraphName,일시적인)
매개 변수
| 이름 | 유형 | 필수 | 설명 |
|---|---|---|---|
| GraphName | string |
✔️ | 쿼리할 그래프 모델의 이름입니다. |
| SnapshotName | string |
검색할 특정 스냅샷의 이름입니다. 지정하지 않으면 가장 최근의 스냅샷이 사용됩니다. | |
| 일시적인 | bool |
이면 true모델에서 임시 그래프를 만듭니다(스냅샷은 사용되지 않음). 이 경우 false이 매개 변수를 생략하는 것과 동일한 최신 스냅샷을 사용합니다. |
반품
함수는 graph 그래프를 반환하고 그래프 연산자 뒤에 와야 합니다. 함수는 지정된 그래프 모델 이름을 다음과 같이 검색합니다.
- 최신 스냅샷(기본값 또는 지정된 경우
false) - 명명된 특정 스냅샷
- 모델의 임시 그래프(지정된 경우
true)
예시
최신 스냅샷 쿼리
다음 예제에서는 "SecurityGraph"라는 지속형 그래프의 최신 스냅샷을 쿼리합니다.
graph("SecurityGraph")
| graph-match (user)-[permission]->(resource)
where user.type == "User" and resource.type == "Database"
project UserName = user.name, ResourceName = resource.name, Permission = permission.type
특정 스냅샷 쿼리
다음 예제에서는 그래프의 특정 스냅샷을 쿼리합니다.
graph("SecurityGraph", "Snapshot_2025_05_01")
| graph-match (attacker)-[attacks]->(target)-[connects]->(system)
where attacker.name == "MaliciousActor"
project Attacker = attacker.name, Target = target.name, System = system.name
명명된 매개 변수 구문을 사용하여 쿼리
다음 예제에서는 명명된 매개 변수 구문을 사용하여 스냅샷을 지정합니다.
graph("SecurityGraph", snapshot="Snapshot_2025_05_01")
| graph-shortest-paths (start)-[e*1..20]->(end)
where start.name == "Alice" and end.name == "Database"
project PathLength = array_length(e), Path = e
모델에서 임시 그래프 만들기
다음 예제에서는 연산자처럼 모델에서 임시 그래프를 make-graph 만듭니다.
graph("SecurityGraph", true)
| graph-match (user)-[permission]->(resource)
where user.type == "User" and resource.type == "Database"
project UserName = user.name, ResourceName = resource.name, Permission = permission.type
false를 사용하여 최신 스냅샷 지정
다음 예제에서는 두 번째 매개 변수를 생략하는 것과 동일한 최신 스냅샷을 사용하도록 명시적으로 지정 false 합니다.
graph("SecurityGraph", false)
| graph-match (user)-[permission]->(resource)
where user.type == "User" and resource.type == "Database"
project UserName = user.name, ResourceName = resource.name, Permission = permission.type