本文へスキップ
Skillpedia
データベース14k · #11154

query

できること

このスキルは、メモリ上またはRDFや外部のグラフデータベース内のSemanticaのナレッジグラフを検索します。グラフの中の特定の事実や関係を見つけたい人向けです。

使う場面

  • ✓ナレッジグラフを一連のキーワードで検索したいとき。
  • ✓グラフがRDFトリプルストアに保存されていて、SPARQLのクエリが必要なとき。
  • ✓グラフがラベル付きプロパティグラフのデータベースにあり、Cypherのクエリが必要なとき。

スキルのリンク

https://github.com/semantica-agi/semantica/blob/main/plugins/skills/query/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/semantica-agi/semantica/blob/main/plugins/skills/query/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ナレッジグラフから、ベンダー選定に関するすべての情報を検索してください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

エージェントはグラフを読み込み、項目全体で検索を実行するか、あなたが指定したデータベースにSPARQLまたはCypherのクエリを送ります。一致した結果を返します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

/semantica:query

Query the graph. Usage: /semantica:query <task> [args]

Which API you want depends on where the graph lives.


search "<keywords>" — the in-memory ContextGraph

This is the one that works with no external server.

import os
from semantica.context import ContextGraph

graph = ContextGraph()
graph.load_from_file(os.path.expanduser("~/.semantica/kg.json"))   # load_from_file does not expand ~

results = graph.query("vendor selection", skip=0, limit=20)

Related lookups on the same object:

graph.find_nodes(...)          graph.find_node(...)
graph.find_related_nodes(...)  graph.get_neighbors(node_id)
graph.find_similar_nodes(...)  graph.get_nodes_by_label(label)

Decision-specific queries belong to /semantica:decision.


sparql "<query>" — RDF triple stores

from semantica.triplet_store import TripletStore

store = TripletStore(backend="oxigraph")       # embedded; needs semantica[tripletstore-oxigraph]
# or backend="blazegraph" | "jena" | "rdf4j" with endpoint="http://..."
result = store.execute_query(sparql)

For query planning, optimisation, and caching over a backend:

from semantica.triplet_store import QueryEngine, OxigraphStore

# QueryEngine needs an object exposing execute_sparql() — the raw backend,
# not the TripletStore wrapper above (which only exposes execute_query()).
backend = OxigraphStore()

qe = QueryEngine()
plan   = qe.plan_query(sparql)
tuned  = qe.optimize_query(sparql)
result = qe.execute_query(sparql, store_backend=backend)
stats  = qe.get_query_statistics()

Blazegraph / Jena / RDF4J need no extra — semantica.triplet_store speaks SPARQL over HTTP using the core requests dependency.


cypher "<query>" — labeled property graphs

from semantica.graph_store import Neo4jStore    # needs semantica[graph-neo4j]

store = Neo4jStore(uri=..., user=..., password=...)
result = store.execute_query(query, parameters={...})

Also available: FalkorDBStore, ApacheAgeStore, AmazonNeptuneStore, and GraphManager / GraphStore for backend-agnostic access.

Not installed in this environment — add the backend extra first, e.g. pip install "semantica[graph-neo4j]".

よくある質問

キーワード検索にデータベースサーバーが必要ですか?

いいえ。キーワード検索は、ファイルからメモリに読み込んだグラフで動きます。

SPARQLとは何ですか?

RDFトリプルとして保存されたリンクデータのグラフに使われる問い合わせ言語です。

どのデータベースが挙げられていますか?

スキルは、組み込みのOxigraphストアと、Blazegraph、Jena、RDF4Jなどのほかの RDF ストアを挙げています。

詳細

作者による元の説明

Query Semantica knowledge graphs — in-memory ContextGraph search, SPARQL over RDF triple stores, and Cypher over LPG backends.

repo: semantica-agi/semantica

人気

GitHubのスター
14k
ランキング
#11154
ライセンス
MIT
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル