Package com.hp.hpl.squirrelrdf.ldap.test

Source Code of com.hp.hpl.squirrelrdf.ldap.test.Scratch

/**
* File:    Scratch.java
* Created: 08-Feb-2006
* Author:  Damian Steer
*
* (c) Copyright 2006, Hewlett-Packard Development Company, LP, all rights reserved.
*
* $Id$
*/
package com.hp.hpl.squirrelrdf.ldap.test;

import com.hp.hpl.jena.query.DatasetFactory;
import com.hp.hpl.jena.query.Query;
import com.hp.hpl.jena.query.QueryFactory;
import com.hp.hpl.jena.query.ResultSet;
import com.hp.hpl.jena.query.ResultSetFormatter;
import com.hp.hpl.jena.query.engine1.QueryEngine;
import com.hp.hpl.jena.rdf.model.Model;
import com.hp.hpl.jena.util.FileManager;
import com.hp.hpl.squirrelrdf.ldap.LdapQueryEngine;

/**
*
* A place for simple experiments (outside tests)
*
* @author pldms
*
*/
public class Scratch
{

  /**
   * @param args
   */
  public static void main(String[] args)
  {
    Model config = FileManager.get().loadModel("map.n3");
   
    Query query = QueryFactory.create(
        "prefix rdf:    <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n" +
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "prefix hp: <http://jena.hpl.hp.com/schemas/hpcorp#> \n" +
        "\n" +
        "select ?n where \n" +
        "{\n" +
        //"<ldap://ldap.hp.com/uid=martin.merry@hp.com,ou=people,o=hp.com> foaf:name ?name ;  " +
        //"hp:manager ?manager;   " +
        //"foaf:based_near [ hp:country ?country ] .  " +
        //"?manager foaf:name ?manname ." +
        "?x foaf:name 'Damian Steer' ; hp:manager ?y . ?z  foaf:name ?n . ?z hp:manager ?y . " +
        "}"
        );
   
    QueryEngine qe = new LdapQueryEngine(query, config);
    qe.setDataset(DatasetFactory.create());
    ResultSet res = qe.execSelect();
   
    ResultSetFormatter.out(System.out, res);
  }

}
TOP

Related Classes of com.hp.hpl.squirrelrdf.ldap.test.Scratch

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.