mcp_sparql_update
Execute SPARQL update queries to modify data in GraphDB repositories. Supports INSERT DATA, DELETE DATA, INSERT-WHERE, and DELETE-WHERE operations for adding, removing, or updating triples in ontology graphs.
Instructions
SPARQL 업데이트 쿼리를 실행하여 데이터를 수정합니다. INSERT DATA, DELETE DATA, INSERT-WHERE, DELETE-WHERE 등의 SPARQL 1.1 Update 문법을 지원합니다. 새로운 트리플 추가, 기존 트리플 삭제, 조건부 데이터 변경 등 다양한 그래프 수정 작업을 수행할 수 있습니다.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| endpoint | No | SPARQL 엔드포인트 URL | |
| query | Yes | 실행할 SPARQL 업데이트 쿼리 (예: INSERT DATA { <subject> <predicate> <object> }) | |
| repository | No | 업데이트 쿼리를 실행할 리포지토리 이름 |
Input Schema (JSON Schema)
{
"properties": {
"endpoint": {
"description": "SPARQL 엔드포인트 URL",
"type": "string"
},
"query": {
"description": "실행할 SPARQL 업데이트 쿼리 (예: INSERT DATA { <subject> <predicate> <object> })",
"type": "string"
},
"repository": {
"description": "업데이트 쿼리를 실행할 리포지토리 이름",
"type": "string"
}
},
"required": [
"query"
],
"type": "object"
}
Implementation Reference
- src/tools/index.ts:92-123 (handler)The handler function that executes the mcp_sparql_update tool by calling SparqlService.updateQuery.async handler(args: UpdateQueryArgs): Promise<ToolResponse> { try { if (args.endpoint) { const service = new SparqlService({ endpoint: args.endpoint, defaultRepository: args.repository || '' }); const result = await service.updateQuery(args.query, args.repository); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } else { const result = await sparqlService.updateQuery(args.query, args.repository); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } } catch (error) { return { content: [{ type: 'text', text: `업데이트 쿼리 실행 오류: ${error instanceof Error ? error.message : String(error)}` }] }; } }
- src/tools/index.ts:74-91 (schema)The input schema defining parameters for the mcp_sparql_update tool.inputSchema: { type: 'object', properties: { query: { type: 'string', description: '실행할 SPARQL 업데이트 쿼리 (예: INSERT DATA { <subject> <predicate> <object> })' }, repository: { type: 'string', description: '업데이트 쿼리를 실행할 리포지토리 이름' }, endpoint: { type: 'string', description: 'SPARQL 엔드포인트 URL' } }, required: ['query'] },
- src/index.ts:24-56 (registration)MCP server capabilities registration listing mcp_sparql_update as available tool.capabilities: { tools: { mcp_sparql_execute_query: true, mcp_sparql_update: true, mcp_sparql_list_repositories: true, mcp_sparql_list_graphs: true, mcp_sparql_get_resource_info: true, mcp_ollama_run: true, mcp_ollama_show: true, mcp_ollama_pull: true, mcp_ollama_list: true, mcp_ollama_rm: true, mcp_ollama_chat_completion: true, mcp_ollama_status: true, mcp_http_request: true, mcp_openai_chat: true, mcp_openai_image: true, mcp_openai_tts: true, mcp_openai_transcribe: true, mcp_openai_embedding: true, mcp_gemini_generate_text: true, mcp_gemini_chat_completion: true, mcp_gemini_list_models: true, mcp_gemini_generate_images: false, mcp_gemini_generate_image: false, mcp_gemini_generate_videos: false, mcp_gemini_generate_multimodal_content: false, mcp_imagen_generate: false, mcp_gemini_create_image: false, mcp_gemini_edit_image: false }, }, }
- src/types/index.ts:113-117 (schema)TypeScript interface defining the input arguments for the SPARQL update tool.export interface UpdateQueryArgs { query: string; repository?: string; endpoint?: string; }