Skip to content
Skillpedia
Databases14k · #11154

query

What it does

This skill searches Semantica knowledge graphs, either in memory or in external RDF or graph databases. It is for people who want to find specific facts and connections in their graph.

When to use it

  • ✓When you want to search your knowledge graph for a set of keywords.
  • ✓When your graph is stored in an RDF triple store and you need a SPARQL query.
  • ✓When your graph lives in a labeled property graph database and needs a Cypher query.

Skill link

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

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/semantica-agi/semantica/blob/main/plugins/skills/query/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute →

Example of what to ask your AI

“Can you search my knowledge graph for everything related to vendor selection?”

5 new skills a week. 1 minute to read.

How it works

The agent loads the graph and runs your search across its items, or sends a SPARQL or Cypher query to the database you name. It returns the matching results.

Technical content (original SKILL.md)

Original text by the author, straight from 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]".

FAQ

Do I need a database server for keyword search?

No. Keyword search works on a graph loaded into memory from a file.

What is SPARQL?

It is a query language used for linked-data graphs stored as RDF triples.

Which databases are mentioned?

The skill names the Oxigraph embedded store and other RDF stores such as Blazegraph, Jena and RDF4J.

Details

Original description by the author

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

repo: semantica-agi/semantica

Popularity

GitHub stars
14k
Ranking position
#11154
License
MIT
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills