Examples of Triple


Examples of Core.Triple

  public void addTool(String packageName,Tool tool){
    String id = tool.getID();
    String package_ = packageName;
    String mypath =  ToolPairToRelativePath(id,packageName);
   
    toolDB.put(id, new Triple(mypath, package_, tool));
    /*
     * Add to index tree.
     */
    ToolEntry toolEntry = new ToolEntry();
    toolEntry.path = mypath;
View Full Code Here

Examples of com.franz.agbase.Triple

  }

 
  public static void showResults(Log log, TriplesIterator it) throws AllegroGraphException {
      for (int i=0; it.hasNext(); i++) {
      Triple triple = it.next();
      log.info("Solution " + (i+1) + ": " +triple);
    }
  }
View Full Code Here

Examples of com.franz.agbase.Triple

   
    out.printf("<table class=\"inline\">%n");

      for (int i=0; it.hasNext(); i++) {
        out.printf("<tr>%n");
        Triple triple = it.next();
       
        String[] objects = { triple.getSubjectLabel(), triple.getPredicateLabel(), triple.getObjectLabel() };
        for (int j = 0; j < objects.length; j++) {
          String value = objects[j];
         
        String link = Util.getLink(value);
        if ( link != null ) {
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

        BasicPattern bp = new BasicPattern() ;
        Var var_x = Var.alloc("x") ;
        Var var_z = Var.alloc("z") ;
       
        // ---- Build expression
        bp.add(new Triple(var_x, Node.createURI(BASE+"p"), var_z)) ;
        Op op = new OpBGP(bp) ;
        //Expr expr = ExprUtils.parse("?z < 2 ") ;
        Expr expr = new E_LessThan(new ExprVar(var_z), NodeValue.makeNodeInteger(2)) ;
        op = OpFilter.filter(expr, op) ;
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

        ElementGroup elg = new ElementGroup() ;
       
        Var varTitle = Var.alloc("title") ;
        Var varX = Var.alloc("x") ;
       
        Triple t1 = new Triple(varX, DC.title.asNode(),  varTitle) ;
        elg.addTriplePattern(t1) ;
       
        // Adds a filter.  Need to wrap variable in a NodeVar.
        Expr expr = new E_Regex(new ExprVar(varTitle), "sparql", "i") ;
        ElementFilter filter = new  ElementFilter(expr) ;
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

        ElementGroup elg = new ElementGroup() ;
       
        Var varTitle = Var.alloc("title") ;
        Var varX = Var.alloc("x") ;
       
        Triple t1 = new Triple(varX, DC.title.asNode(),  varTitle) ;
        elg.addTriplePattern(t1) ;
       
        // Don't use bNodes for anon variables.  The conversion is done in parsing.
        // BNodes here are assumed to be values from the target graph.
        Triple t2 = new Triple(varX, DC.description.asNode(), Var.alloc("desc")) ;
        elg.addTriplePattern(t2) ;
       
        // Attach the group to query. 
        query.setQueryPattern(elg) ;
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

        // Better
        // Build a SPARQL algebra expression
        Var var2 = createNewVar() ;                     // Hidden variable
       
        BasicPattern bp = new BasicPattern() ;
        Triple t = new Triple(nodeVar, RDFS.label.asNode(), var2) ;
        bp.add(t) ;
        OpBGP op = new OpBGP(bp) ;
       
        Expr regex = new E_Regex(new ExprVar(var2.getName()), pattern, "i") ;
        Op filter = OpFilter.filter(regex, op) ;
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

    private QueryIterator buildSyntax(QueryIterator input, Node nodeVar, String pattern, ExecutionContext execCxt)
    {
        Var var2 = createNewVar() ;
        // Triple patterns for   ?x rdfs:label ?hiddenVar
        ElementTriplesBlock elementBGP = new ElementTriplesBlock();
        Triple t = new Triple(nodeVar, RDFS.label.asNode(), var2) ;
        elementBGP.addTriple(t) ;
       
        // Regular expression for  regex(?hiddenVar, "pattern", "i")
        Expr regex = new E_Regex(new ExprVar(var2.getName()), pattern, "i") ;
       
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

        Graph graph = execCxt.getActiveGraph() ;
       
        ExtendedIterator<Triple>iter = graph.find(Node.ANY, Node.ANY, Node.ANY) ;
        for ( ; iter.hasNext() ; )
        {
            Triple t = iter.next() ;
            slot(bindings, input, t.getSubject(),   subjVar, nodeLocalname) ;
            slot(bindings, input, t.getPredicate(), subjVar, nodeLocalname) ;
            slot(bindings, input, t.getObject(),    subjVar, nodeLocalname) ;
        }
        return new QueryIterPlainWrapper(bindings.iterator(), execCxt) ;
    }
View Full Code Here

Examples of com.hp.hpl.jena.graph.Triple

    InfGraph graph = context.getGraph();
    Node s = env.getGroundVersion(args[0]);
    Node p = env.getGroundVersion(args[1]);
    Node o = env.getGroundVersion(args[2]);
    try {
      Triple t = Triple.create(s,p,o);
      Reifier r = graph.getReifier();
      Node a = Node.createAnon();
      r.reifyAs(a,t);
      env.bind(args[3],a);
      return true;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.