Get the annotation entries from an edge data dictionary.
777569
def _get_annotation_entries_from_data(self, graph: BELGraph, data: EdgeData) -> Optional[List[NamespaceEntry]]:
        """"""
        annotations_dict = data.get(ANNOTATIONS)
        if annotations_dict is not None:
            return [
                entry
                for url, names in self._iter_from_annotations_dict(graph, annotations_dict=annotations_dict)
                for entry in self.get_annotation_entries_by_names(url, names)
            ]
708357
public static int nvgraphGetEdgeData(
        nvgraphHandle handle, 
        nvgraphGraphDescr descrG, 
        Pointer edgeData, 
        long setnum)
    {
        return checkResult(nvgraphGetEdgeDataNative(handle, descrG, edgeData, setnum));
    }
538029
def build_annotation_dict_any_filter(annotations: Mapping[str, Iterable[str]]) -> EdgePredicate:
    
    if not annotations:
        return keep_edge_permissive

    @edge_predicate
    def annotation_dict_any_filter(edge_data: EdgeData) -> bool:
        """Check if the any of the annotations in the enclosed query match."""
        return _annotation_dict_any_filter(edge_data, query=annotations)

    return annotation_dict_any_filter
36215
def getAnnotations_via_tid(self,
                               tids,
                               LIMIT=25,
                               _print=True,
                               crawl=False):
        
        url_base = self.base_url + \
            '/api/1/term/get-annotations/{tid}?key=' + self.api_key
        urls = [url_base.format(tid=str(tid)) for tid in tids]
        return self.get(urls,
                        LIMIT=LIMIT,
                        _print=_print,
                        crawl=crawl)
796955
def get_annotations(event, key, namespace=None, matchfunc=None):
    """"""
    if matchfunc is None:
        matchfunc = _is_equal
    if isinstance(key, Exception):
        key = _error_repr(key)
    return [ann for ann in event.get("_humilis", {}).get("annotation", [])
            if (matchfunc(key, ann["key"]) and
                (namespace is None or ann.get("namespace") == namespace))]
922723
def get_edges_with_citations(self, citations: Iterable[Citation]) -> List[Edge]:
        """"""
        return self.session.query(Edge).join(Evidence).filter(Evidence.citation.in_(citations)).all()
1147924
def getBothEdges(self, label=None):
        """"""
        if label:
            for edge in self.neoelement.relationships.all(types=[label]):
                yield Edge(edge)
        else:
            for edge in self.neoelement.relationships.all():
                yield Edge(edge)
296574
def get_edges_with_citation(self, citation: Citation) -> List[Edge]:
        """"""
        return self.session.query(Edge).join(Evidence).filter(Evidence.citation == citation)
673722
def edge_list(self) -> List[Edge]:
        
        return [edge for edge in sorted(self._edges.values(), key=attrgetter("key"))]
57575
def annotated(self):
        
        # Build up dictionary of edge annotations.
        edge_annotations = {}
        for edge in self.edges:
            if edge not in edge_annotations:
                # We annotate all edges from a given object at once.
                referrer = self._tail[edge]
                known_refs = annotated_references(referrer)
                for out_edge in self._out_edges[referrer]:
                    referent = self._head[out_edge]
                    if known_refs[referent]:
                        annotation = known_refs[referent].pop()
                    else:
                        annotation = None
                    edge_annotations[out_edge] = annotation

        annotated_vertices = [
            AnnotatedVertex(
                id=id(vertex),
                annotation=object_annotation(vertex),
            )
            for vertex in self.vertices
        ]

        annotated_edges = [
            AnnotatedEdge(
                id=edge,
                annotation=edge_annotations[edge],
                head=id(self._head[edge]),
                tail=id(self._tail[edge]),
            )
            for edge in self.edges
        ]

        return AnnotatedGraph(
            vertices=annotated_vertices,
            edges=annotated_edges,
        )
1114948
def get_edges_with_annotation(self, annotation: str, value: str) -> List[Edge]:
        """"""
        query = self.session.query(Edge).join(NamespaceEntry, Edge.annotations).join(Namespace)
        query = query.filter(Namespace.keyword == annotation).filter(NamespaceEntry.name == value)
        return query.all()
1071417
def _annotation_iter_helper(graph) -> Iterable[str]:
    
    return (
        key
        for _, _, data in graph.edges(data=True)
        if ANNOTATIONS in data
        for key in data[ANNOTATIONS]
    )
881494
def getOutEdges(self, vertex, rawResults = False) :
        """"""
        return self.getEdges(vertex, inEdges = False, outEdges = True, rawResults = rawResults)
116711
def get_annotation_values(graph, annotation: str) -> Set[str]:
    
    return set(iter_annotation_values(graph, annotation))
959280
def iter_annotation_value_pairs(graph) -> Iterable[Tuple[str, str]]:
    
    return (
        (key, value)
        for _, _, data in graph.edges(data=True)
        if ANNOTATIONS in data
        for key, values in data[ANNOTATIONS].items()
        for value in values
    )
626536
def get_annotations_json(self):
        
        annotations = defaultdict(dict)

        for entry in self.annotations:
            annotations[entry.namespace.keyword][entry.name] = True

        return dict(annotations) or None
1252002
@Override
    public String edgeAnnotate(Edge edge) {
        String edgeAnnotation = "";
        try {
            edgeAnnotation = " " + dataflow.getAnalysis().factToString(dataflow.getAnalysis().getFactOnEdge(edge));
        } catch (Throwable e) {
            // ignore
        }
        return edgeAnnotation;
    }