{
  "@context": {
    "@base": "https://localhost/fuxi-reasoning-demo#",
    "schema": "http://schema.org/",
    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",
    "xsd": "http://www.w3.org/2001/XMLSchema#",
    "ex": "http://example.org/",
    "prov": "http://www.w3.org/ns/prov#"
  },
  "@graph": [
    {
      "@id": "",
      "@type": "schema:Article",
      "schema:name": "FuXi SPARQL Reasoning Demo",
      "schema:description": "FuXi forward-chaining reasoning with SPARQL as the rules language",
      "schema:identifier": "https://localhost/fuxi-reasoning-demo",
      "schema:datePublished": "2026-05-19",
      "schema:hasPart": [
        {"@id": "#fuxiRulesSection"},
        {"@id": "#inferenceSection"},
        {"@id": "#summarySection"},
        {"@id": "#howtoSection"},
        {"@id": "#setupHowto"},
        {"@id": "#faqSection"},
        {"@id": "#glossarySection"}
      ],
      "prov:wasGeneratedBy": [
        {"@id": "#fuxiSkill"},
        {"@id": "#kgGeneratorSkill"}
      ]
    },
    {
      "@id": "#fuxiRulesSection",
      "@type": "schema:ArticleSection",
      "schema:name": "FuXi N3 Rules"
    },
    {
      "@id": "#fuxiRule1",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "Rule 1: Adult Classification",
      "schema:description": "If Person has age >= 18 then classify as Adult",
      "schema:programmingLanguage": "N3",
      "schema:code": "{ ?person ex:hasAge ?age . FILTER(?age >= 18) } => { ?person ex:ageCategory \"Adult\" } ."
    },
    {
      "@id": "#fuxiRule2",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "Rule 2: Minor Classification",
      "schema:description": "If Person has age < 18 then classify as Minor",
      "schema:programmingLanguage": "N3",
      "schema:code": "{ ?person ex:hasAge ?age . FILTER(?age < 18) } => { ?person ex:ageCategory \"Minor\" } ."
    },
    {
      "@id": "#fuxiRule3",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "Rule 3: Parent Relationship",
      "schema:description": "If child is 18+ and parent is 18+ years older, infer valid parent-child",
      "schema:programmingLanguage": "N3",
      "schema:code": "{ ?child ex:hasAge ?cAge ; ex:hasParent ?parent . ?parent ex:hasAge ?pAge . FILTER(?cAge > ?pAge - 18) } => { ?parent ex:hasChildOldEnough ?child } ."
    },
    {
      "@id": "#fuxiRule4",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "Rule 4: Same Age Group",
      "schema:description": "If two persons have ages within 5 years, same age group",
      "schema:programmingLanguage": "N3",
      "schema:code": "{ ?p1 ex:hasAge ?a1 . ?p2 ex:hasAge ?a2 . FILTER(?p1 != ?p2 && abs(?a1 - ?a2) <= 5) } => { ?p1 ex:sameAgeGroupAs ?p2 } ."
    },
    {
      "@id": "#fuxiRule5",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "Rule 5: Senior Classification",
      "schema:description": "If Person has age >= 65 then classify as Senior",
      "schema:programmingLanguage": "N3",
      "schema:code": "{ ?person ex:hasAge ?age . FILTER(?age >= 65) } => { ?person ex:ageCategory \"Senior\" } ."
    },
    {
      "@id": "#inferenceSection",
      "@type": "schema:ArticleSection",
      "schema:name": "FuXi Inference Results"
    },
    {
      "@id": "#adultInference",
      "@type": "schema:CreativeWork",
      "schema:name": "Adult Classification Inference",
      "schema:description": "All persons with age >= 18 inferred as Adults via FuXi forward chaining"
    },
    {
      "@id": "#alice",
      "@type": "schema:Person",
      "schema:name": "Alice",
      "ex:hasAge": 30,
      "ex:ageCategory": "Adult"
    },
    {
      "@id": "#bob",
      "@type": "schema:Person",
      "schema:name": "Bob",
      "ex:hasAge": 25,
      "ex:ageCategory": "Adult"
    },
    {
      "@id": "#carol",
      "@type": "schema:Person",
      "schema:name": "Carol",
      "ex:hasAge": 35,
      "ex:ageCategory": "Adult"
    },
    {
      "@id": "#summarySection",
      "@type": "schema:ArticleSection",
      "schema:name": "Summary"
    },
    {
      "@id": "#howtoSection",
      "@type": "schema:HowTo",
      "schema:name": "FuXi SPARQL Reasoning Guide",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToUseFuXi",
      "schema:step": [
        {"@id": "#step1"},
        {"@id": "#step2"},
        {"@id": "#step3"},
        {"@id": "#step4"},
        {"@id": "#step5"}
      ]
    },
    {
      "@id": "#step1",
      "@type": "schema:HowToStep",
      "schema:name": "Install FuXi",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-InstallFuXi",
      "schema:text": "pip install fuxi",
      "schema:itemListElement": "Ensure Python 3.8+ is installed before proceeding"
    },
    {
      "@id": "#step2",
      "@type": "schema:HowToStep",
      "schema:name": "Create Facts File",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-CreateFactsFile",
      "schema:text": "Create facts.n3 with your base RDF triples in Turtle format",
      "schema:itemListElement": "Include required prefixes (ex:, rdf:, rdfs:)"
    },
    {
      "@id": "#step3",
      "@type": "schema:HowToStep",
      "schema:name": "Write N3 Rules",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-WriteN3Rules",
      "schema:text": "Create rules.n3 with Horn logic rules using SPARQL Graph Patterns",
      "schema:itemListElement": "Use => operator for the consequent"
    },
    {
      "@id": "#step4",
      "@type": "schema:HowToStep",
      "schema:name": "Run Forward Chaining",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-RunForwardChaining",
      "schema:text": "fuxi.core facts.n3 rules.n3",
      "schema:itemListElement": "Uses RETE algorithm for exhaustive inference"
    },
    {
      "@id": "#step5",
      "@type": "schema:HowToStep",
      "schema:name": "Query with Backward Chaining",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-BackwardChaining",
      "schema:text": "fuxi.proof --why='SELECT ?p WHERE { ?p ex:ageCategory \"Adult\" }' facts.n3",
      "schema:itemListElement": "Uses BFP for targeted query resolution"
    },
    {
      "@id": "#setupHowto",
      "@type": "schema:HowTo",
      "schema:name": "Build This Demo",
      "schema:description": "How this FuXi demo was created from scratch",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToBuildDemo",
      "schema:step": [
        {"@id": "#setupStep1"},
        {"@id": "#setupStep2"},
        {"@id": "#setupStep3"},
        {"@id": "#setupStep4"},
        {"@id": "#setupStep5"},
        {"@id": "#setupStep6"}
      ]
    },
    {
      "@id": "#setupStep1",
      "@type": "schema:HowToStep",
      "schema:name": "Create RDF Sample Data",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-CreateRDFSampleData",
      "schema:text": "Write Turtle file with sample persons, properties, and values",
      "schema:itemListElement": "Define schema classes (ex:Person) and properties (ex:hasAge)",
      "schema:itemListElement": "Add instance data (Alice:30, Bob:25, Carol:35)"
    },
    {
      "@id": "#setupStep2",
      "@type": "schema:HowToStep",
      "schema:name": "Load Data to SPARQL Endpoint",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-LoadDataToEndpoint",
      "schema:text": "Upload Turtle to Virtuoso via SPARQL UPDATE or DAV upload",
      "schema:itemListElement": "Use named graph http://example.org/fuxi-demo for isolation",
      "schema:itemListElement": "Verify with SELECT COUNT(*) FROM <fuxi-demo> { ?s ?p ?o }"
    },
    {
      "@id": "#setupStep3",
      "@type": "schema:HowToStep",
      "schema:name": "Test SPARQL Operations",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-TestSPARQL",
      "schema:text": "Run SELECT, CONSTRUCT, DESCRIBE queries to verify data",
      "schema:itemListElement": "Test basic connectivity and triple count",
      "schema:itemListElement": "Verify entity types and schema",
      "schema:itemListElement": "Test CONSTRUCT with inference patterns"
    },
    {
      "@id": "#setupStep4",
      "@type": "schema:HowToStep",
      "schema:name": "Generate RDF Metadata",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-GenerateRDFMetadata",
      "schema:text": "Create schema:Article with hasPart sections for rules, FAQ, glossary",
      "schema:itemListElement": "Add schema:SoftwareSourceCode for N3 rule definitions",
      "schema:itemListElement": "Include schema:FAQPage and schema:DefinedTermSet"
    },
    {
      "@id": "#setupStep5",
      "@type": "schema:HowToStep",
      "schema:name": "Generate HTML Infographic",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-GenerateHTML",
      "schema:text": "Transform RDF to interactive HTML with CSS styling",
      "schema:itemListElement": "Add entity hyperlinks via URIBurner resolver pattern",
      "schema:itemListElement": "Include Run Query buttons with encoded SPARQL URLs"
    },
    {
      "@id": "#setupStep6",
      "@type": "schema:HowToStep",
      "schema:name": "Create Markdown Documentation",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#HowToStep-CreateMarkdownDocs",
      "schema:text": "Generate .md file summarizing rules, queries, and test results",
      "schema:itemListElement": "Document all 11 SPARQL test operations",
      "schema:itemListElement": "Link to RDF, HTML, and endpoint resources"
    },
    {
      "@id": "#fuxiExecution",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "FuXi Execution Commands",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#FuXiCLI",
      "schema:programmingLanguage": "bash",
      "schema:code": "fuxi.core facts.n3\nfuxi.proof --why='ASK { eg:bob ex:isBrotherOf eg:joe }' facts.n3\nfuxi.owl --dlp --method=bfp ontology.ttl"
    },
    {
      "@id": "#cmdForwardChain",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "fuxi.core",
      "schema:description": "Forward chaining via RETE network",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#fuxiCore"
    },
    {
      "@id": "#cmdBackwardChain",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "fuxi.proof",
      "schema:description": "Backward chaining with proof",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#fuxiProof"
    },
    {
      "@id": "#cmdOWL",
      "@type": "schema:SoftwareSourceCode",
      "schema:name": "fuxi.owl",
      "schema:description": "OWL 2 RL reasoning",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#fuxiOWL"
    },
    {
      "@id": "#faqSection",
      "@type": "schema:FAQPage",
      "schema:mainEntity": [
        {"@id": "#fq1"},
        {"@id": "#fq2"},
        {"@id": "#fq3"}
      ]
    },
    {
      "@id": "#fq1",
      "@type": "schema:Question",
      "schema:name": "How does FuXi use SPARQL as the rules language?",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#FAQ-SPARQLAsRulesLanguage",
      "schema:acceptedAnswer": {"@id": "#fa1"}
    },
    {
      "@id": "#fa1",
      "@type": "schema:Answer",
      "schema:text": "FuXi uses SPARQL Graph Patterns as the body (antecedent) of Horn rules in N3 format."
    },
    {
      "@id": "#fq2",
      "@type": "schema:Question",
      "schema:name": "What is forward chaining in FuXi?",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#FAQ-ForwardChaining",
      "schema:acceptedAnswer": {"@id": "#fa2"}
    },
    {
      "@id": "#fa2",
      "@type": "schema:Answer",
      "schema:text": "Forward chaining (bottom-up) uses the RETE algorithm to exhaustively apply N3 rules."
    },
    {
      "@id": "#fq3",
      "@type": "schema:Question",
      "schema:name": "What is backward chaining in FuXi?",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#FAQ-BackwardChaining",
      "schema:acceptedAnswer": {"@id": "#fa3"}
    },
    {
      "@id": "#fa3",
      "@type": "schema:Answer",
      "schema:text": "Backward chaining (top-down) uses BFP to answer queries by finding proofs."
    },
    {
      "@id": "#glossarySection",
      "@type": "schema:DefinedTermSet",
      "schema:name": "FuXi Terms"
    },
    {
      "@id": "#ft1",
      "@type": "schema:DefinedTerm",
      "schema:name": "N3 Rules",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#N3Rules",
      "schema:description": "Notation3 format for Horn logic rules - antecedent => consequent"
    },
    {
      "@id": "#ft2",
      "@type": "schema:DefinedTerm",
      "schema:name": "RETE Algorithm",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#RETEAlgorithm",
      "schema:description": "Forward-chaining algorithm used by FuXi"
    },
    {
      "@id": "#ft3",
      "@type": "schema:DefinedTerm",
      "schema:name": "BFP",
      "schema:url": "https://github.com/chimezie/FuXi-reincarnate/blob/interlocution-proof/skill/SKILL.md#BFP",
      "schema:description": "Breadth-First Proof - backward-chaining decision procedure"
    },
    {
      "@id": "#fuxiSkill",
      "@type": "schema:SoftwareApplication",
      "schema:name": "fuxi-engineer skill",
      "schema:url": "https://github.com/anomalyco/opencode/tree/main/fuxi-engineer"
    },
    {
      "@id": "#kgGeneratorSkill",
      "@type": "schema:SoftwareApplication",
      "schema:name": "kg-generator skill",
      "schema:url": "https://github.com/anomalyco/opencode/tree/main/kg-generator"
    }
  ]
}