{"id":34250102,"url":"https://github.com/solidlabresearch/tulna-rs","last_synced_at":"2026-05-25T20:04:18.732Z","repository":{"id":327650125,"uuid":"1103782281","full_name":"SolidLabResearch/tulna-rs","owner":"SolidLabResearch","description":"A Rust library for RDF graph isomorphism and semantic query equivalence checking using an efficient hash-based grounding algorithm to detect the graph isomorphism.","archived":false,"fork":false,"pushed_at":"2025-12-05T18:52:25.000Z","size":78,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-08T06:33:25.284Z","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":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SolidLabResearch.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-25T10:28:47.000Z","updated_at":"2025-12-05T18:52:29.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/SolidLabResearch/tulna-rs","commit_stats":null,"previous_names":["solidlabresearch/tulna-rs"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/SolidLabResearch/tulna-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidLabResearch%2Ftulna-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidLabResearch%2Ftulna-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidLabResearch%2Ftulna-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidLabResearch%2Ftulna-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SolidLabResearch","download_url":"https://codeload.github.com/SolidLabResearch/tulna-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SolidLabResearch%2Ftulna-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27761727,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-16T02:00:10.477Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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-12-16T09:11:35.451Z","updated_at":"2025-12-16T09:11:38.327Z","avatar_url":"https://github.com/SolidLabResearch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tulna-rs\n\nA Rust library for RDF graph isomorphism and semantic query equivalence checking using an efficient hash-based grounding algorithm to detect the graph isomorphism.\n\n\u003e **Etymology**: The name \"tulna\" is inspired by the Hindi word *Tulanā* (तुलना), which means \"comparison\" — reflecting the library's purpose of comparing RDF graphs and semantic queries.\n\n## Features\n\n- **Graph Isomorphism** - Efficient RDF graph structural comparison\n- **Query Isomorphism** - Semantic equivalence checking for SPARQL, RSP-QL, and Janus-QL\n- **Auto-Detection** - Automatically detect query language type\n- **Stream Support** - Full support for streaming query extensions\n\n## Installation\n\n```toml\n[dependencies]\ntulna-rs = \"0.1.2\"\n```\n\n## Quick Start\n\n### Graph Isomorphism\n\nCompare RDF graphs directly:\n\n```rust\nuse tulna_rs::graph::{GraphIsomorphism, Triple, TripleNode};\n\nlet graph1 = vec![\n    Triple {\n        subject: TripleNode::Variable(\"x\".to_string()),\n        predicate: TripleNode::IRI(\"http://example.org/knows\".to_string()),\n        object: TripleNode::Variable(\"y\".to_string()),\n    }\n];\n\nlet graph2 = vec![\n    Triple {\n        subject: TripleNode::Variable(\"person\".to_string()),\n        predicate: TripleNode::IRI(\"http://example.org/knows\".to_string()),\n        object: TripleNode::Variable(\"friend\".to_string()),\n    }\n];\n\nlet result = GraphIsomorphism::are_isomorphic(\u0026graph1, \u0026graph2)?;\nassert!(result); // true - same structure, different variable names\n```\n\n### Query Isomorphism\n\nCompare SPARQL/RSP-QL/JanusQL queries:\n\n```rust\nuse tulna_rs::query::QueryIsomorphismAPI;\n\nlet query1 = \"SELECT ?s ?p ?o WHERE { ?s ?p ?o . }\";\nlet query2 = \"SELECT ?x ?y ?z WHERE { ?x ?y ?z . }\";\n\nlet result = QueryIsomorphismAPI::is_isomorphic(query1, query2)?;\nassert!(result); // true - semantically equivalent\n```\n\n## Supported Query Languages\n\n- **SPARQL 1.1** - Standard SELECT queries\n- **RSP-QL** - Streaming with RANGE/STEP windows\n- **JanusQL** - Historical windows with OFFSET/START/END\n\n## Algorithm\n\nUses a hash-based grounding algorithm that:\n1. Separates blank and non-blank nodes\n2. Iteratively hashes blank nodes based on structural signatures\n3. Grounds nodes with unique signatures\n4. Only recurses on ambiguous cases\n\n## Examples\n\nRun included examples:\n\n```bash\n# Graph isomorphism examples\ncargo run --example graph_isomorphism\n\n# Query isomorphism examples\ncargo run --example query_isomorphism\n```\n\n## API Overview\n\n### Graph API\n\n```rust\nuse tulna_rs::graph::{GraphIsomorphism, Triple, TripleNode};\n\n// Check if two graphs are isomorphic\nGraphIsomorphism::are_isomorphic(\u0026graph1, \u0026graph2)?;\n```\n\n### Query API\n\n```rust\nuse tulna_rs::query::{QueryIsomorphismAPI, QueryLanguage};\n\n// Check query isomorphism\nQueryIsomorphismAPI::is_isomorphic(query1, query2)?;\n\n// Detect query language\nQueryIsomorphismAPI::detect_query_language(query);\n\n// Extract basic graph pattern\nQueryIsomorphismAPI::extract_bgp(query)?;\n\n// Compare with details\nQueryIsomorphismAPI::compare_queries(query1, query2)?;\n```\n\n## Testing\n\n```bash\n# Run all tests\ncargo test\n\n# Run with output\ncargo test -- --nocapture\n\n# Generate documentation\ncargo doc --open\n```\n\n## Use Cases\n\n**Graph Isomorphism:**\n- RDF dataset comparison and deduplication\n- Testing RDF transformations\n- Normalizing data with blank nodes\n\n**Query Isomorphism:**\n- Query optimization and caching\n- Duplicate detection in query logs\n- Query equivalence testing\n\n## Documentation\n\n- API documentation: `cargo doc --open`\n- Examples: `examples/` directory\n- Tests: `tests/` directory\n\n## Dependencies\n\n- `regex` - Query parsing\n- `murmur3` - Hash function for the grounding algorithm\n\n## License\n\nCopyright by [Ghent University - imec](https://www.ugent.be/ea/idlab/en)\n\nReleased under the [MIT License](./LICENSE)\n\n## Acknowledgments\n\nAlgorithm based on:\n- [RDF isomorphism in RDF.rb](http://blog.datagraph.org/2010/03/rdf-isomorphism)\n- [Jeremy Carroll's work](http://www.hpl.hp.com/techreports/2001/HPL-2001-293.pdf)\n- [rdf-isomorphic.js](https://github.com/rubensworks/rdf-isomorphic.js/) by @rubensworks\n\n## Contributing\n\n\nBefore submitting a pull request, ensure:\n- All tests pass: `cargo test`\n- Code is formatted: `cargo fmt`\n- Documentation builds: `cargo doc --no-deps`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidlabresearch%2Ftulna-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidlabresearch%2Ftulna-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidlabresearch%2Ftulna-rs/lists"}