{"library":"pymantic","title":"Pymantic","description":"Pymantic is a Semantic Web and RDF library for Python, providing parsers, serializers, and SPARQL client support. The latest version is 1.0.1 (released 2024) with slow release cadence. It supports RDF/XML, Turtle, JSON-LD, TriG, and N-Triples formats.","language":"python","status":"active","last_verified":"Mon Apr 27","install":{"commands":["pip install pymantic"],"cli":null},"imports":["from pymantic.sparql import SPARQLClient","from pymantic.io import Graph","from pymantic.io import RDFXMLParser","from pymantic.io import TurtleParser","from pymantic.io import JSONLDParser","from pymantic.io import TriGSerializer"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from pymantic.io import Graph\nfrom pymantic.sparql import SPARQLClient\n\n# Create a graph and parse a Turtle file\ngraph = Graph()\ngraph.parse('example.ttl', format='turtle')\nprint(f\"Parsed {len(graph.triples)} triples\")\n\n# Query a SPARQL endpoint\nclient = SPARQLClient('http://dbpedia.org/sparql')\nresults = client.query('SELECT * WHERE {?s ?p ?o} LIMIT 10')\nfor result in results['results']['bindings']:\n    print(result)","lang":"python","description":"Basic usage: parse a Turtle file and query a SPARQL endpoint.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}