if (null == v) {
if (!firstClassEdges) {
return new StatementIteration();
}
Edge e = edgeForURI((URI) subject);
if (null == e) {
return new StatementIteration();
} else {
Source<Edge> s = new Source<Edge>(new SingleItemIterator<Edge>(e), edgeTypes);
return new StatementIteration(s);
}
} else {
Source<Vertex> s = new Source<Vertex>(new SingleItemIterator<Vertex>(v), vertexTypes);
return new StatementIteration(s);
}
} else if (predicate.equals(PropertyGraphSail.ID)) {
Vertex v = vertexForURI((URI) subject);
if (null == v) {
if (!firstClassEdges) {
return new StatementIteration();
}
Edge e = edgeForURI((URI) subject);
if (null == e) {
return new StatementIteration();
} else {
Source<Edge> s = new Source<Edge>(new SingleItemIterator<Edge>(e), edgeIds);
return new StatementIteration(s);
}
} else {
Source<Vertex> s = new Source<Vertex>(new SingleItemIterator<Vertex>(v), vertexIds);
return new StatementIteration(s);
}
} else if (predicate.equals(PropertyGraphSail.LABEL)) {
if (!firstClassEdges) {
return new StatementIteration();
}
Edge e = edgeForURI((URI) subject);
if (null == e) {
return new StatementIteration();
} else {
Source<Edge> s = new Source<Edge>(new SingleItemIterator<Edge>(e), labels);
return new StatementIteration(s);
}
} else if (predicate.equals(PropertyGraphSail.HEAD)) {
if (!firstClassEdges) {
return new StatementIteration();
}
Edge e = edgeForURI((URI) subject);
if (null == e) {
return new StatementIteration();
} else {
Source<Edge> s = new Source<Edge>(new SingleItemIterator<Edge>(e), heads);
return new StatementIteration(s);
}
} else if (predicate.equals(PropertyGraphSail.TAIL)) {
if (!firstClassEdges) {
return new StatementIteration();
}
Edge e = edgeForURI((URI) subject);
if (null == e) {
return new StatementIteration();
} else {
Source<Edge> s = new Source<Edge>(new SingleItemIterator<Edge>(e), tails);
return new StatementIteration(s);
}
} else if (isPropertyPredicate(predicate)) {
String key = keyFromPredicate(predicate);
Vertex v = vertexForURI((URI) subject);
if (null == v) {
if (!firstClassEdges) {
return new StatementIteration();
}
Edge e = edgeForURI((URI) subject);
if (null == e) {
return new StatementIteration();
} else {
Source<Edge> s = new Source<Edge>(new SingleItemIterator<Edge>(e), edgePropertiesWithKey(key, predicate));
return new StatementIteration(s);