Search in sources :

Example 36 with Triple

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

the class SecuredModelImpl method removeAllReifications.

@Override
public void removeAllReifications(final Statement s) throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException {
    checkUpdate();
    if (canDelete(new Triple(Node.ANY, RDF.subject.asNode(), wildCardNode(s.getSubject()))) && canDelete(new Triple(Node.ANY, RDF.predicate.asNode(), wildCardNode(s.getPredicate()))) && canDelete(new Triple(Node.ANY, RDF.object.asNode(), wildCardNode(s.getObject())))) {
        holder.getBaseItem().removeAllReifications(s);
    } else {
        final RSIterator iter = holder.getBaseItem().listReifiedStatements(s);
        try {
            while (iter.hasNext()) {
                final ReifiedStatement rs = iter.next();
                checkDelete(new Triple(rs.asNode(), RDF.subject.asNode(), wildCardNode(s.getSubject())));
                checkDelete(new Triple(rs.asNode(), RDF.predicate.asNode(), wildCardNode(s.getPredicate())));
                checkDelete(new Triple(rs.asNode(), RDF.object.asNode(), wildCardNode(s.getObject())));
            }
            holder.getBaseItem().removeAllReifications(s);
        } finally {
            iter.close();
        }
    }
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 37 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 38 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 39 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 40 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)

Aggregations

Triple (org.apache.jena.graph.Triple)406 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 TriplePattern (org.apache.jena.reasoner.TriplePattern)13 Op (org.apache.jena.sparql.algebra.Op)13 BasicPattern (org.apache.jena.sparql.core.BasicPattern)13 Model (org.apache.jena.rdf.model.Model)12 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 QuadWritable (org.apache.jena.hadoop.rdf.types.QuadWritable)8