Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if False:
onto = Model(argv[0])
for x in onto.get_classes():
print(x)
onto.buildPythonClasses()
s = Sketch()
else:
intro = """Good morning. Ready to Turtle away. Type docs() for help."""
# idea: every time provide a different ontology maxim!
def docs():
print("\n".join([x.strip() for x in Sketch.__doc__.splitlines()]))
default_sketch = Sketch()
def add(text=""):
default_sketch.add(text)
def show(aformat=None):
if aformat:
default_sketch.show(aformat)
else:
default_sketch.show()
def bind(prefixTuple):
default_sketch.bind(prefixTuple)
def clear():
default_sketch.clear()
def omnigraffle():
default_sketch.omnigraffle()
September 18, 2014: if an arg is passed, we visualize it
Otherwise a simple shell gets opened.
"""
print("Ontospy " + ontospy.VERSION)
ontospy.get_or_create_home_repo()
if argv:
print("Argument passing not implemented yet")
if False:
onto = Model(argv[0])
for x in onto.get_classes():
print(x)
onto.buildPythonClasses()
s = Sketch()
else:
intro = """Good morning. Ready to Turtle away. Type docs() for help."""
# idea: every time provide a different ontology maxim!
def docs():
print("\n".join([x.strip() for x in Sketch.__doc__.splitlines()]))
default_sketch = Sketch()
def add(text=""):
default_sketch.add(text)
def show(aformat=None):
if aformat:
default_sketch.show(aformat)
def docs():
print("\n".join([x.strip() for x in Sketch.__doc__.splitlines()]))
def __init__(self, text=""):
super(Sketch, self).__init__()
self.rdflib_graph = rdflib.Graph()
self.namespace_manager = NamespaceManager(self.rdflib_graph)
self.SUPPORTED_FORMATS = ['xml', 'n3', 'turtle', 'nt', 'pretty-xml', 'dot']
PREFIXES = [
("", "http://this.sketch#"),
("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
("rdfs", "http://www.w3.org/2000/01/rdf-schema#"),
("xml", "http://www.w3.org/XML/1998/namespace"),
("xsd", "http://www.w3.org/2001/XMLSchema#"),
('foaf', "http://xmlns.com/foaf/0.1/"),
("skos", "http://www.w3.org/2004/02/skos/core#"),
("owl", "http://www.w3.org/2002/07/owl#"),
]