Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model


        //Expr expr = ExprUtils.parse("?z < 2 ") ;
        Expr expr = new E_LessThan(new ExprVar(var_z), NodeValue.makeNodeInteger(2)) ;
        op = OpFilter.filter(expr, op) ;

        // ---- Example setup
        Model m = makeModel() ;
        m.write(System.out, "TTL") ;
        System.out.println("--------------") ;
        System.out.print(op) ;
        System.out.println("--------------") ;

        // ---- Execute expression
        QueryIterator qIter = Algebra.exec(op, m.getGraph()) ;
       
        // -------- Either read the query iterator directly ...
        if ( false )
        {
            for ( ; qIter.hasNext() ; )
View Full Code Here


    }

    private static Model makeModel()
    {
        String BASE = "http://example/" ;
        Model model = ModelFactory.createDefaultModel() ;
        model.setNsPrefix("", BASE) ;
        Resource r1 = model.createResource(BASE+"r1") ;
        Resource r2 = model.createResource(BASE+"r2") ;
        Property p1 = model.createProperty(BASE+"p") ;
        Property p2 = model.createProperty(BASE+"p2") ;
        RDFNode v1 = model.createTypedLiteral("1", XSDDatatype.XSDinteger) ;
        RDFNode v2 = model.createTypedLiteral("2", XSDDatatype.XSDinteger) ;
       
        r1.addProperty(p1, v1).addProperty(p1, v2) ;
        r1.addProperty(p2, v1).addProperty(p2, v2) ;
        r2.addProperty(p1, v1).addProperty(p1, v2) ;
       
View Full Code Here

   
    public static void main(String[] args)
    {
        // Create the data.
        // This wil be the background (unnamed) graph in the dataset.
        Model model = createModel() ;
       
        // First part or the query string
        String prolog = "PREFIX dc: <"+DC.getURI()+">" ;
       
        // Query string.
View Full Code Here

        }
    }
   
    public static Model createModel()
    {
        Model m = ModelFactory.createDefaultModel() ;
       
        Resource r1 = m.createResource("http://example.org/book#1") ;
        Resource r2 = m.createResource("http://example.org/book#2") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
View Full Code Here

{
    static public final String NL = System.getProperty("line.separator") ;
   
    public static void main(String[] args)
    {
        Model model = createModel() ;
       
        Query query = QueryFactory.make() ;
        query.setQuerySelectType() ;
       
        // See also ExProg1
View Full Code Here

        }
    }
   
    public static Model createModel()
    {
        Model model = ModelFactory.createDefaultModel() ;
       
        Resource r1 = model.createResource("http://example.org/book#1") ;
        Resource r2 = model.createResource("http://example.org/book#2") ;
        Resource r3 = model.createResource("http://example.org/book#3") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
View Full Code Here

   
    public static void main(String[] args)
    {
        // Create the data.
        // This wil be the background (unnamed) graph in the dataset.
        Model model = createModel() ;
       
        // First part or the query string
        String prolog = "PREFIX dc: <"+DC.getURI()+">" ;
       
        // Query string.
View Full Code Here

        }
    }
   
    public static Model createModel()
    {
        Model m = ModelFactory.createDefaultModel() ;
       
        Resource r1 = m.createResource("http://example.org/book#1") ;
        Resource r2 = m.createResource("http://example.org/book#2") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
View Full Code Here

{
    static public final String NL = System.getProperty("line.separator") ;
   
    public static void main(String[] args)
    {
        Model model = createModel() ;
       
        Query query = QueryFactory.make() ;

        query.setQuerySelectType() ;
       
View Full Code Here

        }
    }
   
    public static Model createModel()
    {
        Model model = ModelFactory.createDefaultModel() ;
       
        Resource r1 = model.createResource("http://example.org/book#1") ;
        Resource r2 = model.createResource("http://example.org/book#2") ;
        Resource r3 = model.createResource("http://example.org/book#3") ;
       
        r1.addProperty(DC.title, "SPARQL - the book")
          .addProperty(DC.description, "A book about SPARQL") ;
       
        r2.addProperty(DC.title, "Advanced techniques for SPARQL") ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.rdf.model.Model

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.