generic_resource.py 539 B

123456789101112131415161718
  1. from rdflib import Resource
  2. class GenericResource(Resource):
  3. '''
  4. Generic RDF resource that extends from rdflib.Resource.
  5. This should also serve as the base class for LDP resource classes. Some
  6. convenience methods missing in that class can also be added here.
  7. '''
  8. def extract(self, p=None, o=None):
  9. '''
  10. Extract an in-memory copy of the resource containing either a
  11. sub-graph, defined with the `p` and `o` parameters, or the whole
  12. resource.
  13. '''
  14. # @TODO
  15. pass