Examples of SimpleTriplePattern


Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

    SimpleSelectQuery selectQuery = new SimpleSelectQuery();
    selectQuery.addSelection(resource);

    Variable myType = new Variable("myType");
    Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
    triplePatterns.add(new SimpleTriplePattern(resource,
        new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), myType));

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

    selectQuery.addSelection(a);
    selectQuery.addSelection(b);
    selectQuery.addSelection(c);

    Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
    triplePatterns.add(new SimpleTriplePattern(a, b, c));
    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
    selectQuery.setQueryPattern(queryPattern);
    selectQuery.addOrderCondition(new SimpleOrderCondition(c, false));
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

    selectQuery.addSelection(title);
    selectQuery.addSelection(price);

    Variable x = new Variable("x");
    Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
    triplePatterns.add(new SimpleTriplePattern(x,
        new UriRef("http://purl.org/dc/elements/1.1/title"), title));

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);

    Set<TriplePattern> triplePatternsOpt = new HashSet<TriplePattern>();
    triplePatternsOpt.add(new SimpleTriplePattern(x,
        new UriRef("http://example.org/ns#price"), price));

    SimpleBasicGraphPattern bgpOpt =
        new SimpleBasicGraphPattern(triplePatternsOpt);
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

    SimpleSelectQuery selectQuery = new SimpleSelectQuery();
    selectQuery.addSelection(p);

    Variable x = new Variable("x");
    Set<TriplePattern> triplePatterns = new HashSet<TriplePattern>();
    triplePatterns.add(new SimpleTriplePattern(
        new UriRef("http://localhost/testitem"), p, x));

    SimpleBasicGraphPattern bgp = new SimpleBasicGraphPattern(triplePatterns);
    SimpleGroupGraphPattern queryPattern = new SimpleGroupGraphPattern();
    queryPattern.addGraphPattern(bgp);
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

            object = new UriRefOrVariable((UriRef) arg2);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

            object = new ResourceOrVariable(((LiteralExpression) arg2).getLiteral());
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

        subject = new UriRefOrVariable((UriRef) subjectCSO.getClerezzaObject());
        predicate = new UriRefOrVariable((UriRef) predicateCSO.getClerezzaObject());
        object = new ResourceOrVariable(new BNode());

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

            object = new ResourceOrVariable((UriRef) cl);
        } else {
            throw new RuleAtomCallExeption(getClass());
        }

        return (T) new ClerezzaSparqlObject(new SimpleTriplePattern(subject, predicate, object));

    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

        ResourceOrVariable s = new ResourceOrVariable(new UriRef(subject));
        UriRefOrVariable p = new UriRefOrVariable(new UriRef(predicate));
        ResourceOrVariable o = new ResourceOrVariable(new Variable(variable));

        Assert.assertTrue(triplePatterns.contains(
                new SimpleTriplePattern(s, p, o)));
    }
View Full Code Here

Examples of org.apache.clerezza.rdf.core.sparql.query.impl.SimpleTriplePattern

        BasicGraphPattern bgp = (BasicGraphPattern) gp;

        Set<TriplePattern> triplePatterns = bgp.getTriplePatterns();
        Assert.assertTrue(triplePatterns.size()==2);

        Assert.assertTrue(triplePatterns.contains(new SimpleTriplePattern(
                new Variable("a"), new Variable("x"),
                new PlainLiteralImpl("tiger"))));

        Assert.assertTrue(triplePatterns.contains(new SimpleTriplePattern(
                new Variable("a"), new Variable("x"),
                new PlainLiteralImpl("lion", new Language("en")))));
    }
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.