A Python project for working with RDF/OWL ontologies
Project description
RDFLIb-based Python toolkit for inspecting ontologies on the Semantic Web.
Description
OntosPy allows you to extract all the schema information from an RDFS/OWL ontology, inspect it and use it query a corresponding knowledge base.
The basic worflow is simple: load an ontology by instantiating the Ontology class; you get back an object that lets you interrogate the RDFS/OWL schema. That’s all!
For more up to date documentation, please visit https://github.com/lambdamusic/OntoSPy
Example
Import ontosPy and instantiate the Ontology object with the FOAF ontology:
In [1]: from ontospy.ontospy import * In [2]: onto = Ontology("http://xmlns.com/foaf/spec/20100809.rdf") In [3]: onto.toplayer Out[3]: [rdflib.URIRef('http://xmlns.com/foaf/0.1/Agent'), rdflib.URIRef('http://www.w3.org/2000/01/rdf-schema#Class'), rdflib.URIRef('http://www.w3.org/2004/02/skos/core#Concept'), rdflib.URIRef('http://xmlns.com/foaf/0.1/Document'), rdflib.URIRef('http://xmlns.com/foaf/0.1/LabelProperty'), rdflib.URIRef('http://www.w3.org/2000/01/rdf-schema#Literal'), rdflib.URIRef('http://www.w3.org/2000/10/swap/pim/contact#Person'), rdflib.URIRef('http://xmlns.com/foaf/0.1/Project'), rdflib.URIRef('http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing'), rdflib.URIRef('http://www.w3.org/2002/07/owl#Thing')] In [4]: onto.printClassTree() foaf:Agent ----foaf:Group ----foaf:Organization ----foaf:Person rdfs:Class http://www.w3.org/2004/02/skos/core#Concept foaf:Document ----foaf:Image ----foaf:PersonalProfileDocument foaf:LabelProperty rdfs:Literal http://www.w3.org/2000/10/swap/pim/contact#Person ----foaf:Person foaf:Project http://www.w3.org/2003/01/geo/wgs84_pos#SpatialThing ----foaf:Person owl:Thing ----foaf:OnlineAccount --------foaf:OnlineChatAccount --------foaf:OnlineEcommerceAccount --------foaf:OnlineGamingAccount
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ontospy-1.2.1.tar.gz
(27.4 kB
view hashes)
Built Distribution
Close
Hashes for ontospy-1.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee98f9c3d526f568e60d68c4ece1a9ed124e34acfddfd7fb8ad8fe7541ca03ad |
|
MD5 | 428244c348d3adb4520bfe20a191be59 |
|
BLAKE2b-256 | 39fea108fa88a3211151da2ee3f8967d678bc7ba4ab7ccd3cd3970d410254192 |