Package net.fortytwo.twitlogic.model

Examples of net.fortytwo.twitlogic.model.PlainLiteral


    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


                    && rating <= maxRating) {
                Resource review = context.anonymousNode();
                try {
                    context.handle(new Triple(context.getSubject(), HASREVIEW, review));
                    context.handle(new Triple(review, TYPE, REVIEW));
                    context.handle(new Triple(review, RATING, new PlainLiteral("" + rating)));
                    context.handle(new Triple(review, MAXRATING, new PlainLiteral("" + maxRating)));
                    context.handle(new Triple(review, MINRATING, new PlainLiteral("" + minRating)));
                    context.handle(new Triple(review, TEXT, new PlainLiteral(context.thisTweet().getText())));
                } catch (HandlerException e) {
                    throw new MatcherException(e);
                }

                // FIXME: restore this.  Currently, it causes a transaction to hang.
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

        assertExpected("@joshsh #knows @xixiluo",
                new Triple(JOSHSH, KNOWS, XIXILUO));
        assertExpected("@joshsh #knows #xixiluo",
                new Triple(JOSHSH, KNOWS, new Hashtag("xixiluo")));
        assertExpected("@joshsh #knows \"xixiluo\"",
                new Triple(JOSHSH, KNOWS, new PlainLiteral("xixiluo")));
        assertExpected("@joshsh #knows http://example.org/xixiluo",
                new Triple(JOSHSH, KNOWS, new TypedLiteral("http://example.org/xixiluo", XMLSchema.NAMESPACE + "anyURI")));
    }
View Full Code Here

                new Triple(JOSHSH_PERSON, KNOWS, new User("XixiLuo").getHeldBy()));
    }

    public void testDatatypeProperty() throws Exception {
        assertExpected("@joshsh (phone +1 555 123 4567)",
                new Triple(JOSHSH_PERSON, PHONE, new PlainLiteral("+1 555 123 4567")));
        assertExpected("@joshsh (phone number +1 555 123 4567)",
                new Triple(JOSHSH_PERSON, PHONE, new PlainLiteral("+1 555 123 4567")));
    }
View Full Code Here

    public void testAll() throws Exception {
        Resource review = bnode(bnodeIndex + 1);
        assertExpected("IMHO, #thebestmovieever (3/5) is only so-so.",
                new Triple(THEBESTMOVIEEVER, HASREVIEW, review),
                new Triple(review, TYPE, REVIEW),
                new Triple(review, RATING, new PlainLiteral("3")),
                new Triple(review, MAXRATING, new PlainLiteral("5")),
                new Triple(review, MINRATING, new PlainLiteral("0")),
                // FIXME: restore this once the corresponding statement is restored in ReviewMatcher
          //      new Triple(review, REVIEWER, tweetContext.thisPerson()),
                new Triple(review, TEXT, new PlainLiteral("IMHO, #thebestmovieever (3/5) is only so-so.")));
    }
View Full Code Here

TOP

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

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.