Package jcascalog.op

Examples of jcascalog.op.Count


        .predicate(Playground.GENDER, "?person", "m"));
  }

  public static void followsManyFollows() {
    Subquery manyFollows = new Subquery("?person").predicate(Playground.FOLLOWS, "?person", "_")
        .predicate(new Count(), "?count").predicate(new GT(), "?count", 2);
    Api.execute(new StdoutTap(), new Subquery("?person1", "?person2")
        .predicate(manyFollows, "?person1").predicate(manyFollows, "?person2")
        .predicate(Playground.FOLLOWS, "?person1", "?person2"));
  }
View Full Code Here


  }

  public static void followsManyFollowsConcise() {
    // this implementation uses Api.each to shorten the implementation
    Subquery manyFollows = new Subquery("?person").predicate(Playground.FOLLOWS, "?person", "_")
        .predicate(new Count(), "?count").predicate(new GT(), "?count", 2);
    Api.execute(new StdoutTap(), new Subquery("?person1", "?person2")
        .predicate(Api.each(manyFollows), "?person1", "?person2")
        .predicate(Playground.FOLLOWS, "?person1", "?person2"));
  }
View Full Code Here

  }

  public static void wordCount() {
    Api.execute(new StdoutTap(), new Subquery("?word", "?count")
        .predicate(Playground.SENTENCE, "?sentence").predicate(new Split(), "?sentence")
        .out("?word").predicate(new Count(), "?count"));
  }
View Full Code Here

  }

  public static void lineCountWithFiles() {
    Api.execute(Api.hfsTextline("/tmp/myresults"), new Subquery("?count")
        .predicate(Api.hfsTextline("src/jvm/jcascalog/example"), "_")
        .predicate(new Count(), "?count"));
  }
View Full Code Here

TOP

Related Classes of jcascalog.op.Count

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.