mobr/ cap:latest

58 1 month ago

cap (cardano analytics platform) is a specialized SPARQL query generator powered by in-context learning on the Cardano blockchain ontology. It transforms natural language questions about Cardano's blockchain into SPARQL queries.

tools thinking
ollama run mobr/cap

Details

1 month ago

8cb3d3b4b4f1 · 9.3GB ·

qwen3
·
14.8B
·
Q4_K_M
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR US
### Instructions You are a Cardano Analytics Platform called CAP, wich is an expert in the cardano b
openai-cc-by-nc-4.0
{{- $lastUserIdx := -1 -}} {{- range $idx, $msg := .Messages -}} {{- if eq $msg.Role "user" }}{{ $la
{ "num_ctx": 30720, "repeat_penalty": 1.2, "stop": [ "</s>" ], "temperat
[{"role":"user","content":"\n You are a SPARQL query generator for the cardano blockchain domain.\n

Readme

This model is part of the Cardano Analytics Platform powered by LLM, a project funded by Project Catalyst Fund 13.

Usage

ollama pull mobr/cap

Run the model

ollama run mobr/cap

Example prompts and responses

Prompt: What is an epoch?
Response:

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?def
WHERE {
    ?x rdfs:label "Epoch" .
    ?x rdfs:comment ?def .
}

Prompt: How many transactions in the Cardano network?
Response:

PREFIX blockchain: <http://www.mobr.ai/ontologies/blockchain#>

SELECT (COUNT(?s) AS ?count)
WHERE {
    ?s a blockchain:Transaction .
}

Prompt: What is the average of transactions per block in the last week?
Response:

PREFIX blockchain: <http://www.mobr.ai/ontologies/blockchain#>

SELECT
    (COUNT(DISTINCT ?block) AS ?totalBlocks)
    (COUNT(?transaction) AS ?txCount)
    (?totalTransactions / ?totalBlocks AS ?avgTransactionsPerBlock)
WHERE {
    ?block a blockchain:Block ;
            blockchain:hasTimestamp ?timestamp ;
            blockchain:hasTransaction ?transaction .

    FILTER (?timestamp >= NOW() - "P7D"^^xsd:duration)
}

Key Features

  • Output Only SPARQL: Generates valid SPARQL queries with no explanations, comments, or natural language—strictly query syntax.
  • Cardano Ontology Focus: Leverages the Cardano Ontology (v0.0.1) as context, covering blocks, transactions, staking pools, native tokens (CNTs), governance, epochs, and more.
  • Analytical Queries: Handles metrics (e.g., transaction counts, staking rewards, top holders) and definitions (e.g., “What is a stake pool?”).
  • Time Filters: Supports queries with temporal constraints (e.g., last 24h, weekly averages) using SPARQL’s FILTER and NOW().
  • Complex Aggregations: Computes averages, sums, counts, and percentiles (e.g., top 1% holders, vote counts).

Parameters

  • Temperature: 0.0 (deterministic outputs)
  • Top_p: 1.0
  • Context Length: 30,720 tokens
  • Repeat Penalty: 1.2
  • Stop Token: </s>

License

OpenAI CC-BY-NC-4.0 (non-commercial use). Ontology under Apache 2.0.

For integration with Cardano data pipelines, see the project repo.