Created
January 6, 2009 04:22
-
-
Save edsu/43667 to your computer and use it in GitHub Desktop.
bibo.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 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