Changeset 157
- Timestamp:
- 08/07/10 16:20:33 (18 months ago)
- Files:
-
- 1 modified
-
rdfalchemy/trunk/rdfalchemy/rdfsSubject.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
rdfalchemy/trunk/rdfalchemy/rdfsSubject.py
r153 r157 42 42 _weakrefs = WeakValueDictionary() 43 43 44 def __new__(cls, resUri = None, schemaGraph=None, * *kwargs):44 def __new__(cls, resUri = None, schemaGraph=None, *args, **kwargs): 45 45 if not resUri or isinstance(resUri, BNode) or issubclass(cls, BNode): # create a bnode 46 46 obj = BNode.__new__(cls, resUri) … … 62 62 raise AttributeError("cannot construct rdfSubject from %s"%(str(resUri))) 63 63 64 # At this point we have an obj to return...but we might want to look deeper65 # if there is an RDF:type entry on the Graph, find the mapped subclass and return66 # an object of that new type64 # At this point we have an obj to return...but we might want to look deeper 65 # if there is an RDF:type entry on the Graph, find the mapped subclass and return 66 # an object of that new type 67 67 if resUri: 68 68 rdf_type = obj[RDF.type] … … 75 75 subclass = cls 76 76 77 # improve this do do some kind of hash with classname??78 # this uses _weakrefs to allow us to return an existing object79 # rather than copies77 # improve this do do some kind of hash with classname?? 78 # this uses _weakrefs to allow us to return an existing object 79 # rather than copies 80 80 md5id = obj.md5_term_hash() 81 81 newobj = rdfsSubject._weakrefs.get(md5id,None)
