use of org.openrdf.model.Statement in project blueprints by tinkerpop.
the class PropertyGraphSailConnection method vertexPropertiesWithKey.
private StatementGenerator<Vertex> vertexPropertiesWithKey(final String key, final URI pred) {
return new StatementGenerator<Vertex>() {
public void generate(Vertex source, Collection<Statement> results) {
Object o = source.getProperty(key);
if (null != o) {
Literal object = toLiteral(o);
if (null != object) {
Statement s = context.valueFactory.createStatement(uriForVertex(source), pred, object);
results.add(s);
}
}
}
};
}
use of org.openrdf.model.Statement in project blueprints by tinkerpop.
the class PropertyGraphSailConnection method generateIdStatement.
private void generateIdStatement(final Element e, final URI uri, final Collection<Statement> results) {
Statement s = context.valueFactory.createStatement(uri, PropertyGraphSail.ID, toLiteral(e.getId()));
results.add(s);
}
use of org.openrdf.model.Statement in project blueprints by tinkerpop.
the class PropertyGraphSailConnection method generateLabelStatement.
private void generateLabelStatement(final Edge e, final URI uri, final Collection<Statement> results) {
Statement s = context.valueFactory.createStatement(uri, PropertyGraphSail.LABEL, context.valueFactory.createLiteral(e.getLabel()));
results.add(s);
}
use of org.openrdf.model.Statement in project blueprints by tinkerpop.
the class PropertyGraphSailConnection method edgePropertiesWithKey.
private StatementGenerator<Edge> edgePropertiesWithKey(final String key, final URI pred) {
return new StatementGenerator<Edge>() {
public void generate(Edge source, Collection<Statement> results) {
Object o = source.getProperty(key);
if (null != o) {
Literal object = toLiteral(o);
if (null != object) {
Statement s = context.valueFactory.createStatement(uriForEdge(source), pred, object);
results.add(s);
}
}
}
};
}
use of org.openrdf.model.Statement in project blueprints by tinkerpop.
the class PropertyGraphSailConnection method edgePropertiesWithKeyAndValue.
private StatementGenerator<Edge> edgePropertiesWithKeyAndValue(final String key, final URI pred, final Object value, final Literal object) {
return new StatementGenerator<Edge>() {
public void generate(Edge source, Collection<Statement> results) {
Object o = source.getProperty(key);
if (null != o && o.equals(value)) {
Statement s = context.valueFactory.createStatement(uriForEdge(source), pred, object);
results.add(s);
}
}
};
}
Aggregations