Search in sources :

Example 81 with Triple

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

the class SecuredSeqImpl method getFloat.

@Override
public float getFloat(final int index) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    final float retval = holder.getBaseItem().getFloat(index);
    checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), asObject(retval).asNode()));
    return retval;
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 82 with Triple

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

the class SecuredSeqImpl method getLiteral.

@Override
public SecuredLiteral getLiteral(final int index) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    final Literal literal = holder.getBaseItem().getLiteral(index);
    checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), literal.asNode()));
    return SecuredLiteralImpl.getInstance(getModel(), literal);
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 83 with Triple

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

the class SecuredSeqImpl method set.

@Override
public SecuredSeq set(final int index, final RDFNode o) throws UpdateDeniedException, AddDeniedException, AuthenticationRequiredException {
    checkUpdate();
    final Triple t2 = new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), o.asNode());
    final RDFNode rdfNode = holder.getBaseItem().getObject(index);
    if (rdfNode != null) {
        final Triple t1 = new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), rdfNode.asNode());
        checkUpdate(t1, t2);
    } else {
        checkCreate(t2);
    }
    holder.getBaseItem().set(index, o);
    return holder.getSecuredItem();
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 84 with Triple

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

the class SecuredSeqImpl method getResource.

@Override
public SecuredResource getResource(final int index) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    final Resource retval = holder.getBaseItem().getResource(index);
    checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), retval.asNode()));
    return SecuredResourceImpl.getInstance(getModel(), retval);
}
Also used : Triple(org.apache.jena.graph.Triple)

Example 85 with Triple

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

the class SecuredSeqImpl method getLanguage.

@Override
public String getLanguage(final int index) throws ReadDeniedException, AuthenticationRequiredException {
    checkRead();
    final Literal literal = holder.getBaseItem().getLiteral(index);
    checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index).asNode(), literal.asNode()));
    return literal.getLanguage();
}
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