Skip to content

Instantly share code, notes, and snippets.

@edsu edsu/properties
Created Jan 6, 2009

Embed
What would you like to do?
bibo.py
#!/usr/bin/env python
# awful hack to print out bibo classes, and the properties that hang off of
# them directly
import rdflib
g = rdflib.ConjunctiveGraph()
g.parse('http://purl.org/ontology/bibo/')
owl = rdflib.Namespace('http://www.w3.org/2002/07/owl#')
for klass in g.subjects(predicate=rdflib.RDF.type, object=owl.Class):
if not klass.startswith('http://purl.org/ontology/bibo/'):
continue
print
print klass
for property in g.subjects(predicate=rdflib.RDFS.domain, object=klass):
print " " + property
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.