{"id":27641,"library":"cfgraph","title":"CFGraph","description":"CFGraph is a Python library that provides a flattening graph for RDFlib collections, converting RDF collection structures into a simplified graph representation. Version 0.2.1 is the latest release, with an irregular release cadence.","status":"active","version":"0.2.1","language":"python","source_language":"en","source_url":"https://github.com/hsolbrig/CFGraph","tags":["rdf","rdflib","collections","graph-flattening"],"install":[{"cmd":"pip install cfgraph","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"CFGraph requires rdflib to work with RDF graphs.","package":"rdflib","optional":false}],"imports":[{"wrong":"from cfgraph import Flattener","symbol":"CFGraph","correct":"from CFGraph import CFGraph"},{"symbol":"Graph","correct":"from CFGraph import Graph"},{"symbol":"BNode","correct":"from CFGraph import BNode"}],"quickstart":{"code":"import rdflib\nfrom cfgraph import Flattener\n\n# Load an RDF graph\ng = rdflib.Graph()\ng.parse('example.ttl', format='turtle')\n\n# Flatten collections\nflattener = Flattener(g)\nflattener.flatten()\n\n# The graph now has flattened collections\nprint(f\"Number of triples after flattening: {len(g)}\")","lang":"python","description":"Basic usage: parse an RDF graph and flatten all collections using the Flattener class."},"warnings":[{"fix":"Use `g2 = rdflib.Graph()` and parse again, or use `g2 = g + g` (but careful with blank nodes).","message":"The Flattener modifies the graph in-place. Make a copy if you need to preserve the original graph.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure your data uses the standard RDF collection pattern.","message":"CFGraph only works with RDF collections that follow the standard rdf:first/rdf:rest pattern. Other collection representations are not supported.","severity":"gotcha","affected_versions":"all"},{"fix":"Use with rdflib < 6.0 or test compatibility.","message":"The library has not been updated in several years and may have compatibility issues with newer versions of rdflib (e.g., rdflib >= 6.0).","severity":"deprecated","affected_versions":"0.2.1"}],"env_vars":null,"search_vec":"'0.2.1':25 'cadenc':34 'cfgraph':1,2 'collect':14,17,37 'convert':15 'flatten':10,40 'graph':11,22,39 'graph-flatten':38 'irregular':32 'latest':28 'librari':6 'provid':8 'python':5 'rdf':16,35 'rdflib':13,36 'releas':29,33 'represent':23 'simplifi':21 'structur':18 'version':24","created_at":"2026-05-09T05:51:19.619034+00:00","updated_at":"2026-05-09T05:51:19.619034+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"http://github.com/hsolbrig/CFGraph","docs":null,"changelog":null,"pypi":"https://pypi.org/project/cfgraph/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-08-02","install_tag":null}}