def add_annotation(self, about, content, motivated_by="oa:describing"):
        # type: (str, List[str], str) -> str
        """Cheap URI relativize for current directory and /."""
        self.self_check()
        curr = self.base_uri + METADATA + "/"
        content = [c.replace(curr, "").replace(self.base_uri, "../")
                   for c in content]
        uri = uuid.uuid4().urn
        ann = {
            "uri": uri,
            "about": about,
            "content": content,
            "oa:motivatedBy": {"@id": motivated_by}
        }
        self.annotations.append(ann)
        return uri
def add_annotation ( self , about , content , motivated_by = "oa:describing" ) : self . self_check ( ) curr = self . base_uri + METADATA + "/" content = [ c . replace ( curr , "" ) . replace ( self . base_uri , "../" ) for c in content ] uri = uuid . uuid4 ( ) . urn ann = { "uri" : uri , "about" : about , "content" : content , "oa:motivatedBy" : { "@id" : motivated_by } } self . annotations . append ( ann ) return uri
Cheap URI relativize for current directory and /.