Index of every page on this site: llms.txt
All skills
semantica-agi avatar

/query

@63eabcc
by Semanticasemantica-agi/semantica15k stars
1,750
Run it yourself

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

Requires /semantica
Use this Skill: https://skilld.dev/gh/semantica-agi/semantica/query

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

SKILL.md

≈34 tokens for metadata: the name and description. ≈565 when used: this file.

Description uses 1.7% of example budget

Before choosing a Skill, your Agent reads its name and description. All available Skills share that space.

  • A shorter description leaves more room for other Skills. This entry exceeds our 1% size suggestion.

In our Claude Code example, all Skill names and descriptions share 8,000 characters. This Skill uses ≈134 characters, or 1.7%.

The 1% threshold is a size suggestion. Longer descriptions can still fit.

Your model, settings, and other Skills decide how much text your Agent can read.

Example settings and source

The example uses a 200k-token context and default Claude Code settings. The count includes the name, description, separators, and when_to_use when present. Codex also counts local file paths.

Skit's source and limits: Codex 0.160.1, Claude Code 2.1.292.

/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]".

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts2mo3 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides standard tools and documentation for querying knowledge graphs using the Semantica library. It supports local file-based search, SPARQL endpoints, and Cypher-based property graphs. All documented functionality is consistent with its stated purpose as a graph query interface.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

Signed by skilld at 63eabcc. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 2 months ago

README badge

README badge for semantica-agi/semantica/query