Package com.hp.hpl.jena.query

Examples of com.hp.hpl.jena.query.Query


   */
  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" +
View Full Code Here


  }
 
  /* Full SPARQL Query */
  public void test8()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "prefix hp: <http://jena.hpl.hp.com/schemas/hpcorp#> \n" +
        "\n" +
        "select * where \n" +
        "{\n" +
View Full Code Here

  }
 
  /* This will fail -- no lat and long for bristol (?) */
  public void testNegPos()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "prefix hp: <http://jena.hpl.hp.com/schemas/hpcorp#> \n" +
        "prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos#> \n" +
        "\n" +
        "select * where \n" +
View Full Code Here

  }
 
  /* There is a country, however */
  public void testPosPos()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "prefix hp: <http://jena.hpl.hp.com/schemas/hpcorp#> \n" +
        "\n" +
        "select * where \n" +
        "{\n" +
View Full Code Here

  }
 
  /* As above, but ASK */
  public void testNegAskPos()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "prefix hp: <http://jena.hpl.hp.com/schemas/hpcorp#> \n" +
        "\n" +
        "ask where \n" +
        "{\n" +
View Full Code Here

  }
 
  /* A positive ask */
  public void testPosAskPos()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "prefix hp: <http://jena.hpl.hp.com/schemas/hpcorp#> \n" +
        "\n" +
        "ask where \n" +
        "{\n" +
View Full Code Here

  }
 
  /* Very simple, but possibly tricky... */
  public void testTripleExists()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "\n" +
        "select * where \n" +
        "{\n" +
        " <ldap://ldap.hp.com/uid=damian.steer@hp.com,%20ou=people,%20o=hp.com> \n" +
View Full Code Here

  }
 
  /* Very simple, but possibly tricky... -- negative version of above */
  public void testTripleNotExists()
  {
    Query query = QueryFactory.create(
        "prefix foaf: <http://xmlns.com/foaf/0.1/> \n" +
        "\n" +
        "select * where \n" +
        "{\n" +
        " <ldap://ldap.hp.com/uid=damian.steer@hp.com,%20ou=people,%20o=hp.com> \n" +
View Full Code Here

        query("SELECT DISTINCT ?o { ?s ?p ?o }", storeDesc, jdbc) ;
    }
   
    public static void query(String queryString, StoreDesc storeDesc, Connection jdbcConnection)
    {
        Query query = QueryFactory.create(queryString) ;

        SDBConnection conn = new SDBConnection(jdbcConnection) ;
       
        Store store = StoreFactory.create(storeDesc, conn) ;
       
View Full Code Here

    }

    private static void example(Dataset ds, String qs, Filter<Tuple<NodeId>> filter)
    {
        System.out.println() ;
        Query query = QueryFactory.create(qs) ;
        System.out.println(qs) ;
        QueryExecution qExec = QueryExecutionFactory.create(query, ds) ;
        // Install filter for this query only.
        if ( filter != null )
        {
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.query.Query

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.