Search in sources :

Example 66 with Triple

use of org.apache.jena.graph.Triple in project jena by apache.

the class SecuredModelImpl method createBag.

@Override
public SecuredBag createBag(final String uri) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
    checkUpdate();
    checkCreate(new Triple(NodeFactory.createURI(uri), RDF.type.asNode(), RDF.Bag.asNode()));
    return SecuredBagImpl.getInstance(holder.getSecuredItem(), holder.getBaseItem().createBag(uri));
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 67 with Triple

use of org.apache.jena.graph.Triple in project jena by apache.

the class SecuredModelImpl method getSeq.

@Override
public SecuredSeq getSeq(final String uri) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    checkRead(new Triple(NodeFactory.createURI(uri), RDF.type.asNode(), RDF.Seq.asNode()));
    return SecuredSeqImpl.getInstance(holder.getSecuredItem(), holder.getBaseItem().getSeq(uri));
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 68 with Triple

use of org.apache.jena.graph.Triple in project jena by apache.

the class SecuredModelImpl method createList.

@Override
public SecuredRDFList createList() throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
    checkUpdate();
    checkCreate(new Triple(SecurityEvaluator.FUTURE, RDF.first.asNode(), RDF.nil.asNode()));
    return SecuredRDFListImpl.getInstance(holder.getSecuredItem(), holder.getBaseItem().createList());
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 69 with Triple

use of org.apache.jena.graph.Triple in project jena by apache.

the class SecuredResourceImpl method hasLiteral.

/**
	 * Answer true iff this resource has the value <code>o</code> for property
	 * <code>p</code>. <code>o</code> is interpreted as a typed literal with the
	 * appropriate RDF type.
	 * 
	 * @throws ReadDeniedException
	 * @throws AuthenticationRequiredException
	 */
@Override
public boolean hasLiteral(final Property p, final boolean o) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    checkRead(new Triple(holder.getBaseItem().asNode(), p.asNode(), ResourceFactory.createTypedLiteral(o).asNode()));
    return holder.getBaseItem().hasLiteral(p, o);
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 70 with Triple

use of org.apache.jena.graph.Triple in project jena by apache.

the class SecuredResourceImpl method hasLiteral.

/**
	 * Answer true iff this resource has the value <code>o</code> for property
	 * <code>p</code>. <code>o</code> is interpreted as a typed literal with the
	 * appropriate RDF type.
	 * 
	 * @throws ReadDeniedException
	 * @throws AuthenticationRequiredException
	 */
@Override
public boolean hasLiteral(final Property p, final long o) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    checkRead(new Triple(holder.getBaseItem().asNode(), p.asNode(), ResourceFactory.createTypedLiteral(o).asNode()));
    return holder.getBaseItem().hasLiteral(p, o);
}
Also used : Triple(org.apache.jena.graph.Triple)

Aggregations

Triple (org.apache.jena.graph.Triple)407 Test (org.junit.Test)139 Node (org.apache.jena.graph.Node)95 BaseTest (org.apache.jena.atlas.junit.BaseTest)66 Graph (org.apache.jena.graph.Graph)54 Quad (org.apache.jena.sparql.core.Quad)25 TriplePath (org.apache.jena.sparql.core.TriplePath)22 ArrayList (java.util.ArrayList)20 StatsMatcher (org.apache.jena.sparql.engine.optimizer.StatsMatcher)19 Var (org.apache.jena.sparql.core.Var)17 TripleWritable (org.apache.jena.hadoop.rdf.types.TripleWritable)15 Model (org.apache.jena.rdf.model.Model)13 TriplePattern (org.apache.jena.reasoner.TriplePattern)13 Op (org.apache.jena.sparql.algebra.Op)13 BasicPattern (org.apache.jena.sparql.core.BasicPattern)13 TransitiveGraphCache (org.apache.jena.reasoner.transitiveReasoner.TransitiveGraphCache)11 LongWritable (org.apache.hadoop.io.LongWritable)10 InfGraph (org.apache.jena.reasoner.InfGraph)10 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)10 Resource (org.apache.jena.rdf.model.Resource)9