{"id":26233636,"url":"https://github.com/docknetwork/rify","last_synced_at":"2026-03-01T16:30:57.345Z","repository":{"id":42663033,"uuid":"269207115","full_name":"docknetwork/rify","owner":"docknetwork","description":"RDF fact prover and proof validator operating on simple conjunctive rules.","archived":false,"fork":false,"pushed_at":"2025-12-04T21:33:11.000Z","size":1514,"stargazers_count":9,"open_issues_count":9,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-12-08T05:44:21.320Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/docknetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-03T22:24:40.000Z","updated_at":"2025-12-04T21:33:13.000Z","dependencies_parsed_at":"2025-03-13T01:27:03.232Z","dependency_job_id":null,"html_url":"https://github.com/docknetwork/rify","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/docknetwork/rify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Frify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Frify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Frify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Frify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/docknetwork","download_url":"https://codeload.github.com/docknetwork/rify/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/docknetwork%2Frify/sbom","scorecard":{"id":349247,"data":{"date":"2025-08-11","repo":{"name":"github.com/docknetwork/rify","commit":"efa6d36a4c362a0d6d444ade415820b41cad3bc7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/4 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/default.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/docknetwork/rify/default.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/default.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/docknetwork/rify/default.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/default.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/docknetwork/rify/default.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/default.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/docknetwork/rify/default.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/default.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/docknetwork/rify/default.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"26 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-x9w5-v3q2-3rhw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-434g-2637-qmqr","Warn: Project is vulnerable to: GHSA-49q7-c7j4-3p7m","Warn: Project is vulnerable to: GHSA-977x-g7h5-7qgw","Warn: Project is vulnerable to: GHSA-f7q4-pwc6-w24p","Warn: Project is vulnerable to: GHSA-fc9h-whq2-v747","Warn: Project is vulnerable to: GHSA-vjh7-7g9h-fjfh","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq","Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488","Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-h7cp-r72f-jxh6","Warn: Project is vulnerable to: GHSA-v62p-rq8g-8h59","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T07:53:48.288Z","repository_id":42663033,"created_at":"2025-08-18T07:53:48.288Z","updated_at":"2025-08-18T07:53:48.288Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29974745,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T16:18:32.386Z","status":"ssl_error","status_checked_at":"2026-03-01T16:18:04.258Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-13T01:16:55.855Z","updated_at":"2026-03-01T16:30:57.311Z","avatar_url":"https://github.com/docknetwork.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rify\n\n[![Crates.io](https://img.shields.io/crates/v/rify)](https://crates.io/crates/rify)\n[![Docs](https://docs.rs/rify/badge.svg)](https://docs.rs/rify)\n[![npm](https://img.shields.io/npm/v/rify)](https://www.npmjs.com/package/rify)\n\nRify is a [forward chaining](https://en.wikipedia.org/wiki/Forward_chaining) [inference engine](https://en.wikipedia.org/wiki/Inference_engine) designed specifically for use on in-memory RDF graphs.\n\nIt accepts conjunctive rules with limited expressiveness so reasoning is bounded by `O(n^k)` in both memory and in computation where n is the number of nodes in the input RDF dataset.\n\nGiven premises and target statement[s], rify can generate a proof which can be used to quickly verify the result programatically.\n\nLogical rules are defined as if-then clauses. Something like this:\n\n```rust\nstruct Rule {\n    if_all: Vec\u003c[Entity; 4]\u003e,\n    then: Vec\u003c[Entity; 4]\u003e,\n}\n\n// Notice it's `[Entity; 4]`, not `[Entity; 3]`. This reasoner operates on Rdf Quads, not triples.\n// You can still reason over triples by binding a unique resource e.g. `RdfTerm::DefaultGraph`\n// as the graph in all rules and all quads.\n\nenum Entity {\n    /// A a named variable with an unknown value.\n    Unbound(String),\n    /// A literal with a constant value.\n    Bound(RdfTerm),\n}\n\n// actual definitions of these types are templated but this is the gist\n\n// You get to define this type! Here is an example definition.\nenum RdfTerm {\n    Blank(usize),\n    Iri(String),\n    Literal {\n        datatype: String,\n        value: String,\n        lang_tag: Option\u003cString\u003e,\n    },\n    DefaultGraph,\n}\n```\n\nRify doesn't care whether its input and output is valid rdf. For example, it will happily accept a quad whose predicate is a literal. https://www.w3.org/TR/rdf11-concepts/#section-triples\n\n# Use\n\nThree functions are central to this library: `prove`, `validate`, and `infer`.\n\n## prove\n\n```rust\nuse rify::{\n    prove,\n    Entity::{Unbound, Bound},\n    Rule, RuleApplication,\n};\n\n// (?a, is, awesome) ∧ (?a, score, ?s) -\u003e (?a score, awesome)\nlet awesome_score_axiom = Rule::create(\n    vec![\n        // if someone is awesome\n        [Unbound(\"a\"), Bound(\"is\"), Bound(\"awesome\"), Bound(\"default_graph\")],\n        // and they have some score\n        [Unbound(\"a\"), Bound(\"score\"), Unbound(\"s\"), Bound(\"default_graph\")],\n    ],\n    vec![\n        // then they must have an awesome score\n        [Unbound(\"a\"), Bound(\"score\"), Bound(\"awesome\"), Bound(\"default_graph\")]\n    ],\n).expect(\"invalid rule\");\n\nassert_eq!(\n    prove::\u003c\u0026str, \u0026str\u003e(\n        // list of already known facts (premises)\n        \u0026[\n            [\"you\", \"score\", \"unspecified\", \"default_graph\"],\n            [\"you\", \"is\", \"awesome\", \"default_graph\"]\n        ],\n        // the thing we want to prove\n        \u0026[[\"you\", \"score\", \"awesome\", \"default_graph\"]],\n        // ordered list of logical rules\n        \u0026[awesome_score_axiom]\n    ),\n    Ok(vec![\n        // the desired statement is proven by instantiating the `awesome_score_axiom`\n        // (you is awesome) ∧ (you score unspecified) -\u003e (you score awesome)\n        RuleApplication {\n            rule_index: 0,\n            instantiations: vec![\"you\", \"unspecified\"]\n        }\n    ])\n);\n```\n\n# validate\n\n```rust\nuse rify::{\n    prove, validate, Valid,\n    Rule, RuleApplication,\n    Entity::{Bound, Unbound}\n};\n\n// same as above\nlet awesome_score_axiom = Rule::create(\n    vec![\n        [Unbound(\"a\"), Bound(\"is\"), Bound(\"awesome\"), Bound(\"default_graph\")],\n        [Unbound(\"a\"), Bound(\"score\"), Unbound(\"s\"), Bound(\"default_graph\")],\n    ],\n    vec![[Unbound(\"a\"), Bound(\"score\"), Bound(\"awesome\"), Bound(\"default_graph\")]],\n).expect(\"invalid rule\");\n\nlet proof = vec![\n    // (you is awesome) ∧ (you score unspecified) -\u003e (you score awesome)\n    RuleApplication {\n        rule_index: 0,\n        instantiations: vec![\"you\", \"unspecified\"]\n    }\n];\n\nlet Valid { assumed, implied } = validate::\u003c\u0026str, \u0026str\u003e(\n    \u0026[awesome_score_axiom],\n    \u0026proof,\n).expect(\"invalid proof\");\n\n// Now we know that under the given rules, if all quads in `assumed` are true, then all\n// quads in `implied` are also true.\n```\n\n## infer\n\n```rust\nuse rify::{infer, Entity::{Unbound, Bound}, Rule};\n\n// (?a, is, awesome) ∧ (?a, score, ?s) -\u003e (?a score, awesome)\nlet awesome_score_axiom = Rule::create(\n    vec![\n        // if someone is awesome\n        [Unbound(\"a\"), Bound(\"is\"), Bound(\"awesome\"), Bound(\"default_graph\")],\n        // and they have some score\n        [Unbound(\"a\"), Bound(\"score\"), Unbound(\"s\"), Bound(\"default_graph\")],\n    ],\n    vec![\n        // then they must have an awesome score\n        [Unbound(\"a\"), Bound(\"score\"), Bound(\"awesome\"), Bound(\"default_graph\")]\n    ],\n).expect(\"invalid rule\");\n\nlet mut facts = vec![\n    [\"you\", \"score\", \"unspecified\", \"default_graph\"],\n    [\"you\", \"is\", \"awesome\", \"default_graph\"]\n];\n\nlet new_facts = infer::\u003c\u0026str, \u0026str\u003e(\u0026facts, \u0026[awesome_score_axiom]);\nfacts.extend(new_facts);\n\nassert_eq!(\n    \u0026facts,\n    \u0026[\n        [\"you\", \"score\", \"unspecified\", \"default_graph\"],\n        [\"you\", \"is\", \"awesome\", \"default_graph\"],\n        [\"you\", \"score\", \"awesome\", \"default_graph\"],\n    ],\n);\n```\n\n# Recipes\n\nIn addition to normal cargo commands like `cargo test` and `cargo check` the `./justfile`\ndefines some scripts which can be useful during development. For example, `just js-test` will\ntest the javascript bindings to this library. See `./justfile` for more.\n\n# License\n\nThis project is licensed under either of Apache License, Version 2.0 or MIT license, at your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocknetwork%2Frify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdocknetwork%2Frify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdocknetwork%2Frify/lists"}