Ignore:
Timestamp:
Sep 25, 2012, 7:47:58 PM (12 years ago)
Author:
dwinter
Branch:
default
Message:

annotationbrowser

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/de/mpiwg/itgroup/annotations/neo4j/AnnotationStore.java

    r29 r31  
    8585    }
    8686
     87   
     88   
    8789    public List<Actor> getActors(String key, String query, NodeTypes type) {
    8890        ArrayList<Actor> actors = new ArrayList<Actor>();
     
    123125    }
    124126   
     127   
     128    /**
     129     * Returns List of Annotations.
     130     * Key has to be indexed.
     131     *
     132     * @param key
     133     * @param query
     134     * @return
     135     */
     136    public List<Annotation> getAnnotations(String key, String query) {
     137        ArrayList<Annotation> annotations = new ArrayList<Annotation>();
     138        Index<Node> idx = getNodeIndex(NodeTypes.ANNOTATION);
     139        if (key == null) {
     140            key = "id";
     141            query = "*";
     142        }
     143        IndexHits<Node> annotNodes = idx.query(key, query);
     144        for (Node annotNode : annotNodes) {
     145            Annotation annotation = createAnnotationFromNode(annotNode);
     146            annotations.add(annotation);
     147        }
     148        return annotations;
     149    }
     150
     151 
    125152   
    126153    /**
Note: See TracChangeset for help on using the changeset viewer.