--- a/ontologies/specgen/libvocab.py Thu Oct 20 01:13:06 2011 +0200
+++ b/ontologies/specgen/libvocab.py Thu Oct 20 09:45:43 2011 +0200
@@ -236,7 +236,12 @@
self.dir = dir
self.filename = os.path.join(dir, f)
# print "ontology file name ", self.filename
- self.graph.parse(self.filename)
+ if (self.filename.endswith(".n3")):
+ self.graph.parse(self.filename, format="n3")
+ elif(self.filename.endswith(".rdf")):
+ self.graph.parse(self.filename, format="xml")
+ else:
+ self.graph.parse(self.filename)
self.terms = []
self.uterms = []
# should also load translations here?
@@ -244,7 +249,8 @@
##if f != None:
## self.index()
- self.ns_list = { "http://www.w3.org/1999/02/22-rdf-syntax-ns#" : "rdf",
+ self.ns_list = {
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#" : "rdf",
"http://www.w3.org/2000/01/rdf-schema#" : "rdfs",
"http://www.w3.org/2002/07/owl#" : "owl",
"http://www.w3.org/2001/XMLSchema#" : "xsd",