Package net.fortytwo.twitlogic.model

Examples of net.fortytwo.twitlogic.model.Resource


            // Only consider reviews of 4 or 5 total stars.  This avoids false
            // positives of the "(1/2)" -- first tweet of two -- variety.
            if ((4 == maxRating || 5 == maxRating)
                    && rating >= 0
                    && 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)));
View Full Code Here


        if (null == c) {
            return;
        }

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

        if (predicateMatches(predicate)) {
            try {
                context.handleCompletedTriple(new URIReference(getPropertyURI()), object);
View Full Code Here

    } */

    private void matchTriples(final List<Resource> sequence,
                              final Handler<Triple> resultHandler) throws MatcherException {
        for (int i = 0; i < sequence.size() - 2; i++) {
            Resource subject = sequence.get(i);
            Resource predicate = sequence.get(i + 1);
            Resource object = sequence.get(i + 2);

            if (null != subject && null != predicate && null != object
                    && isLegalTypeForPartOfSpeech(subject, PartOfSpeech.SUBJECT)
                    && isLegalTypeForPartOfSpeech(predicate, PartOfSpeech.PREDICATE)
                    && isLegalTypeForPartOfSpeech(object, PartOfSpeech.OBJECT)) {
View Full Code Here

    public void setUp() {
        matcher = new DemoAfterthoughtMatcher();
    }

    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")),
View Full Code Here

TOP

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

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.