- static class ConnectionImpl implements Connection {
-
- final private StandardGraphPropertyVariable connectionPoint;
-
- public ConnectionImpl(StandardGraphPropertyVariable connectionPoint) {
- this.connectionPoint = connectionPoint;
- }
-
- @Override
- public Collection<Variable> getConnectionPoints(ReadGraph graph, Resource relationType) throws DatabaseException {
- Set<Variable> result = new THashSet<Variable>();
- for(VariableConnectionPointDescriptor desc : ConnectionBrowser.flatten(graph, connectionPoint.parent, connectionPoint.property.predicate, relationType)) {
- result.add(desc.getVariable(graph));
- }
- return result;
- }
-
- @Override
- public Collection<String> getConnectionPointURIs(ReadGraph graph, Resource relationType) throws DatabaseException {
- Set<String> result = new THashSet<String>();
- for(VariableConnectionPointDescriptor desc : ConnectionBrowser.flatten(graph, connectionPoint.parent, connectionPoint.property.predicate, relationType)) {
- result.add(desc.getURI(graph));
- }
- return result;
- }
-
- @Override
- public Collection<VariableConnectionPointDescriptor> getConnectionPointDescriptors(ReadGraph graph, Resource relationType) throws DatabaseException {
- return ConnectionBrowser.flatten(graph, connectionPoint.parent, connectionPoint.property.predicate, relationType);
- }
-
- }
-