> In the current trunk code, as of rev 109,
I've updated to rev 110 to reflect my comments here
> If I comment out 'mapper(Project,Release)' and the Release class, the
> code behaves the same, so how is the Release class meant to be used?
Sorry, It was left incomplete but is now updated.
mapper uses with optional args of classes to map... blank implies map.
mapper will see :
class Project(rdfSubject):
...
releases = rdfMultiple(DOAP.release, range_type=DOAP.Version)
maintainer = rdfSingle(DOAP.maintainer,range_type=FOAF.Person)
and map the return type of the attribute to the class with type
`rdf_type` that matches the descriptors `range_type`
Project.maintainer -> Person() etc
Without mapper, p.releases returns a list of rdfSubject(s)
With mapper, p.releases returns a list of Release(s)
against former, you can call release[DOAP.revision]
against the latter, you can ALSO call release.name
in relational terms, mapper makes the "join" and allows the correct
class to be returned.
>
> print " %s" % release[DOAP['file-release']].resUri
with the mapper you can now say:
print " %s" % release.file_release.resUri
>
> (The sample DOAP you fetch only has one file-release per Version, so
> try a project like 'nut' instead of 'accs')
Thanks, it's in the new doap.py
Think the pastbin is updated too.
--
Phil