agentleFS
stevemarksavastevemarksava/superteam/skills/semantic-reasoning/SKILL.md

semantic-reasoning

Skill1 starsChanged 2 months agoMITView on GitHub

Reason over a knowledge graph — SPARQL query design, OWL inferencing, SHACL validation, provenance-cited results.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 4 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Identify the inference goal: Write down the question in plain English first.

    line 19
  2. Distinctive:

    Validate with SHACL: Write SHACL shapes for the constraints the domain requires (cardinality, value ranges, type membership).

    line 22
  3. Distinctive:

    Never return an inferred fact without naming the rule that produced it

    line 32
  4. Distinctive:

    Always validate the graph with SHACL before publishing results

    line 33

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/semantic-reasoning — Inference Over a Knowledge Graph

Semantic reasoning turns an ontology from static schema into active inference. Given facts and rules, a reasoner derives new facts. Given questions, SPARQL retrieves them with provenance. This is the layer that makes M365 Work IQ output actionable, not just retrievable.

When to invoke

  • An ontology exists (see /ontology) and a decision needs the graph to answer questions
  • Work IQ / M365 semantic index returns candidates and you need to filter/rank by rules
  • Athanasios is building a citation-heavy brief that requires provenance
  • Atlas or Bob needs to verify a graph's consistency (SHACL constraints)

Steps

  1. Load the ontology and instance data. Point the reasoner at the TTL/JSON-LD schema plus the instance graph. Confirm both parse cleanly (no undefined properties, no dangling references).
  2. Identify the inference goal. Write down the question in plain English first. Example: "Which projects have both a delivery risk and no assigned owner?" Explicitness prevents scope creep in the query.
  3. Design the SPARQL query. Draft the query with named graphs for provenance. Use OPTIONAL for missing-data checks, FILTER NOT EXISTS for negations, ?g graph variable to track source. Test on a small subset first.
  4. Run the reasoner. Apache Jena (OWL RL / OWL Mini rules) is the default — active, stable, no license friction. HermiT and Openllet are OWL 2 DL alternatives when full DL reasoning is required. Verify the current stable release at author time. Capture inferred triples for audit.
  5. Validate with SHACL. Write SHACL shapes for the constraints the domain requires (cardinality, value ranges, type membership). Run validation. Report violations with node paths and offending values.
  6. Cite provenance. For every returned fact, include the source graph, the ontology term, and the reasoner rule that produced it (if inferred, not asserted). No answer ships without a citation trail.

Deliverable format

  • query.sparql — the exact query executed
  • results.json — bindings with ?source_graph, ?asserted_or_inferred, ?rule_applied
  • shapes.ttl — SHACL shapes plus a validation report
  • One-paragraph plain-English answer to the original question, citing 2-5 provenance links

Non-negotiables

  • Never return an inferred fact without naming the rule that produced it
  • Always validate the graph with SHACL before publishing results
  • Reasoner and version pinned in the deliverable — reproducibility matters
  • Escape RDF-star / named-graph metadata explicitly when relevant — never conflate assertion with observation

References

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.