<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def addResource(self, pid):
 """Add a resource to the Resource Map. Args: pid : str """

        self._check_initialized()
        try:
            # is entry already in place?
            self.getObjectByPid(pid)
            return
        except IndexError:
            pass
        # Entry not present, add it to the graph
        oid = self._pid_to_id(pid)
        obj = rdflib.URIRef(oid)
        ag = self.getAggregation()
        self.add((ag, ORE.aggregates, obj))
        self.add((obj, ORE.isAggregatedBy, ag))
        self.add((obj, DCTERMS.identifier, rdflib.term.Literal(pid)))