Package net.fortytwo.twitlogic.model

Examples of net.fortytwo.twitlogic.model.URIReference


        if (l.startsWith("a ") | l.startsWith("an ")) {
            String rest = normed.substring(normed.indexOf(" ") + 1);

            if (TweetSyntax.HASHTAG_PATTERN.matcher(rest).matches()) {
                try {
                    context.handleCompletedTriple(new URIReference(RDF.TYPE), new Hashtag(rest.substring(1)));
                } catch (HandlerException e) {
                    throw new MatcherException(e);
                }
            } else {
                String rl = rest.toLowerCase();
View Full Code Here


    }

    private void produceGender(final Gender gender,
                               final AfterthoughtContext context) throws MatcherException {
        try {
            context.handleCompletedTriple(new URIReference(FOAF.GENDER),
                    new PlainLiteral(gender.toString()));
        } catch (HandlerException e) {
            throw new MatcherException(e);
        }
    }
View Full Code Here

    public void matchNormalized(final String normed,
                                final AfterthoughtContext context) throws MatcherException {
        if (normed.equals("+1")) {
            Triple t = new Triple(
                    context.thisPerson(),
                    new URIReference(FOAF.INTEREST),
                    context.getSubject());

            try {
                context.handle(t);
            } catch (HandlerException e) {
View Full Code Here

        Resource object = c.getObject();
        // Note: anything after the object is ignored

        if (predicateMatches(predicate)) {
            try {
                context.handleCompletedTriple(new URIReference(getPropertyURI()), object);
            } catch (HandlerException e) {
                throw new MatcherException(e);
            }
        }
    }
View Full Code Here

    // TODO: redirection resolution
    private TokenizedObjectPropertyClause forUrlObject(final String normed) {
        ThreeParts t = divide(normed, TweetSyntax.URL_PATTERN);
        return null == t
                ? null
                : new TokenizedObjectPropertyClause(t.first, new URIReference(t.second), t.third);
    }
View Full Code Here

       
        if (2 == a.length && 0 == a[0].length()) {
            String v = a[1].trim();
            if (0 < v.length()) {
                try {
                    context.handleCompletedTriple(new URIReference(propertyURI()),
                            new PlainLiteral(v));
                } catch (HandlerException e) {
                    throw new MatcherException(e);
                }
            }
View Full Code Here

        // TODO
        throw new IllegalStateException("not implemented");
    }

    public Resource anonymousNode() {
        return new URIReference(SesameTools.createRandomMiscellaneousURIString());
    }
View Full Code Here

            }
        }
    }

    protected URIReference bnode(final int id) {
        return new URIReference(BNODE_URI_BASE + id);
    }
View Full Code Here

            // Note: dollar tags are not "sniffed" here.

            Collection<URIReference> links = entities.getLinks();
            for (String s : TweetSyntax.findLinks(tweet.getText())) {
                links.add(new URIReference(s));
            }

            tweet.setEntities(entities);
        }
View Full Code Here

TOP

Related Classes of net.fortytwo.twitlogic.model.URIReference

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.