Package net.fortytwo.twitlogic.persistence.beans

Examples of net.fortytwo.twitlogic.persistence.beans.Feature


            public void handle(final Place p) throws HandlerException {
                //System.out.println("received this place: " + p.getJson());
                client.getStatistics().placeDereferenced(p);

                if (0 < p.getContainedWithin().size()) {
                    Feature f = pContext.persist(p);
                    // Refreshing the parent features is all-or-nothing.
                    Set<Feature> parents = new HashSet<Feature>();

                    for (Place par : p.getContainedWithin()) {
                        //System.out.println("and this is a parent: " + par.getJson());

                        Feature parf = pContext.persist(par);
                        parents.add(parf);
                        try {
                            submit(par, parf);
                        } catch (TwitterClientException e) {
                            throw new HandlerException(e);
View Full Code Here


        p.setLat(point.getLatitude());
        return p;
    }

    public Feature persist(final Place place) {
        Feature f = (Feature) designate(uriOf(place), place.getPlaceType().getElmoClass());

        if (null != place.getName()) {
            f.setRdfsLabel(place.getName());
        }

        if (null != place.getFullName()) {
            f.setTitle(place.getFullName());
        }

        if (null != place.getUrl()) {
            Thing t = designate(place.getUrl(), Thing.class);
            // FIXME: I'm not sure how this Object Set is handled
            Set<Object> s = f.getRdfsSeeAlso();
            s.add(t);
            f.setRdfsSeeAlso(s);
        }

        // TODO: link into DBPedia and/or GeoNames
        if (null != place.getCountryCode()) {
            f.setCountryCode(place.getCountryCode());
        }

        /*
        if (null != place.getPlaceType()) {
            org.openrdf.concepts.rdfs.Class c = classForPlaceType(place.getPlaceType());
View Full Code Here

                s.add(p);
                currentMicroblogPost.setLocation(s);
            }

            if (null != tweet.getPlace()) {
                Feature f = persistenceContext.persist(tweet.getPlace());
                if (null != placeHelper) {
                    try {
                        placeHelper.submit(tweet.getPlace(), f);
                    } catch (TwitterClientException e) {
                        throw new HandlerException(e);
View Full Code Here

                        = new PersistenceContext(c);

                PlacePersistenceHelper ph = new PlacePersistenceHelper(pc, client, false);
                for (String id : ids) {
                    Place p = new Place(id);
                    Feature f = pc.persist(p);
                    ph.submit(p, f);
                    c.commit();
                }
            } finally {
                c.rollback();
View Full Code Here

TOP

Related Classes of net.fortytwo.twitlogic.persistence.beans.Feature

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.