示例#1
0
def process_note(raw_note):
    if raw_note is None:
        return None
    p = ilxtr.literatureCitation
    for bit in  (b.strip() for b in raw_note.split('\n') if b.strip()):
        maybe_hypothesis = idFromShareLink(bit)
        if maybe_hypothesis:
            # TODO getDocInfoFromHypothesisId(maybe_hypothesis)
            yield p, rdflib.URIRef(shareLinkFromId(maybe_hypothesis))
        elif 'doi:' in bit or 'DOI:' in bit or 'doi.org' in bit:
            yield p, rdflib.URIRef('https://doi.org/' + normalizeDoi(bit))
        elif bit.startswith('http'):  # TODO parse the other things
            yield p, rdflib.URIRef(bit)
        else:
            yield p, rdflib.Literal(bit)  # FIXME cull editorial notes
示例#2
0
 def private_text(self):
     if self.isReleaseNode and self.public_id:
         return shareLinkFromId(self.public_id)