--- id: owlready2 version: "0.51" license: LGPL-3.0-or-later license_treatment: copyleft maintenance: active --- # owlready2 — A package for ontology-oriented programming in Python: load OWL 2.0 ontologies as Python objects, modify them, save them, and perform reasoning via HermiT. Includes an optimized RDF quadstore. License: copyleft · Maintenance: active · Downloads: 96.8K/mo ## What it is and what it does Owlready2 is a Python framework for working with OWL 2.0 ontologies and RDF knowledge graphs as if they were native Python objects. It provides transparent manipulation of ontology classes, instances, and properties, automatic reasoning and classification via embedded reasoners, and an optimized quadstore backend that can handle large-scale RDF datasets. The package supports multiple serialization formats (NTriples, RDF/XML, OWL/XML), SPARQL querying, and can be used as an object-relational mapper for graph-based data storage. The module is designed for knowledge representation and semantic reasoning tasks, particularly in biomedical and scientific domains. It includes built-in support for medical terminologies through PyMedTermino2, allows mixing OWL constructs with Python methods on classes, and integrates with RDFlib. The main constraint is that it distributes as source code only, requiring compilation during installation. Use it for: - Load and programmatically manipulate biomedical ontologies (UMLS, SNOMED CT) for terminology mapping and knowledge extraction. - Build semantic knowledge graphs by creating OWL classes and instances in Python, then export to standard RDF/XML formats. - Query and reason over large RDF datasets using SPARQL and automatic classification with HermiT or Pellet reasoners. - Use as a graph database alternative for ontology-backed object storage with semantic reasoning capabilities. - Integrate OWL-based domain models into Python applications while maintaining OWL 2.0 compliance and reasoning. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Owlready2 is a Python module for ontology-oriented programming that loads, manipulates, and reasons over OWL 2.0 ontologies and RDF knowledge graphs, with an embedded optimized quadstore and support for HermiT/Pellet reasoners. Yes, with conditions. Owlready2 is production-stable, actively maintained, and solves a specific problem—ontology-oriented programming in Python. The copyleft LGPL-3.0-or-later license is acceptable for most open-source projects but requires review for proprietary use. High install friction (source-only distribution requiring compilation) is a real barrier; ensure your environment has a C compiler and development headers. If you need OWL/RDF manipulation, semantic reasoning, or knowledge graph management in Python, it is worth the setup cost. ## Install pip install owlready2 uv add owlready2 poetry add owlready2 ## Installing owlready2 Before you install: High install friction due to source-only distribution (tar.gz); requires compilation. Actively maintained with recent release (53 days old) and production-stable status, supporting Python 3.6–3.10 and PyPy. License in practice: Licensed under LGPL-3.0-or-later (copyleft). Derivative works and modifications must be distributed under the same license; proprietary use requires careful review of linking obligations. Quickstart: from owlready2 import * onto = get_ontology("http://example.org/ontology.owl") onto.load() results = list(default_world.sparql("SELECT * { ?x a owl:Class . }")) Requires compilation from source (tar.gz); ensure a C compiler and development headers are available. Verify before relying: - Whether the included HermiT and Pellet reasoners are fully functional or require external setup. - Performance characteristics and scalability limits beyond the stated 1 billion RDF triples claim. - Whether PyMedTermino2 submodule for UMLS/DBpedia requires additional dependencies or configuration. ## Package facts - License: LGPL-3.0-or-later (copyleft) - Python support: supports_current - Install friction: high - Maintenance: active - Downloads: 96.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags OWL ontology Python, RDF quadstore, semantic reasoning Python, knowledge graph management, ontology-oriented programming, OWL 2.0 loader, SPARQL queries Python, ontology-reasoning, knowledge-graphs, semantic-web [View on SkillFed](https://skillfed.io/packages/owlready2) · [View on PyPI](https://pypi.org/project/owlready2/)