return(newAs);
histAddParent (RDF_Resource child, RDF_Resource parent){  Assertion nextAs, prevAs, newAs;   RDF_Resource s = gCoreVocab->RDF_parent;  RDF_ValueType type = RDF_RESOURCE_TYPE;  nextAs = prevAs = child->rarg1;  while (nextAs != null) {    if (asEqual(gHistoryStore, nextAs, child, s, parent, type)) return null;    prevAs = nextAs;    nextAs = nextAs->next;  }  newAs = makeNewAssertion(gHistoryStore, child, s, parent, type, 1);  if (prevAs == null) {    child->rarg1 = newAs;  } else {    prevAs->next = newAs;  }  nextAs = prevAs = parent->rarg2;  if (nextAs == NULL) {    parent->rarg2 = newAs;  } else {    PRBool added = 0;    if (bySite) {      while (nextAs && !isSeparator(nextAs->u)) {        prevAs = nextAs;        nextAs = nextAs->invNext;      }	  if (nextAs) {		prevAs = nextAs;		nextAs = nextAs->invNext;	  }    }    while (nextAs != null) {		char* nid =  resourceID(nextAs->u);        if (strcmp(resourceID(child),  resourceID(nextAs->u)) > 0) {          if (prevAs == nextAs) {            newAs->invNext = prevAs;            parent->rarg2  = newAs;            added = 1;            break;          } else {            newAs->invNext = nextAs;	                prevAs->invNext = newAs;            added = 1;            break;          }        }         prevAs = nextAs;        nextAs = nextAs->invNext;    }    if (!added) prevAs->invNext = newAs;  }  sendNotifications2(gHistoryStore, RDF_ASSERT_NOTIFY, child, s, parent, type, 1);  /* XXX have to mark the entire subtree XXX */  /*  sendNotifications(gHistoryStore->rdf, RDF_ASSERT_NOTIFY, child, s, parent, type, 1); */}